Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF - Teneo-EclipseLink - @OneToMany
EMF - Teneo-EclipseLink - @OneToMany [message #429273] Thu, 16 April 2009 12:23 Go to next message
Robert Jaemmrich is currently offline Robert JaemmrichFriend
Messages: 17
Registered: July 2009
Junior Member
Hi,

I'm trying to generate

- .genmodel
- orm.xml and
- Model/Edit Code

from an Ecore file with Teneo-EclipseLink.

This is working well for single entities, but my one-to-many relationship
fails. EclipseLink warns as follows:

[EL Warning]: Element [protected org.eclipse.emf.common.util.EList
simple.impl.WriterImpl.books] within entity class [class
simple.impl.WriterImpl] uses a collection type [interface
org.eclipse.emf.common.util.EList] when the JPA specification only
supports java.util.Collection, java.util.Set, java.util.List, or
java.util.Map. This type is supported with eager loading; using lazy
loading with this collection type requires additional configuration and an
IndirectContainer implementation that extends [interface
org.eclipse.emf.common.util.EList] or setting the mapping to use basic
indirection and the type to be ValueholderInterface.

I don't know how to set "the mapping to use basic indirection and the type
to be ValueholderInterface" in the Ecore file, strictly speaking. ;-)

BTW: Contents of the EclipseCon 2009 session

http://www.eclipsecon.org/2009/sessions?id=614

(Teneo--Integrating EMF & EclipseLink for Model-Driven Development with
Persistence)

are looking very promising, but I wasn't able to find any examples or
other uploaded content for that session yet. :-(

But maybe one could give me a hint how to fix my ecore file (or provide me
with a working example):

<?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="simple"
nsURI="http:///model2.ecore" nsPrefix="simple.model">
<eClassifiers xsi:type="ecore:EClass" name="Writer">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"
iD="true">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@Id @GeneratedValue"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="books"
upperBound="-1"
eType="#//Book" containment="true" eOpposite="#//Book/writer">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@OneToMany
(mappedBy=&quot;writer&quot;, indexed=false)"/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/
ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="books"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Book">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"
iD="true">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@Id @GeneratedValue"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="writer"
eType="#//Writer"
resolveProxies="false" eOpposite="#//Writer/books">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@ManyToOne"/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/
ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="writer"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
</ecore:EPackage>


Versions used:

eclipselink-plugins-1.1.1.v20090415-r3948
emf-xsd-SDK-I200904141800
emf-teneo-eclipselink-SDK-M200904031023

OK, versions are highly experimental, but I think my error is rather
"fundamental" ;-)


TIA

Robert
Re: EMF - Teneo-EclipseLink - @OneToMany [message #429310 is a reply to message #429273] Fri, 17 April 2009 20:04 Go to previous messageGo to next message
Shaun Smith is currently offline Shaun SmithFriend
Messages: 197
Registered: July 2009
Senior Member
Hi Robert,

The message you're getting is a warning, not an error. Is anything not
working? I'm not sure why you're seeing this warning as during our
development of Teneo, EclipseLink relaxed the restriction on the type of
relationship fields to any classes that implement the collection classes
listed in your warning. I'll see if I can find out why you're seeing
that, but is it creating a problem or just annoying? :-)

--Shaun
Re: EMF - Teneo-EclipseLink - @OneToMany [message #431262 is a reply to message #429273] Mon, 06 July 2009 20:58 Go to previous messageGo to next message
Antonel Ernest Pazargic is currently offline Antonel Ernest PazargicFriend
Messages: 69
Registered: July 2009
Member
I have the same issue with OneToMany relations (even if the exception
message looks a little bit changed) and the EMF-Teneo-JPA application stop
working. A error message dialog popped up in Eclipse IDE and the following
exception are thrown:

!ENTRY org.eclipse.osgi 4 0 2009-07-06 23:53:20.620
!MESSAGE An error occurred while automatically activating bundle
ro.crito.medyna.ui (9).
!STACK 0
org.osgi.framework.BundleException: Exception in
ro.crito.medyna.model.ui.Activator.start() of bundle ro.crito.medyna.ui.
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:805)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:754)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:352)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:280)
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:408)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:449)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:211)
at
org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass (BundleLoader.java:376)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:452)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:405)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:393)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at
org.eclipse.osgi.internal.loader.BundleLoader.loadClass(Bund leLoader.java:321)
at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:231)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1193)
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI .createExecutableExtension(RegistryStrategyOSGI.java:160)
at
org.eclipse.core.internal.registry.ExtensionRegistry.createE xecutableExtension(ExtensionRegistry.java:874)
at
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:243)
at
org.eclipse.core.internal.registry.ConfigurationElementHandl e.createExecutableExtension(ConfigurationElementHandle.java: 51)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:189)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
Caused by: org.eclipse.emf.common.util.WrappedException:
javax.persistence.PersistenceException: Exception [EclipseLink-0] (Eclipse
Persistence Services - 1.1.2.v20090612-r4475):
org.eclipse.persistence.exceptions.IntegrityException
Descriptor Exceptions:
---------------------------------------------------------

