I have a database that is similar to the following:
create table Store(storeId)
create table Staff(storeId_fk, staff_id, staffName)
create table Item(storeId_fk, itme_id, itemName)
The Store table is large.
And I have create the following java bean
public class Store
{
List<Staff> myStaff
List<Item> myItem
....
}
public class Staff
{
...
}
public class Item
{
...
}
My question is how can I use iBatis's result map to EFFICIENTLY map from the tables to the java object?
I tried:
<resultMap id="storemap" class="my.example.Store">
<result property="myStaff" resultMap="staffMap"/>
<result property="myItem" result="itemMap"/>
</resultMap>
(other maps omitted)
But it's way too slow since the Store table is VERY VERY large.
I tried to follow the example in Clinton's developer guide for the N+1 solution, but I cannot warp my mind around how to use the "groupBy" for an object with 2 list...
Any help is appreciated!