1
내가 좋아하는 4 개 테이블 설정의 집합이 다음 다음과 같이여러 조인 열이있는 컬렉션을 여러 테이블에 매핑하는 방법은 무엇입니까?
Table parent_a
id | other_columns...
Table parent_b
id | filter | other_columns...
Table child_a
id | parent_id | other_columns...
Table child_b
id | filter | other_columns...
엔티티는 설정은 다음과 같습니다
@Entity
@Table(name = "parent_a")
@SecondaryTable(name = "parent_b")
public class Parent {
@Id
@GeneratedValue
@Column(name = "id")
private Integer id;
@Column(name = "filter", table = "parent_b")
private String filter;
@OneToMany
@JoinColumns({
@JoinColumn(name = "parent_id"),
@JoinColumn(name = "filter", table = "child_b")
})
private List<Child> children;
// Mappings for other columns, getters/setters
}
@Entity
@Table(name = "child_a")
@SecondaryTable(name = "child_b")
public class Child {
@Id
@GeneratedValue
@Column(name = "id")
private Integer id;
@Column(name = "filter", table = "child_b")
private String filter;
// Mappings for other columns, getters/setters
}
나는 다음과 같은 예외가 얻을 내 응용 프로그램을 배포 할 때 :
org.hibernate.cfg.NotYetImplementedException: Collections having FK in secondary table
을
부모 엔티티를 상위 필터를 기반으로 필터링 된 하위 엔티티로 채우게하는 또 다른 방법이 있습니까?