Hi,
Yes, I've also tried @ElementType (instead of @Type because I've a
collection); both with Entity.class and my concrete interface, but I
does not help.
How can I see (maybe from the db) that I have level 2 support or level 3
support type of my relation?
And I'm not sure if I handle my interface correctly. I did not mark it
with @Entity because this lead to errors (NullPointerException in
AnnotationPersistenceMetaDataParser.parseCallbackMethods) but included
it in the persistence.xml. Is this sufficient?
Thanks,
Christian
--- Patrick wrote
Hi,
I can't remember for sure whether or not this is supported in OpenJPA,
but I believe that it is. Have you tried using the @Type annotation on
the field?
-Patrick
On 6/6/07, Christian Neumann <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to persistent an existing code base. While it works really
> well, I've one situation I cannot solve.
>
> Few classes contain some "collection of interfaces". The target entities
> are not classes, but java interfaces like this:
> private Collection<Employable> employees = new ArrayList<Employable>();
>
> I know that I can specify the element type of the target with
> "targetEntity=Employee.class". But of course this only works if there is
> an one-to-one correlation between the interface Employable and the class
> Employee. But I have more than one class implementing the Employable
> interface.
>
> While with OneToOne relations I could specify directly the java
> interface as the targetEntity, I have no real success with one-to-many
> relations. In every case the content of the relationship is stored as a
> BLOB inside of my class with the warning "openjpa.MetaData - OpenJPA
> cannot map field ...".
>
> As far as I've understood, the JPA spec is not covering this aspect.
> Anyways I'm wondering if I'm the only one with the problem. Is there a
> way to make the one-to-many relation with interfaces work as the
> one-to-one relation or am I misunderstanding something?
>
> Thanks very much,
> Christian Neumann
>
--
Patrick Linskey
202 669 5907