JPA reference table mapping
问题 There are two main @Entity classes reflecting these tables: TableA {id,name} TableB {id,name} And one reference table TableC {tableA.id,tableB.id} Question is: how to map a TableA 's entity's field with @OneToMany realation to TableB objects list: @OneToMany ?????????? private List<TableBEntity> tableBItems; 回答1: If what you really have is a OneToMany (which means that a give tableB.id appears at most once in TableC ), then the mapping is the following: @OneToMany @JoinTable(name = "TableC",