ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Goodin <brandon.goo...@gmail.com>
Subject Re: Object Oriented Loading Best Practice
Date Mon, 02 May 2005 17:54:56 GMT
If you have no need to load the child objects then don't use a complex
result in your resultMap.

Brandon

On 5/2/05, Nic Werner <werner@sonoma.edu> wrote:
> Hi,
>     I have several objects in my program which have a bit of a
> hierarchy, ie A contains B, B contains C and so on. Each table in the DB
> is linked to each other by a foreign key on a unique ID. I have iBATIS
> populating each Bean by using a resultMap and calling on the object's
> Select statement to populate the encapsulated Bean. Meaning, if I try
> and load info for B, it makes a call to the DB for B, and also for C.
> 
> My question is: Is this the best way to go about things? If I am loading
> A, it is going to create a call for A,B and C, where normally (w/o
> IBATIS) I would just create a statement that contained a join of all
> three tables on their unique IDs - and only one DB call.
> 
> Let me know if I need to explain more.
> 
> Thanks,
> 
> - Nic.
>

Mime
View raw message