Say I have this class:
Class A {
int id;
int[] b;
}
Class B {
int id;
}
Class A has a one-to-many relationship with class B. I already have a service that caches objects B and returns them to id.
The table layout looks something like this:
Table a:
-------
int id,
prop1,
etc
Table a_to_b_map
----------------
int a_id,
int b_id
Now, how do I display this in iBatis?
Since B objects are already cached, I want to get a list of identifiers in A-objects, and then use the service to enrich As.
Can anyone suggest how to do this?
There are two possible alternatives:
- Create an inner class in (AtoB map) and use the select query in the iBatis configuration to populate this
- Inside iBatis resultMap / select, use another choice to get a list of B identifiers (not too sure how to do this in the configuration)