ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kris Schneider" <kschnei...@gmail.com>
Subject Re: Object canonicalization?
Date Mon, 12 Mar 2007 12:25:47 GMT
On 3/12/07, John Indra <ji.milist@gmail.com> wrote:
> On 3/12/07, Gordon Ross <G.Ross@ccw.gov.uk> wrote:
>
> Thanks for replying Gordon.
>
> > I think you are confusing objects and primitive data types.
>
> I am not. I understand object vs primitive data type in Java.
>
> > Each field/column in a row is returned as an Object (of the relevant
> > type). In this case, your field is being returned as a Boolean object,
> > with it's property set to either true or false. If your table has a
> > column of some character type, then each row would be returned with
> > individual Objects of type String.
> > Does this make sense ?
>
> Yes, and if I query the 1000 User object which has a property of type
> Boolean, with each row map to User object, I will have 1000 Boolean
> objects each attached to every User object right? I thought that in a
> perfect world, there will only be 2 Boolean object and the each 1000
> User objects will reference one of the two Boolean object.

It's easy enough to verify that there are places in the 2.3.0 codebase
that use "new Boolean(...)" instead of Boolean.TRUE or Boolean.FALSE
(or even one of the Boolean.valueOf methods).

> Please enlighten if u think I still don't get it.
>
> Thanks,
> John

-- 
Kris Schneider <mailto:kschneider@gmail.com>

Mime
View raw message