Hi Shagufta,
I think u should treat Price as a value type class associated to Item entity.
What this means is jus ask these questions,
do Price needs to be entity class (a DB identity) i.e. do they need to have a separate DB identification.
I think it can be treated as an attribute of Item. They have to be associated with identification of an Item instead of their independent identity.
I would have done below:
Item Pojo
Code:
Class Item {
Price initialPrice;
Price reservedPrice;
}
Item Table:
Item_ID
Seperate Columns for initialPrice fields
Seperate Columns for reservedPrice fields
Item HB Mapping:
I would have used Component mapping concept to persist my whole Item object.
Hope Im making sense.
Regards
Nitesh