Hibernate one-to-many map without foreign key

Nazwa

New Member
Hi I have a class that contains a map :\[code\]private Map<class2, List<Integer>> abc;\[/code\]Now in my implementation I get the following tables:\[code\]class 1:+------+-----+| Date | abc |+------+-----+class 2:+----+------+------+| ID | Name | Date |+----+------+------+\[/code\]But I dont want a foreign key in class 2 I want a 3rd table that would look like this:\[code\]class 1:+------+-----+| Date | abc |+------+-----+class 2:+----+------+| ID | Name |+----+------+class1+2+-------+----+| Date | id |+-------+----+| 17.02 | 1 || 17.02 | 2 || 18.02 | 1 |+-------+----+\[/code\]Now the thing is this should be a one-to-many relation and not a many-to-many.Can someone post a compilable xml mapping for my problem e.g. something like:\[code\]<map name="abc" table="MEAL_DAY" lazy="true" access="field"> <key> <column name="DATE" /> </key> .....<one-to-many ... </map>\[/code\]I would be very grateful. Thanks
 
Top