Exception [EclipseLink-1] (Eclipse Persistence Services -
1.1.2.v20090612-r4475):
org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The attribute [books] is not declared as type
ValueHolderInterface, but its mapping uses indirection.
Mapping: org.eclipse.persistence.mappings.OneToManyMapping[books]
Descriptor:
RelationalDescriptor(ro.crito.medyna.model.library.impl.Libr aryImpl -->
[DatabaseTable(LIBRARY)])

Exception [EclipseLink-1] (Eclipse Persistence Services -
1.1.2.v20090612-r4475):
org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The attribute [writers] is not declared as type
ValueHolderInterface, but its mapping uses indirection.
Mapping: org.eclipse.persistence.mappings.OneToManyMapping[writers]
Descriptor:
RelationalDescriptor(ro.crito.medyna.model.library.impl.Libr aryImpl -->
[DatabaseTable(LIBRARY)])

Exception [EclipseLink-1] (Eclipse Persistence Services -
1.1.2.v20090612-r4475):
org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The attribute [books] is not declared as type
ValueHolderInterface, but its mapping uses indirection.
Mapping: org.eclipse.persistence.mappings.ManyToManyMapping[books]
Descriptor:
RelationalDescriptor(ro.crito.medyna.model.library.impl.Writ erImpl -->
[DatabaseTable(WRITER)])

Runtime Exceptions:
---------------------------------------------------------

at
org.eclipse.emf.teneo.eclipselink.resource.EclipseLinkResour ceImpl.openDatabase(EclipseLinkResourceImpl.java:588)
at
org.eclipse.emf.teneo.eclipselink.resource.EclipseLinkResour ceImpl$DatabaseContentsEList.loaded(EclipseLinkResourceImpl. java:248)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl$ContentsELi st.didAdd(ResourceImpl.java:443)
at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:425)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUn ique(NotifyingListImpl.java:331)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:315)
at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList. java:307)
at ro.crito.medyna.model.ui.Activator.start(Activator.java:60)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$1 .run(BundleContextImpl.java:782)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:773)
... 33 more
Caused by: javax.persistence.PersistenceException: Exception
[EclipseLink-0] (Eclipse Persistence Services - 1.1.2.v20090612-r4475):
org.eclipse.persistence.exceptions.IntegrityException
Descriptor Exceptions:


Note: The only OneToMany info are in generated orm.xml. There are no
EAnnotation in library.ecore. That could be the source of the problem?
What can I do against that issue?

Thanks in advance, jtonic.


On Thu, 16 Apr 2009 15:23:00 +0300, Robert Jaemmrich
<mail@robert-jaemmrich.de> wrote:

