@Entity
public class A {
@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY,
mappedBy = B.PRIPAD)
private List<B> b = new ArrayList<B>();
@Override
@IndexedEmbedded(depth = 1, prefix = ".")
public List<B> getB() {
return b;
}
....
}
@Entity
public class B {
@ManyToOne(cascade = { }, fetch = FetchType.LAZY)
@JoinColumn(name = ID_PRIPAD, referencedColumnName = A.ID_PRIPAD,
unique = false, nullable = false, insertable = false, updatable = false)
private A a;
@Field(name = FT_XX, index = Index.UN_TOKENIZED, store = Store.NO)
public String getXx() {
return xx;
}
@Field(name = FT_YY, index = Index.TOKENIZED, store = Store.NO)
public String getYy() {
return yy;
}
@Override
@ContainedIn
public A getA() {
return a;
}