Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Generic Relationship

Hello

I'm really new to JPA, and I'm using EclipselLink as PP, but as I'm a bit short of time I haven't been able to dig into the documentation deep enough. I have these entity classes:


public abstract class ClassA{...}

public  class ClassA_1 extends ClassA{...}

public  class ClassA_2 extends ClassA{...}

And I'd like another entity class something doing this, in order to be able to reference an instance of ClassA_1 or ClassA_2:

public class ClassB{
      ....

      @OneToMany
      protected ClassA myInstance;

      ...
}

Is this possible? I'm currently using an awful workaround involving an "adapter" as a wildcard for this relationship. I'm using a table per class strategy. Thanks for your input!

-------------------------------------
Charles Edward Bedón Cortázar
ITIL Foundation Certified
Open Source Network Inventory for the masses!  http://kuwaiba.sourceforge.net
Linux Registered User #386666

Back to the top