ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gordon Ross" <G.R...@ccw.gov.uk>
Subject Re: Object canonicalization?
Date Mon, 12 Mar 2007 09:10:56 GMT
>>> On 12 March 2007 at 08:56, in message
<eff5da7a0703120156t37f8dd71mf41bf07d049b6610@mail.gmail.com>, "John
Indra"
<ji.milist@gmail.com> wrote:
> Hi...
> 
> I am a very happy iBATIS user and I am still new to Java.
> 
> I have this question after reading "Pro Spring" chapter 10, "What is
> missing?". From my understanding, the book says if I have 1000 rows
> with a column in boolean that need to be map to Boolean object,
SqlMap
> will create 1000 Boolean objects whereas I will mostly need 2
Boolean
> objects right?

I don't know the book, so I could be barking up the wrong tree here
but...

I think you are confusing objects and primitive data types.

An object of type Boolean has a property with a primitive type boolean.
The type boolean can be either true or false.

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 ?

GTG

Mime
View raw message