I have a problem when removing elements from a list mapped as described above. Here is the mapping:
@Entity
@Table( name = \"foo\")
class Foo {
private List
Usually when joining through a join table the relationship is ManyToMany not OneToMany. Try this
@ManyToMany
@OrderColumn( name = "order_index" )
@JoinTable( name = "foo_bar_map", joinColumns = @JoinColumn( name = "foo_id" ), inverseJoinColumns = @JoinColumn( name = "bar_id" ) )
@Fetch( FetchMode.SUBSELECT )
public List getBars() {
return bars;
}