Hi,
I have two classes that looks like the classic Order/Item example:
Code:
Class Item {
Long itemId;
String name;
}
Class Order {
Long orderId
Set Items;
}
The is a relation of many-to-one between Item and Order, and one-to-many vice versa.
Inside Order, I'd like to have a getItemById() method, so basically I thought about holding the items in a map (int->Item). I'm quite newbie to Hibernate, so I have no clue how to do it, and I haven't found references on the web.
I use Hibernate 3.0.5 and MySQL/InnoDB if it helps.
Thanks,
David