class SubMenu
{
@OneToMany(targetEntity=AbstractMenuItem.class,
cascade=CascadeType.MERGE,fetch=FetchType.EAGER)
@IndexColumn(name="position")
@JoinTable(name="relation_submenu_menuitem",
joinColumns={@JoinColumn(name="sub_menu_reference")},
inverseJoinColumns={@JoinColumn(name="menu_item_reference")})
public List<MenuItem> getMenuItems()
{
return menuItems;
}
...
}
My expected primary key of relation_submenu_menuitem is primary key{sub_menu_reference,menu_item_reference,position},but actual primary key is primary key{sub_menu_reference,position}.Only the combination of three columns can be primary key in my application.Can anyone help.
Thanks,
cheng
|