Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] @Embeddable and @mapsId

here is one scenario
there are two entity A, B, A has PK class APK including aId, bId, B has BPK
class including aId, bId as well. they have oneToone relationship. Can I use
annotation @MapsId on @OnetoOne relationship on entity B? 

 // parent entity has simple primary key

    public class A {
       @EmbeddedId APK id;
      @OneToOne(optional=false, mappedBy="a", cascade = ALL, targetEntity =
      private B b;

    public class B {
       @EmbeddedId BPK id;
       @OneToOne(optional = false)
		@JoinColumn(name="A_ID", referencedColumnName="A_ID"),
		@JoinColumn(name="B_ID", referencedColumnName="B_ID"),
		@MapsId ??????
		private A a;
    public class BPK {
       int aId name;
       long bId; 
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top