> Hi,
>
> I'm trying to generate
>
> - .genmodel
> - orm.xml and
> - Model/Edit Code
>
> from an Ecore file with Teneo-EclipseLink.
>
> This is working well for single entities, but my one-to-many relationship
> fails. EclipseLink warns as follows:
>
> [EL Warning]: Element [protected org.eclipse.emf.common.util.EList
> simple.impl.WriterImpl.books] within entity class [class
> simple.impl.WriterImpl] uses a collection type [interface
> org.eclipse.emf.common.util.EList] when the JPA specification only
> supports java.util.Collection, java.util.Set, java.util.List, or
> java.util.Map. This type is supported with eager loading; using lazy
> loading with this collection type requires additional configuration and
> an
> IndirectContainer implementation that extends [interface
> org.eclipse.emf.common.util.EList] or setting the mapping to use basic
> indirection and the type to be ValueholderInterface.
>
> I don't know how to set "the mapping to use basic indirection and the
> type
> to be ValueholderInterface" in the Ecore file, strictly speaking. ;-)
>
> BTW: Contents of the EclipseCon 2009 session
>
> http://www.eclipsecon.org/2009/sessions?id=614
>
> (Teneo--Integrating EMF & EclipseLink for Model-Driven Development with
> Persistence)
>
> are looking very promising, but I wasn't able to find any examples or
> other uploaded content for that session yet. :-(
>
> But maybe one could give me a hint how to fix my ecore file (or provide
> me
> with a working example):
>
> <?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="simple"
> nsURI="http:///model2.ecore" nsPrefix="simple.model">
> <eClassifiers xsi:type="ecore:EClass" name="Writer">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="id"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"
> iD="true">
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@Id @GeneratedValue"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="books"
> upperBound="-1"
> eType="#//Book" containment="true" eOpposite="#//Book/writer">
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@OneToMany
> (mappedBy=&quot;writer&quot;, indexed=false)"/>
> </eAnnotations>
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/
> ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="books"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="Book">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="id"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"
> iD="true">
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@Id @GeneratedValue"/>
> </eAnnotations>
> </eStructuralFeatures>
> <eStructuralFeatures xsi:type="ecore:EReference" name="writer"
> eType="#//Writer"
> resolveProxies="false" eOpposite="#//Writer/books">
> <eAnnotations source="teneo.jpa">
> <details key="appinfo" value="@ManyToOne"/>
> </eAnnotations>
> <eAnnotations source="http:///org/eclipse/emf/ecore/util/
> ExtendedMetaData">
> <details key="kind" value="element"/>
> <details key="name" value="writer"/>
> <details key="namespace" value="##targetNamespace"/>
> </eAnnotations>
> </eStructuralFeatures>
> </eClassifiers>
> </ecore:EPackage>
>
>
> Versions used:
>
> eclipselink-plugins-1.1.1.v20090415-r3948
> emf-xsd-SDK-I200904141800
> emf-teneo-eclipselink-SDK-M200904031023
>
> OK, versions are highly experimental, but I think my error is rather
> "fundamental" ;-)
>
>
> TIA
>
> Robert


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: EMF - Teneo-EclipseLink - @OneToMany [message #431263 is a reply to message #431262] Mon, 06 July 2009 21:10 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Antonel,
Can you post the ecore and the orm you get? Persistence should work out-of-the-box (except for setting id and version
eattributes that is), so for one-to-manies you should not get these problems.

It is getting towards mid-night here so it will probably be tomorrow before I or other Teneo-EclipseLink committers can
take a look at it...

gr. Martin

Antonel Ernest Pazargic wrote:
> I have the same issue with OneToMany relations (even if the exception
> message looks a little bit changed) and the EMF-Teneo-JPA application
> stop working. A error message dialog popped up in Eclipse IDE and the
> following exception are thrown:
>
> !ENTRY org.eclipse.osgi 4 0 2009-07-06 23:53:20.620
> !MESSAGE An error occurred while automatically activating bundle
> ro.crito.medyna.ui (9).
> !STACK 0
> org.osgi.framework.BundleException: Exception in
> ro.crito.medyna.model.ui.Activator.start() of bundle ro.crito.medyna.ui.
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:805)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:754)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:352)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:280)
>
> at
> org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:408)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
>
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:449)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:211)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass (BundleLoader.java:376)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:452)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:405)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:393)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:105)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.loadClass(Bund leLoader.java:321)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:231)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1193)
>
> at
> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI .createExecutableExtension(RegistryStrategyOSGI.java:160)
>
> at
> org.eclipse.core.internal.registry.ExtensionRegistry.createE xecutableExtension(ExtensionRegistry.java:874)
>
> at
> org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:243)
>
> at
> org.eclipse.core.internal.registry.ConfigurationElementHandl e.createExecutableExtension(ConfigurationElementHandle.java: 51)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:189)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
> Caused by: org.eclipse.emf.common.util.WrappedException:
> javax.persistence.PersistenceException: Exception [EclipseLink-0]
> (Eclipse Persistence Services - 1.1.2.v20090612-r4475):
> org.eclipse.persistence.exceptions.IntegrityException
> Descriptor Exceptions:
> ---------------------------------------------------------
>
> Exception [EclipseLink-1] (Eclipse Persistence Services -
> 1.1.2.v20090612-r4475):
> org.eclipse.persistence.exceptions.DescriptorException
> Exception Description: The attribute [books] is not declared as type
> ValueHolderInterface, but its mapping uses indirection.
> Mapping: org.eclipse.persistence.mappings.OneToManyMapping[books]
> Descriptor:
> RelationalDescriptor(ro.crito.medyna.model.library.impl.Libr aryImpl -->
> [DatabaseTable(LIBRARY)])
>
> Exception [EclipseLink-1] (Eclipse Persistence Services -
> 1.1.2.v20090612-r4475):
> org.eclipse.persistence.exceptions.DescriptorException
> Exception Description: The attribute [writers] is not declared as type
> ValueHolderInterface, but its mapping uses indirection.
> Mapping: org.eclipse.persistence.mappings.OneToManyMapping[writers]
> Descriptor:
> RelationalDescriptor(ro.crito.medyna.model.library.impl.Libr aryImpl -->
> [DatabaseTable(LIBRARY)])
>
> Exception [EclipseLink-1] (Eclipse Persistence Services -
> 1.1.2.v20090612-r4475):
> org.eclipse.persistence.exceptions.DescriptorException
> Exception Description: The attribute [books] is not declared as type
> ValueHolderInterface, but its mapping uses indirection.
> Mapping: org.eclipse.persistence.mappings.ManyToManyMapping[books]
> Descriptor:
> RelationalDescriptor(ro.crito.medyna.model.library.impl.Writ erImpl -->
> [DatabaseTable(WRITER)])
>
> Runtime Exceptions:
> ---------------------------------------------------------
>
> at
> org.eclipse.emf.teneo.eclipselink.resource.EclipseLinkResour ceImpl.openDatabase(EclipseLinkResourceImpl.java:588)
>
> at
> org.eclipse.emf.teneo.eclipselink.resource.EclipseLinkResour ceImpl$DatabaseContentsEList.loaded(EclipseLinkResourceImpl. java:248)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl$ContentsELi st.didAdd(ResourceImpl.java:443)
>
> at
> org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:425)
> at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUn ique(NotifyingListImpl.java:331)
>
> at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:315)
>
> at
> org.eclipse.emf.common.util.AbstractEList.add(AbstractEList. java:307)
> at ro.crito.medyna.model.ui.Activator.start(Activator.java:60)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$1 .run(BundleContextImpl.java:782)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:773)
>
> ... 33 more
> Caused by: javax.persistence.PersistenceException: Exception
> [EclipseLink-0] (Eclipse Persistence Services - 1.1.2.v20090612-r4475):
> org.eclipse.persistence.exceptions.IntegrityException
> Descriptor Exceptions:
>
>
> Note: The only OneToMany info are in generated orm.xml. There are no
> EAnnotation in library.ecore. That could be the source of the problem?
> What can I do against that issue?
>
> Thanks in advance, jtonic.
>
>
> On Thu, 16 Apr 2009 15:23:00 +0300, Robert Jaemmrich
> <mail@robert-jaemmrich.de> wrote:
>
>> Hi,
>>
>> I'm trying to generate
>>
>> - .genmodel
>> - orm.xml and
>> - Model/Edit Code
>>
>> from an Ecore file with Teneo-EclipseLink.
>>
>> This is working well for single entities, but my one-to-many relationship
>> fails. EclipseLink warns as follows:
>>
>> [EL Warning]: Element [protected org.eclipse.emf.common.util.EList
>> simple.impl.WriterImpl.books] within entity class [class
>> simple.impl.WriterImpl] uses a collection type [interface
>> org.eclipse.emf.common.util.EList] when the JPA specification only
>> supports java.util.Collection, java.util.Set, java.util.List, or
>> java.util.Map. This type is supported with eager loading; using lazy
>> loading with this collection type requires additional configuration
>> and an
>> IndirectContainer implementation that extends [interface
>> org.eclipse.emf.common.util.EList] or setting the mapping to use basic
>> indirection and the type to be ValueholderInterface.
>>
>> I don't know how to set "the mapping to use basic indirection and the
>> type
>> to be ValueholderInterface" in the Ecore file, strictly speaking. ;-)
>>
>> BTW: Contents of the EclipseCon 2009 session
>>
>> http://www.eclipsecon.org/2009/sessions?id=614
>>
>> (Teneo--Integrating EMF & EclipseLink for Model-Driven Development with
>> Persistence)
>>
>> are looking very promising, but I wasn't able to find any examples or
>> other uploaded content for that session yet. :-(
>>
>> But maybe one could give me a hint how to fix my ecore file (or
>> provide me
>> with a working example):
>>
>> <?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="simple"
>> nsURI="http:///model2.ecore" nsPrefix="simple.model">
>> <eClassifiers xsi:type="ecore:EClass" name="Writer">
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="id"
>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"
>> iD="true">
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@Id @GeneratedValue"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EReference" name="books"
>> upperBound="-1"
>> eType="#//Book" containment="true" eOpposite="#//Book/writer">
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@OneToMany
>> (mappedBy=&quot;writer&quot;, indexed=false)"/>
>> </eAnnotations>
>> <eAnnotations source="http:///org/eclipse/emf/ecore/util/
>> ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="books"/>
>> <details key="namespace" value="##targetNamespace"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> <eClassifiers xsi:type="ecore:EClass" name="Book">
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="id"
>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"
>> iD="true">
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@Id @GeneratedValue"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EReference" name="writer"
>> eType="#//Writer"
>> resolveProxies="false" eOpposite="#//Writer/books">
>> <eAnnotations source="teneo.jpa">
>> <details key="appinfo" value="@ManyToOne"/>
>> </eAnnotations>
>> <eAnnotations source="http:///org/eclipse/emf/ecore/util/
>> ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="writer"/>
>> <details key="namespace" value="##targetNamespace"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> </ecore:EPackage>
>>
>>
>> Versions used:
>>
>> eclipselink-plugins-1.1.1.v20090415-r3948
>> emf-xsd-SDK-I200904141800
>> emf-teneo-eclipselink-SDK-M200904031023
>>
>> OK, versions are highly experimental, but I think my error is rather
>> "fundamental" ;-)
>>
>>
>> TIA
>>
>> Robert
>
>


