Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Doing an em.find() on an entity with an attribute defined as @OneToOne using mappedBy

When I try to select an entity, A, which has a @OneToOne relation with
another entity, B, I end up getting a recursive call if A is the
non-owning entity.

class A {
   @OneToOne(mappedBy="a")
   private B b;
}

class B {
   @OneToOne @JoinColumn("A_ID")
   private A a;
}


If I do an em.find(A.class, someId); it ends up it ends up being a
never-ending recursive call as when it tries to read B, it tries to
read A and so on so forth.

Any ideas on how I can do a select on entity A?

Thanks,
Zarar


Back to the top