Hi guys,
I have a class called Customer. To make a one-to-many relationship between this Customer and his accounts (identified by Account class), I can define a Set/Map/List type property called accounts inside the Customer class and make the necessary mappings inside the .hbm.xml corresponding to Customer and Account classes.
I would like to know if I can avoid defining these Colleciton type properties inside the Class from which I need to make a one-to-many relationship. Because in future, there can be another Class say Address to which I need to make the same kind of relationships and in that case, I need to make changes in the Customer class again. I want to avoid making changes in my Transfer objects once they are created. If I can somehow manage these Colleciton type propery definition outside the Customer class, I can accomplish this.
Please help me how I can do this.
Thanks,
Bostonguy
|