Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Hibernate在联接表中排序一对多列表和序号列_Hibernate_Mapping_One To Many - Fatal编程技术网

使用Hibernate在联接表中排序一对多列表和序号列

使用Hibernate在联接表中排序一对多列表和序号列,hibernate,mapping,one-to-many,Hibernate,Mapping,One To Many,我有以下实体 class ItemList { long id; List<Item> items; } 我想用下表来代表他们 table ITEM_LIST ( item_list_id number primary key ); table ITEM ( item_id number primary key, name varchar(255) not null ); 对于主实体,以及用于关系的联接表 table ITEM_LIST_REL ( it

我有以下实体

class ItemList {
  long id;
  List<Item> items;
}
我想用下表来代表他们

table ITEM_LIST (
  item_list_id number primary key
);

table ITEM (
  item_id number primary key,
  name varchar(255) not null
);
对于主实体,以及用于关系的联接表

table ITEM_LIST_REL (
  item_list_id number,
  item_id number,
  seq_no number
);
其中,seq_no给出了项目列表中项目的序号——实际上是列表对象中项目的索引

我如何使用Hibernate或java.persistence注释映射它

table ITEM_LIST_REL (
  item_list_id number,
  item_id number,
  seq_no number
);