Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo/EclipseLink]ORM file mixing up interfaces and implementation classes when mapping @EmbeddedId
[Teneo/EclipseLink]ORM file mixing up interfaces and implementation classes when mapping @EmbeddedId [message #535161] Fri, 21 May 2010 12:55 Go to next message
Eclipse UserFriend
Originally posted by: philippe.roland.atosorigin.com

Hi,

I'm back for more!
The application I'm going to work on will have me manipulating lots of
dedicated key structures, so I tried to make a small example (Author and
AuthorKey) to figure out how the @EmbeddedId and @Embeddable annotations
worked; here's the ecore file.

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model"
nsURI="htpp://model.ecore" nsPrefix="model">
<eClassifiers xsi:type="ecore:EClass" name="Author">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="count"
lowerBound="1" eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="authorKey"
lowerBound="1"
eType="#//AuthorKey">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@EmbeddedId"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AuthorKey">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@Embeddable"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="authorName"
lowerBound="1"
eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EString" iD="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="birthDate"
lowerBound="1"
eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
</eClassifiers>
</ecore:EPackage>


I generated and used a .genmodel to generate all the code and completed
model.impl.AuthorKeyImpl, making it implement Serializable and writing
both equals(Object) and hashcode() methods.
If I generate the ecore (FWIW, I'm still running into
https://bugs.eclipse.org/bugs/show_bug.cgi?id=312587 . Maybe it's got
something to do with it?), I'll get the following ORM:


<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" version="1.0">
<persistence-unit-metadata>
<xml-mapping-metadata-complete/>
<persistence-unit-defaults>
<access>FIELD</access>
</persistence-unit-defaults>
</persistence-unit-metadata>
**********************
<entity class="model.impl.AuthorImpl" name="Author">
**********************
<table name="AUTHOR"/>
<inheritance strategy="JOINED"/>
<attributes>
<embedded-id name="authorKey"/>
<basic fetch="EAGER" name="count" optional="false"/>
<basic name="eContainerFeatureID">
<column name="ECONT_FEAT_ID"/>
</basic>
</attributes>
</entity>
*********************
<embeddable class="model.AuthorKey">
*********************
<attributes>
<basic fetch="EAGER" name="authorName" optional="false"/>
<basic fetch="EAGER" name="birthDate" optional="false">
<temporal>TIMESTAMP</temporal>
</basic>
</attributes>
</embeddable>
</entity-mappings>


Having it mix the interface and implementation classes like that is
causing a lot of really odd behaviour. Running with this orm.xml file
as-is throws an exception while creating the EntityManagerFactory with
the following stack trace:

Local Exception Stack:
Exception [EclipseLink-30005] (Eclipse Persistence Services -
2.0.2.v20100323-r6872):
org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption
Exception Description: An exception was thrown while searching for
persistence archives with ClassLoader:
sun.misc.Launcher$AppClassLoader@fabe9
Internal Exception: javax.persistence.PersistenceException: Exception
[EclipseLink-28018] (Eclipse Persistence Services -
2.0.2.v20100323-r6872):
org.eclipse.persistence.exceptions.EntityManagerSetupExcepti on
Exception Description: Predeployment of PersistenceUnit
[sampleCreationPU] failed.
Internal Exception: Exception [EclipseLink-7215] (Eclipse Persistence
Services - 2.0.2.v20100323-r6872):
org.eclipse.persistence.exceptions.ValidationException
Exception Description: Could not load the field named [authorName] on
the class [class model.AuthorKey]. Ensure there is a corresponding field
with that name defined on the class.
at
org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption.exceptionSearchingForPersistenceResources(Persistence UnitLoadingException.java:126)
at
org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:133)
at
org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:65)
at test.SimpleTest.setUp(SimpleTest.java:29)


If I modify the ORM to read <embeddable
class="model.impl.AuthorKeyImpl">, however, It'll fail with this error
message instead:

Local Exception Stack:
Exception [EclipseLink-30005] (Eclipse Persistence Services -
2.0.2.v20100323-r6872):
org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption
Exception Description: An exception was thrown while searching for
persistence archives with ClassLoader:
sun.misc.Launcher$AppClassLoader@fabe9
Internal Exception: javax.persistence.PersistenceException: Exception
[EclipseLink-28018] (Eclipse Persistence Services -
2.0.2.v20100323-r6872):
org.eclipse.persistence.exceptions.EntityManagerSetupExcepti on
Exception Description: Predeployment of PersistenceUnit
[sampleCreationPU] failed.
Internal Exception: Exception [EclipseLink-7246] (Eclipse Persistence
Services - 2.0.2.v20100323-r6872):
org.eclipse.persistence.exceptions.ValidationException
Exception Description: The Entity class [class model.impl.AuthorImpl]
has an embedded attribute [authorKey] of type [class model.AuthorKey]
which is NOT an Embeddable class. Probable reason: missing @Embeddable
or missing <embeddable> in orm.xml if metadata-complete = true
at
org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption.exceptionSearchingForPersistenceResources(Persistence UnitLoadingException.java:126)
at
org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:133)
at
org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:65)
at test.SimpleTest.setUp(SimpleTest.java:29)


