Re: IBatis: boolean mapping misunderstanding

2010-05-03 Thread Guy Rouillier
On 5/3/2010 5:09 AM, vadboss wrote: I have in the table a boolean (tinyint(1)) value. I don't know why, but ibatis always gets it as true, whether it is 0, or 1 in database. Who knows what is the cause? You provided very little information. What version of iBATIS? What database and version

Re: IBatis: boolean mapping misunderstanding

2010-05-03 Thread vadboss
INSERT INTO clock_operations (user_id, date, clock_in) VALUES (#{id}, #{lastActionDate}, true) INSERT INTO clock_operations (user_id, date, clock_in) VALUES (#{id}, #

Re: IBatis: boolean mapping misunderstanding

2010-05-03 Thread Larry Meadors
OK, so you have a boolean in your bean, and a tinyint in your database and it's getting mapped to true regardless of the int value. What about insert/update? Are they setting the database to 0 and 1, or always using the same value? Larry --

Re: IBatis: boolean mapping misunderstanding

2010-05-03 Thread vadboss
package domain; import java.util.Date; public class ClockUser { private int id; private String username; private String password; private boolean clockedIn; private Date lastActionDate; public ClockUser() { lastActionDate = new Da

Re: IBatis: boolean mapping misunderstanding

2010-05-03 Thread Larry Meadors
and domain.ClockUser is? On Mon, May 3, 2010 at 5:59 AM, vadboss wrote: > > It's IBatis 3. > > Here is the statement: >                resultType="domain.ClockUser"> >                SELECT users.id, users.username, users.password, >                MAX(clock_operations.date) as lastActionDate, >

Re: IBatis: boolean mapping misunderstanding

2010-05-03 Thread vadboss
It's IBatis 3. Here is the statement: SELECT users.id, users.username, users.password, MAX(clock_operations.date) as lastActionDate, clock_operations.clock_in as clockedIn FROM users, clock_operations

Re: IBatis: boolean mapping misunderstanding

2010-05-03 Thread Larry Meadors
Maybe with some info. Using ibatis2 or 3? Can you provide your mapped statement? Throw us a bone here. :P Larry On Mon, May 3, 2010 at 3:09 AM, vadboss wrote: > > I have in the table a boolean (tinyint(1)) value. I don't know why, but > ibatis always gets it as true, whether it is 0, or 1 in

IBatis: boolean mapping misunderstanding

2010-05-03 Thread vadboss
I have in the table a boolean (tinyint(1)) value. I don't know why, but ibatis always gets it as true, whether it is 0, or 1 in database. Who knows what is the cause? -- View this message in context: http://old.nabble.com/IBatis%3A-boolean-mapping-misunderstanding-tp28432952p28432952.html Sent