--

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: EMF - Teneo-EclipseLink - @OneToMany [message #431266 is a reply to message #431263] Mon, 06 July 2009 21:46 Go to previous messageGo to next message
Antonel Ernest Pazargic is currently offline Antonel Ernest PazargicFriend
Messages: 69
Registered: July 2009
Member
On Tue, 07 Jul 2009 00:10:48 +0300, Martin Taal <mtaal@elver.org> wrote:

> Hi Antonel,
> Can you post the ecore and the orm you get? Persistence should work
> out-of-the-box (except for setting id and version eattributes that is),
> so for one-to-manies you should not get these problems.
>
> It is getting towards mid-night here so it will probably be tomorrow
> before I or other Teneo-EclipseLink committers can take a look at it...


library.ecore
===============
<?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="library"
nsURI="http://jtonic.ro/library" nsPrefix="lib">
<eClassifiers xsi:type="ecore:EClass" name="Book">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id"
ordered="false" lowerBound="1"
eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//ELong" iD="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="title"
lowerBound="1" eType="ecore:EDataType
http://www.eclipse.org/emf/2003/XMLType#//String"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="pages"
lowerBound="1" eType="ecore:EDataType
http://www.eclipse.org/emf/2003/XMLType#//Int"
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="category"
lowerBound="1"
eType="#//BookCategory" unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="author"
lowerBound="1"
eType="#//Writer" eOpposite="#//Writer/books"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="BookCategory">
<eLiterals name="Mystery"/>
<eLiterals name="ScienceFiction" value="1"/>
<eLiterals name="Biography" value="2"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Library">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id"
ordered="false" lowerBound="1"
eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//ELong" iD="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
lowerBound="1" eType="ecore:EDataType
http://www.eclipse.org/emf/2003/XMLType#//String"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="writers"
upperBound="-1"
eType="#//Writer" containment="true" resolveProxies="false"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="books"
upperBound="-1"
eType="#//Book" containment="true" resolveProxies="false"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Writer">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id"
ordered="false" lowerBound="1"
eType="ecore:EDataType
http://www.eclipse.org/emf/2002/Ecore#//ELong" iD="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
lowerBound="1" eType="ecore:EDataType
http://www.eclipse.org/emf/2003/XMLType#//String"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="books"
upperBound="-1"
eType="#//Book" eOpposite="#//Book/author"/>
</eClassifiers>
</ecore:EPackage>

orm.xml
=====
<?xml version="1.0" encoding="UTF-8"?>
<orm:entity-mappings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" version="1.0">
<orm:persistence-unit-metadata>
<orm:xml-mapping-metadata-complete/>
<orm:persistence-unit-defaults>
<orm:access>FIELD</orm:access>
</orm:persistence-unit-defaults>
</orm:persistence-unit-metadata>
<orm:entity class="ro.crito.medyna.model.library.impl.BookImpl"
name="Book">
<orm:table name="BOOK"/>
<orm:inheritance strategy="JOINED"/>
<orm:attributes>
<orm:id name="id">
<orm:generated-value/>
</orm:id>
<orm:basic fetch="EAGER" name="title" optional="false"/>
<orm:basic fetch="EAGER" name="pages" optional="false"/>
<orm:basic fetch="EAGER" name="category" optional="false">
<orm:enumerated>STRING</orm:enumerated>
</orm:basic>
<orm:basic name="eContainerFeatureID">
<orm:column name="ECONT_FEAT_ID"/>
</orm:basic>
<orm:many-to-one fetch="EAGER" name="author" optional="true"
target-entity="ro.crito.medyna.model.library.impl.WriterImpl ">
<orm:cascade>
<orm:cascade-persist/>
<orm:cascade-merge/>
<orm:cascade-refresh/>
</orm:cascade>
</orm:many-to-one>
<orm:many-to-one name="eContainer"
target-entity="ro.crito.medyna.model.library.impl.LibraryImpl ">
<orm:join-column name="LIBRARY_BOOKS_E_ID"/>
<orm:cascade>
<orm:cascade-all/>
</orm:cascade>
</orm:many-to-one>
</orm:attributes>
</orm:entity>
<orm:entity class="ro.crito.medyna.model.library.impl.LibraryImpl"
name="Library">
<orm:table name="LIBRARY"/>
<orm:inheritance strategy="JOINED"/>
<orm:attributes>
<orm:id name="id">
<orm:generated-value/>
</orm:id>
<orm:basic fetch="EAGER" name="name" optional="false"/>
<orm:basic name="eContainerFeatureID">
<orm:column name="ECONT_FEAT_ID"/>
</orm:basic>
<orm:one-to-many fetch="LAZY" mapped-by="eContainer" name="writers"
target-entity="ro.crito.medyna.model.library.impl.WriterImpl ">
<orm:cascade>
<orm:cascade-all/>
</orm:cascade>
</orm:one-to-many>
<orm:one-to-many fetch="LAZY" mapped-by="eContainer" name="books"
target-entity="ro.crito.medyna.model.library.impl.BookImpl" >
<orm:cascade>
<orm:cascade-all/>
</orm:cascade>
</orm:one-to-many>
</orm:attributes>
</orm:entity>
<orm:entity class="ro.crito.medyna.model.library.impl.WriterImpl"
name="Writer">
<orm:table name="WRITER"/>
<orm:inheritance strategy="JOINED"/>
<orm:attributes>
<orm:id name="id">
<orm:generated-value/>
</orm:id>
<orm:basic fetch="EAGER" name="name" optional="false"/>
<orm:basic name="eContainerFeatureID">
<orm:column name="ECONT_FEAT_ID"/>
</orm:basic>
<orm:many-to-one name="eContainer"
target-entity="ro.crito.medyna.model.library.impl.LibraryImpl ">
<orm:join-column name="LIBRARY_WRITERS_E_ID"/>
<orm:cascade>
<orm:cascade-all/>
</orm:cascade>
</orm:many-to-one>
<orm:one-to-many fetch="LAZY" name="books"
target-entity="ro.crito.medyna.model.library.impl.BookImpl" >
<orm:join-table name="WRITER_BOOKS">
<orm:join-column insertable="true" name="WRITER_E_ID"
nullable="false" unique="false" updatable="true"/>
<orm:inverse-join-column insertable="true" name="BOOK_E_ID"
nullable="false" unique="false" updatable="true"/>
</orm:join-table>
<orm:cascade>
<orm:cascade-persist/>
<orm:cascade-merge/>
<orm:cascade-refresh/>
</orm:cascade>
</orm:one-to-many>
</orm:attributes>
</orm:entity>
</orm:entity-mappings>
=====

Thanks for your quick answer, jtonic

off-topic: RIP MJ :((((


>
> gr. Martin
>
> Antonel Ernest Pazargic wrote:
>> I have the same issue with OneToMany relations (even if the exception
>> message looks a little bit changed) and the EMF-Teneo-JPA application
>> stop working. A error message dialog popped up in Eclipse IDE and the
>> following exception are thrown:
>> !ENTRY org.eclipse.osgi 4 0 2009-07-06 23:53:20.620
>> !MESSAGE An error occurred while automatically activating bundle
>> ro.crito.medyna.ui (9).
>> !STACK 0
>> org.osgi.framework.BundleException: Exception in
>> ro.crito.medyna.model.ui.Activator.start() of bundle ro.crito.medyna.ui.
>> at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:805)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:754)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:352)
>> at
>> org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:280)
>> at
>> org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:408)
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
>> at
>> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:449)
>> at
>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:211)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass (BundleLoader.java:376)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:452)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:405)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:393)
>> at
>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:105)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.loadClass(Bund leLoader.java:321)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:231)
>> at
>> org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1193)
>> at
>> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI .createExecutableExtension(RegistryStrategyOSGI.java:160)
>> at
>> org.eclipse.core.internal.registry.ExtensionRegistry.createE xecutableExtension(ExtensionRegistry.java:874)
>> at
>> org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:243)
>> at
>> org.eclipse.core.internal.registry.ConfigurationElementHandl e.createExecutableExtension(ConfigurationElementHandle.java: 51)
>> at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:189)
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>> Caused by: org.eclipse.emf.common.util.WrappedException:
>> javax.persistence.PersistenceException: Exception [EclipseLink-0]
>> (Eclipse Persistence Services - 1.1.2.v20090612-r4475):
>> org.eclipse.persistence.exceptions.IntegrityException
>> Descriptor Exceptions:
>> ---------------------------------------------------------
>> Exception [EclipseLink-1] (Eclipse Persistence Services -
>> 1.1.2.v20090612-r4475):
>> org.eclipse.persistence.exceptions.DescriptorException
>> Exception Description: The attribute [books] is not declared as type
>> ValueHolderInterface, but its mapping uses indirection.
>> Mapping: org.eclipse.persistence.mappings.OneToManyMapping[books]
>> Descriptor:
>> RelationalDescriptor(ro.crito.medyna.model.library.impl.Libr aryImpl -->
>> [DatabaseTable(LIBRARY)])
>> Exception [EclipseLink-1] (Eclipse Persistence Services -
>> 1.1.2.v20090612-r4475):
>> org.eclipse.persistence.exceptions.DescriptorException
>> Exception Description: The attribute [writers] is not declared as type
>> ValueHolderInterface, but its mapping uses indirection.
>> Mapping: org.eclipse.persistence.mappings.OneToManyMapping[writers]
>> Descriptor:
>> RelationalDescriptor(ro.crito.medyna.model.library.impl.Libr aryImpl -->
>> [DatabaseTable(LIBRARY)])
>> Exception [EclipseLink-1] (Eclipse Persistence Services -
>> 1.1.2.v20090612-r4475):
>> org.eclipse.persistence.exceptions.DescriptorException
>> Exception Description: The attribute [books] is not declared as type
>> ValueHolderInterface, but its mapping uses indirection.
>> Mapping: org.eclipse.persistence.mappings.ManyToManyMapping[books]
>> Descriptor:
>> RelationalDescriptor(ro.crito.medyna.model.library.impl.Writ erImpl -->
>> [DatabaseTable(WRITER)])
>> Runtime Exceptions:
>> ---------------------------------------------------------
>> at
>> org.eclipse.emf.teneo.eclipselink.resource.EclipseLinkResour ceImpl.openDatabase(EclipseLinkResourceImpl.java:588)
>> at
>> org.eclipse.emf.teneo.eclipselink.resource.EclipseLinkResour ceImpl$DatabaseContentsEList.loaded(EclipseLinkResourceImpl. java:248)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceImpl$ContentsELi st.didAdd(ResourceImpl.java:443)
>> at
>> org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:425)
>> at
>> org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUn ique(NotifyingListImpl.java:331)
>> at
>> org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:315)
>> at
>> org.eclipse.emf.common.util.AbstractEList.add(AbstractEList. java:307)
>> at ro.crito.medyna.model.ui.Activator.start(Activator.java:60)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl$1 .run(BundleContextImpl.java:782)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at
>> org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:773)
>> ... 33 more
>> Caused by: javax.persistence.PersistenceException: Exception
>> [EclipseLink-0] (Eclipse Persistence Services - 1.1.2.v20090612-r4475):
>> org.eclipse.persistence.exceptions.IntegrityException
>> Descriptor Exceptions:
>> Note: The only OneToMany info are in generated orm.xml. There are no
>> EAnnotation in library.ecore. That could be the source of the problem?
>> What can I do against that issue?
>> Thanks in advance, jtonic.
>> On Thu, 16 Apr 2009 15:23:00 +0300, Robert Jaemmrich
>> <mail@robert-jaemmrich.de> wrote:
>>
>>> Hi,
>>>
>>> I'm trying to generate
>>>
>>> - .genmodel
>>> - orm.xml and
>>> - Model/Edit Code
>>>
>>> from an Ecore file with Teneo-EclipseLink.
>>>
>>> This is working well for single entities, but my one-to-many
>>> relationship
>>> fails. EclipseLink warns as follows:
>>>
>>> [EL Warning]: Element [protected org.eclipse.emf.common.util.EList
>>> simple.impl.WriterImpl.books] within entity class [class
>>> simple.impl.WriterImpl] uses a collection type [interface
>>> org.eclipse.emf.common.util.EList] when the JPA specification only
>>> supports java.util.Collection, java.util.Set, java.util.List, or
>>> java.util.Map. This type is supported with eager loading; using lazy
>>> loading with this collection type requires additional configuration
>>> and an
>>> IndirectContainer implementation that extends [interface
>>> org.eclipse.emf.common.util.EList] or setting the mapping to use basic
>>> indirection and the type to be ValueholderInterface.
>>>
>>> I don't know how to set "the mapping to use basic indirection and the
>>> type
>>> to be ValueholderInterface" in the Ecore file, strictly speaking. ;-)
>>>
>>> BTW: Contents of the EclipseCon 2009 session
>>>
>>> http://www.eclipsecon.org/2009/sessions?id=614
>>>
>>> (Teneo--Integrating EMF & EclipseLink for Model-Driven Development with
>>> Persistence)
>>>
>>> are looking very promising, but I wasn't able to find any examples or
>>> other uploaded content for that session yet. :-(
>>>
>>> But maybe one could give me a hint how to fix my ecore file (or
>>> provide me
>>> with a working example):
>>>
>>> <?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="simple"
>>> nsURI="http:///model2.ecore" nsPrefix="simple.model">
>>> <eClassifiers xsi:type="ecore:EClass" name="Writer">
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="id"
>>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"
>>> iD="true">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="appinfo" value="@Id @GeneratedValue"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> <eStructuralFeatures xsi:type="ecore:EReference" name="books"
>>> upperBound="-1"
>>> eType="#//Book" containment="true" eOpposite="#//Book/writer">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="appinfo" value="@OneToMany
>>> (mappedBy=&quot;writer&quot;, indexed=false)"/>
>>> </eAnnotations>
>>> <eAnnotations source="http:///org/eclipse/emf/ecore/util/
>>> ExtendedMetaData">
>>> <details key="kind" value="element"/>
>>> <details key="name" value="books"/>
>>> <details key="namespace" value="##targetNamespace"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> </eClassifiers>
>>> <eClassifiers xsi:type="ecore:EClass" name="Book">
>>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="id"
>>> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"
>>> iD="true">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="appinfo" value="@Id @GeneratedValue"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> <eStructuralFeatures xsi:type="ecore:EReference" name="writer"
>>> eType="#//Writer"
>>> resolveProxies="false" eOpposite="#//Writer/books">
>>> <eAnnotations source="teneo.jpa">
>>> <details key="appinfo" value="@ManyToOne"/>
>>> </eAnnotations>
>>> <eAnnotations source="http:///org/eclipse/emf/ecore/util/
>>> ExtendedMetaData">
>>> <details key="kind" value="element"/>
>>> <details key="name" value="writer"/>
>>> <details key="namespace" value="##targetNamespace"/>
>>> </eAnnotations>
>>> </eStructuralFeatures>
>>> </eClassifiers>
>>> </ecore:EPackage>
>>>
>>>
>>> Versions used:
>>>
>>> eclipselink-plugins-1.1.1.v20090415-r3948
>>> emf-xsd-SDK-I200904141800
>>> emf-teneo-eclipselink-SDK-M200904031023
>>>
>>> OK, versions are highly experimental, but I think my error is rather
>>> "fundamental" ;-)
>>>
>>>
>>> TIA
>>>
>>> Robert
>>
>
>


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: EMF - Teneo-EclipseLink - @OneToMany [message #431295 is a reply to message #431266] Tue, 07 July 2009 20:21 Go to previous messageGo to next message
Shaun Smith is currently offline Shaun SmithFriend
Messages: 197
Registered: July 2009
Senior Member
Hi Robert,

In your persistence.xml do you have:

<property name="eclipselink.session.customizer"
value="org.eclipse.emf.teneo.eclipselink.EmfSessionCustomizer "/>

This is necessary to enable the Teneo EclipsLink integration code.

--Shaun
Re: EMF - Teneo-EclipseLink - @OneToMany [message #431304 is a reply to message #431295] Tue, 07 July 2009 23:03 Go to previous message
Antonel Ernest Pazargic is currently offline Antonel Ernest PazargicFriend
Messages: 69
Registered: July 2009
Member
On Tue, 07 Jul 2009 23:21:11 +0300, Shaun Smith <shaun.smith@oracle.com>
wrote:

> Hi Robert,
>
> In your persistence.xml do you have:
>
> <property name="eclipselink.session.customizer"
> value="org.eclipse.emf.teneo.eclipselink.EmfSessionCustomizer "/>
>
> This is necessary to enable the Teneo EclipsLink integration code.

I've missed that. Now it works!!! Thank You very much, jtonic.

>
> --Shaun
>
>
>


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Previous Topic:[Teneo][EMF][BIRT] Is it possible to create Reports with a Teneo Datasource?
Next Topic:[CDO] Fetch multiple objects by CDOID
Goto Forum:
  


Current Time: Thu Apr 25 23:33:34 GMT 2024

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

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

Back to the top