And there you have it. Did I just run into another bug, or is there
something I missed?

Regards,
Philippe Roland
Re: [Teneo/EclipseLink]ORM file mixing up interfaces and implementation classes when mapping @Embedd [message #535167 is a reply to message #535161] Fri, 21 May 2010 13:15 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Philippe,
Hmm, yes the interface mappings should use a Property access. That solves it probably. Can you try this by manually
changing the orm.xml? If this indeed solves it, can you then enter a bugzilla?

To bring a totally different topic to the table. Are you writing an RCP app or a non-RCP app? In the latter case the
Texo project maybe of interest to you. It generates pure java code from ecore models and also generates an orm.xml. The
pure java approach makes it much easier to integrate with ORM's like EclipseLink. With Texo you can also annotate the
model with ORM annotations, this is done in a better way than with Teneo (imo).
You can check it out here:
http://wiki.eclipse.org/Texo
http://wiki.eclipse.org/Texo#ORM.2FJPA_generation_topics

gr. Martin

Philippe Roland wrote:
> Hi,
>
> I'm back for more!
> The application I'm going to work on will have me manipulating lots of
> dedicated key structures, so I tried to make a small example (Author and
> AuthorKey) to figure out how the @EmbeddedId and @Embeddable annotations
> worked; here's the ecore file.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model"
> nsURI="htpp://model.ecore" nsPrefix="model">
> <eClassifiers xsi:type="ecore:EClass" name="Author">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="count"
> lowerBound="1" eType="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="authorKey"
> lowerBound="1"
> eType="#//AuthorKey">
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@EmbeddedId"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="AuthorKey">
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@Embeddable"/>
> </eAnnotations>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="authorName"
> lowerBound="1"
> eType="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EString" iD="true"/>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="birthDate"
> lowerBound="1"
> eType="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
> </eClassifiers>
> </ecore:EPackage>
>
>
> I generated and used a .genmodel to generate all the code and completed
> model.impl.AuthorKeyImpl, making it implement Serializable and writing
> both equals(Object) and hashcode() methods.
> If I generate the ecore (FWIW, I'm still running into
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=312587 . Maybe it's got
> something to do with it?), I'll get the following ORM:
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
> http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" version="1.0">
> <persistence-unit-metadata>
> <xml-mapping-metadata-complete/>
> <persistence-unit-defaults>
> <access>FIELD</access>
> </persistence-unit-defaults>
> </persistence-unit-metadata>
> **********************
> <entity class="model.impl.AuthorImpl" name="Author">
> **********************
> <table name="AUTHOR"/>
> <inheritance strategy="JOINED"/>
> <attributes>
> <embedded-id name="authorKey"/>
> <basic fetch="EAGER" name="count" optional="false"/>
> <basic name="eContainerFeatureID">
> <column name="ECONT_FEAT_ID"/>
> </basic>
> </attributes>
> </entity>
> *********************
> <embeddable class="model.AuthorKey">
> *********************
> <attributes>
> <basic fetch="EAGER" name="authorName" optional="false"/>
> <basic fetch="EAGER" name="birthDate" optional="false">
> <temporal>TIMESTAMP</temporal>
> </basic>
> </attributes>
> </embeddable>
> </entity-mappings>
>
>
> Having it mix the interface and implementation classes like that is
> causing a lot of really odd behaviour. Running with this orm.xml file
> as-is throws an exception while creating the EntityManagerFactory with
> the following stack trace:
>
> Local Exception Stack:
> Exception [EclipseLink-30005] (Eclipse Persistence Services -
> 2.0.2.v20100323-r6872):
> org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption
> Exception Description: An exception was thrown while searching for
> persistence archives with ClassLoader:
> sun.misc.Launcher$AppClassLoader@fabe9
> Internal Exception: javax.persistence.PersistenceException: Exception
> [EclipseLink-28018] (Eclipse Persistence Services -
> 2.0.2.v20100323-r6872):
> org.eclipse.persistence.exceptions.EntityManagerSetupExcepti on
> Exception Description: Predeployment of PersistenceUnit
> [sampleCreationPU] failed.
> Internal Exception: Exception [EclipseLink-7215] (Eclipse Persistence
> Services - 2.0.2.v20100323-r6872):
> org.eclipse.persistence.exceptions.ValidationException
> Exception Description: Could not load the field named [authorName] on
> the class [class model.AuthorKey]. Ensure there is a corresponding field
> with that name defined on the class.
> at
> org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption.exceptionSearchingForPersistenceResources(Persistence UnitLoadingException.java:126)
>
> at
> org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:133)
>
> at
> org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:65)
>
> at test.SimpleTest.setUp(SimpleTest.java:29)
>
>
> If I modify the ORM to read <embeddable
> class="model.impl.AuthorKeyImpl">, however, It'll fail with this error
> message instead:
>
> Local Exception Stack:
> Exception [EclipseLink-30005] (Eclipse Persistence Services -
> 2.0.2.v20100323-r6872):
> org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption
> Exception Description: An exception was thrown while searching for
> persistence archives with ClassLoader:
> sun.misc.Launcher$AppClassLoader@fabe9
> Internal Exception: javax.persistence.PersistenceException: Exception
> [EclipseLink-28018] (Eclipse Persistence Services -
> 2.0.2.v20100323-r6872):
> org.eclipse.persistence.exceptions.EntityManagerSetupExcepti on
> Exception Description: Predeployment of PersistenceUnit
> [sampleCreationPU] failed.
> Internal Exception: Exception [EclipseLink-7246] (Eclipse Persistence
> Services - 2.0.2.v20100323-r6872):
> org.eclipse.persistence.exceptions.ValidationException
> Exception Description: The Entity class [class model.impl.AuthorImpl]
> has an embedded attribute [authorKey] of type [class model.AuthorKey]
> which is NOT an Embeddable class. Probable reason: missing @Embeddable
> or missing <embeddable> in orm.xml if metadata-complete = true
> at
> org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption.exceptionSearchingForPersistenceResources(Persistence UnitLoadingException.java:126)
>
> at
> org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:133)
>
> at
> org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:65)
>
> at test.SimpleTest.setUp(SimpleTest.java:29)
>
>
> And there you have it. Did I just run into another bug, or is there
> something I missed?
>
> Regards,
> Philippe Roland


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo/EclipseLink]ORM file mixing up interfaces and implementation classes when mapping @Embedd [message #535196 is a reply to message #535167] Fri, 21 May 2010 14:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: philippe.roland.atosorigin.com

Hi Martin,

If by using a property access you mean changing this line:
<embeddable class="model.AuthorKey">
to this:
<embeddable class="model.AuthorKey" access="PROPERTY">

Then I am afraid it does not, as it exits on

Local Exception Stack:
Exception [EclipseLink-30005] (Eclipse Persistence Services -
2.0.2.v20100323-r6872):
org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption
Exception Description: An exception was thrown while searching for
persistence archives with ClassLoader:
sun.misc.Launcher$AppClassLoader@fabe9
Internal Exception: javax.persistence.PersistenceException: Exception
[EclipseLink-28018] (Eclipse Persistence Services -
2.0.2.v20100323-r6872):
org.eclipse.persistence.exceptions.EntityManagerSetupExcepti on
Exception Description: Predeployment of PersistenceUnit
[sampleCreationPU] failed.
Internal Exception: java.lang.NullPointerException
at
org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption.exceptionSearchingForPersistenceResources(Persistence UnitLoadingException.java:126)
at
org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:133)
at
org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:65)
at test.SimpleTest.setUp(SimpleTest.java:29)

