2
私は、2つの長いフィールド、つまり他のエンティティのIDを持つID APKのエンティティAを持っています。だから、私はHibernateのキャッシュミスを発見し、アクションを追加/削除してエンティティAを削除し、これを避けるために、長いものの代わりにエンティティを使いたいと思っています。IDとしてハイバネートエンティティをマップすることは可能ですか?
@Entity
@AccessType("field")
@Table(name = "A")
@XStreamAlias("A")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class A {
@EmbeddedId
@AttributeOverrides({
@AttributeOverride(name = "x", column = @Column(name = "X_ID")),
@AttributeOverride(name = "y", column = @Column(name = "Y_ID"))})
private APK id;
...................
}
@AccessType("field")
@Embeddable
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class APK implements Serializable {
protected long x= 0;//this is id of another entity
protected long y= 0;//this is id of another entity
......
}