Getting an exception that states the class hasn't been enhanced is
different from saying that an annotation doesn't seem to be working.  They
may very well be related, but I would first verify whether the class in
question has been enhanced.  How do you perform the enhancement step?  Have
you tried turning on Trace to see if there was an issue with the
enhancement step?  As each Entity class is loaded, OpenJPA determines
whether the class has been enhanced and whether to allow continued
processing (based on properties in persistence.xml).  The default
processing with OpenJPA 2.0 is not continue processing if the entity
classes haven't been enhanced.

So, I would focus on that aspect first.

In general, the @ElementCollection annotation is supported.  I just queried
the JIRAs and there are a couple of edge-case issues related to this
processing, but for the most part, they seem to be working.  You could also
look at the JUnits for this processing to see if our tests cover your
scenario or not.

Good luck,
Kevin

On Tue, Aug 28, 2012 at 3:28 PM, garpinc <garp...@yahoo.com> wrote:

> I have a scenario where i'm trying to use standard JPA annotations vs
> OpenJPA
> annotations. In my mapping if I use @javax.persistence.ElementCollection
> instead of @org.apache.openjpa.persistence.PersistentCollection  I get
> following exception.
>
> I have config parameter         jpaConf.put("openjpa.jdbc.MappingDefaults",
>
> "org.openanzo.rdf.URI=com.cambridgesemantics.anzo.relationalreplicator.openjpa.plugin.URIValueHandler'");
>
> but it doesn't seem to take effect for the standard
> @javax.persistence.ElementCollection
>
> Is this a bug?
>
>
> org.apache.openjpa.util.MetaDataException: No metadata was found for type
> "interface org.openanzo.rdf.URI". The class is not enhanced.
>         at
>
> org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:403)
>         at
>
> org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:384)
>         at
> org.apache.openjpa.meta.ClassMetaData.resolveMeta(ClassMetaData.java:1832)
>         at
> org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1797)
>         at
>
> org.apache.openjpa.meta.ValueMetaDataImpl.resolve(ValueMetaDataImpl.java:435)
>         at
> org.apache.openjpa.meta.FieldMetaData.resolve(FieldMetaData.java:1880)
>         at
> org.apache.openjpa.meta.ClassMetaData.resolveMeta(ClassMetaData.java:1863)
>         at
> org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1797)
>         at
>
> org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:822)
>         at
>
> org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:719)
>         at
>
> org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:643)
>
>
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/javax-persistence-ElementCollection-instead-of-org-apache-openjpa-persistence-PersistentCollection-In-tp7580963.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Reply via email to