But that might not be what you meant.


And it's funny you'd mention Texo, because I was just trying it out and
it does look much more suited to what I want to do. I'm definitely
considering it.


Thanks for your help (and the quick response), and have a nice weekend.
Regards,
Philippe

Martin Taal a écrit :
> Hi Philippe,
> Hmm, yes the interface mappings should use a Property access. That
> solves it probably. Can you try this by manually changing the orm.xml?
> If this indeed solves it, can you then enter a bugzilla?
>
> To bring a totally different topic to the table. Are you writing an RCP
> app or a non-RCP app? In the latter case the Texo project maybe of
> interest to you. It generates pure java code from ecore models and also
> generates an orm.xml. The pure java approach makes it much easier to
> integrate with ORM's like EclipseLink. With Texo you can also annotate
> the model with ORM annotations, this is done in a better way than with
> Teneo (imo).
> You can check it out here:
> http://wiki.eclipse.org/Texo
> http://wiki.eclipse.org/Texo#ORM.2FJPA_generation_topics
>
> gr. Martin
>
> Philippe Roland wrote:
>> Hi,
>>
>> I'm back for more!
>> The application I'm going to work on will have me manipulating lots of
>> dedicated key structures, so I tried to make a small example (Author
>> and AuthorKey) to figure out how the @EmbeddedId and @Embeddable
>> annotations worked; here's the ecore file.
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <ecore:EPackage xmi:version="2.0"
>> xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model"
>> nsURI="htpp://model.ecore" nsPrefix="model">
>> <eClassifiers xsi:type="ecore:EClass" name="Author">
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="count"
>> lowerBound="1" eType="ecore:EDataType
>> http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
>> <eStructuralFeatures xsi:type="ecore:EReference" name="authorKey"
>> lowerBound="1"
>> eType="#//AuthorKey">
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@EmbeddedId"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> <eClassifiers xsi:type="ecore:EClass" name="AuthorKey">
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@Embeddable"/>
>> </eAnnotations>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="authorName"
>> lowerBound="1"
>> eType="ecore:EDataType
>> http://www.eclipse.org/emf/2002/Ecore#//EString" iD="true"/>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="birthDate"
>> lowerBound="1"
>> eType="ecore:EDataType
>> http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
>> </eClassifiers>
>> </ecore:EPackage>
>>
>>
>> I generated and used a .genmodel to generate all the code and
>> completed model.impl.AuthorKeyImpl, making it implement Serializable
>> and writing both equals(Object) and hashcode() methods.
>> If I generate the ecore (FWIW, I'm still running into
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=312587 . Maybe it's got
>> something to do with it?), I'll get the following ORM:
>>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
>> http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" version="1.0">
>> <persistence-unit-metadata>
>> <xml-mapping-metadata-complete/>
>> <persistence-unit-defaults>
>> <access>FIELD</access>
>> </persistence-unit-defaults>
>> </persistence-unit-metadata>
>> **********************
>> <entity class="model.impl.AuthorImpl" name="Author">
>> **********************
>> <table name="AUTHOR"/>
>> <inheritance strategy="JOINED"/>
>> <attributes>
>> <embedded-id name="authorKey"/>
>> <basic fetch="EAGER" name="count" optional="false"/>
>> <basic name="eContainerFeatureID">
>> <column name="ECONT_FEAT_ID"/>
>> </basic>
>> </attributes>
>> </entity>
>> *********************
>> <embeddable class="model.AuthorKey">
>> *********************
>> <attributes>
>> <basic fetch="EAGER" name="authorName" optional="false"/>
>> <basic fetch="EAGER" name="birthDate" optional="false">
>> <temporal>TIMESTAMP</temporal>
>> </basic>
>> </attributes>
>> </embeddable>
>> </entity-mappings>
>>
>>
>> Having it mix the interface and implementation classes like that is
>> causing a lot of really odd behaviour. Running with this orm.xml file
>> as-is throws an exception while creating the EntityManagerFactory with
>> the following stack trace:
>>
>> Local Exception Stack:
>> Exception [EclipseLink-30005] (Eclipse Persistence Services -
>> 2.0.2.v20100323-r6872):
>> org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption
>> Exception Description: An exception was thrown while searching for
>> persistence archives with ClassLoader:
>> sun.misc.Launcher$AppClassLoader@fabe9
>> Internal Exception: javax.persistence.PersistenceException: Exception
>> [EclipseLink-28018] (Eclipse Persistence Services -
>> 2.0.2.v20100323-r6872):
>> org.eclipse.persistence.exceptions.EntityManagerSetupExcepti on
>> Exception Description: Predeployment of PersistenceUnit
>> [sampleCreationPU] failed.
>> Internal Exception: Exception [EclipseLink-7215] (Eclipse Persistence
>> Services - 2.0.2.v20100323-r6872):
>> org.eclipse.persistence.exceptions.ValidationException
>> Exception Description: Could not load the field named [authorName] on
>> the class [class model.AuthorKey]. Ensure there is a corresponding
>> field with that name defined on the class.
>> at
>> org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption.exceptionSearchingForPersistenceResources(Persistence UnitLoadingException.java:126)
>>
>> at
>> org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:133)
>>
>> at
>> org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:65)
>>
>> at test.SimpleTest.setUp(SimpleTest.java:29)
>>
>> If I modify the ORM to read <embeddable
>> class="model.impl.AuthorKeyImpl">, however, It'll fail with this error
>> message instead:
>>
>> Local Exception Stack:
>> Exception [EclipseLink-30005] (Eclipse Persistence Services -
>> 2.0.2.v20100323-r6872):
>> org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption
>> Exception Description: An exception was thrown while searching for
>> persistence archives with ClassLoader:
>> sun.misc.Launcher$AppClassLoader@fabe9
>> Internal Exception: javax.persistence.PersistenceException: Exception
>> [EclipseLink-28018] (Eclipse Persistence Services -
>> 2.0.2.v20100323-r6872):
>> org.eclipse.persistence.exceptions.EntityManagerSetupExcepti on
>> Exception Description: Predeployment of PersistenceUnit
>> [sampleCreationPU] failed.
>> Internal Exception: Exception [EclipseLink-7246] (Eclipse Persistence
>> Services - 2.0.2.v20100323-r6872):
>> org.eclipse.persistence.exceptions.ValidationException
>> Exception Description: The Entity class [class model.impl.AuthorImpl]
>> has an embedded attribute [authorKey] of type [class model.AuthorKey]
>> which is NOT an Embeddable class. Probable reason: missing @Embeddable
>> or missing <embeddable> in orm.xml if metadata-complete = true
>> at
>> org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption.exceptionSearchingForPersistenceResources(Persistence UnitLoadingException.java:126)
>>
>> at
>> org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:133)
>>
>> at
>> org.eclipse.persistence.jpa.PersistenceProvider.createEntity ManagerFactory(PersistenceProvider.java:65)
>>
>> at test.SimpleTest.setUp(SimpleTest.java:29)
>>
>>
>> And there you have it. Did I just run into another bug, or is there
>> something I missed?
>>
>> Regards,
>> Philippe Roland
>
>
Re: [Teneo/EclipseLink]ORM file mixing up interfaces and implementation classes when mapping @Embedd [message #535723 is a reply to message #535167] Tue, 25 May 2010 12:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: philippe.roland.atosorigin.com

I don't know what newsgroup etiquette has to say on whether this should
be its own topic, but I'm also having a little bit of trouble using Texo
to get this Author / AuthorKey example to work with EmbeddedId annotations.

I found out how to set AuthorKey as Embeddable just fine, but the combo
box corresponding to the Embedded Id property in Author's authorKey's
ORM annotation is empty. Would I be wrong in assuming (since from what I
hear embedded and class IDs are mostly used to access legacy databases)
that this feature is not yet supported by Texo?

Cheers,
Philippe Roland

Martin Taal a écrit :
>
> To bring a totally different topic to the table. Are you writing an RCP
> app or a non-RCP app? In the latter case the Texo project maybe of
> interest to you. It generates pure java code from ecore models and also
> generates an orm.xml. The pure java approach makes it much easier to
> integrate with ORM's like EclipseLink. With Texo you can also annotate
> the model with ORM annotations, this is done in a better way than with
> Teneo (imo).
> You can check it out here:
> http://wiki.eclipse.org/Texo
> http://wiki.eclipse.org/Texo#ORM.2FJPA_generation_topics
>
> gr. Martin
>
Re: [Teneo/EclipseLink]ORM file mixing up interfaces and implementation classes when mapping @Embedd [message #535831 is a reply to message #535723] Tue, 25 May 2010 20:29 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Philippe,
I replied on the EMFT newsgroup where Texo belongs and also with the right subject/project classifier :-).

gr. Martin

Philippe Roland wrote:
> I don't know what newsgroup etiquette has to say on whether this should
> be its own topic, but I'm also having a little bit of trouble using Texo
> to get this Author / AuthorKey example to work with EmbeddedId annotations.
>
> I found out how to set AuthorKey as Embeddable just fine, but the combo
> box corresponding to the Embedded Id property in Author's authorKey's
> ORM annotation is empty. Would I be wrong in assuming (since from what I
> hear embedded and class IDs are mostly used to access legacy databases)
> that this feature is not yet supported by Texo?
>
> Cheers,
> Philippe Roland
>
> Martin Taal a écrit :
>>
>> To bring a totally different topic to the table. Are you writing an
>> RCP app or a non-RCP app? In the latter case the Texo project maybe of
>> interest to you. It generates pure java code from ecore models and
>> also generates an orm.xml. The pure java approach makes it much easier
>> to integrate with ORM's like EclipseLink. With Texo you can also
>> annotate the model with ORM annotations, this is done in a better way
>> than with Teneo (imo).
>> You can check it out here:
>> http://wiki.eclipse.org/Texo
>> http://wiki.eclipse.org/Texo#ORM.2FJPA_generation_topics
>>
>> gr. Martin
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:Serializing number formats requiring padding
Next Topic:XSD to Ecore: Trouble with xsd:any
Goto Forum:
  


Current Time: Fri Apr 19 11:54:19 GMT 2024

Powered by FUDForum. Page generated in 0.02066 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top