Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] Does TexoResource support Element Collections?
[Texo] Does TexoResource support Element Collections? [message #938099] Tue, 09 October 2012 10:46 Go to next message
Chris Boerger is currently offline Chris Boerger
Messages: 21
Registered: March 2012
Junior Member
When I tried using ElementCollection of Embeddables with TexoResource I got an eclipselink error complaining that the Embeddable object is not a Entity.

Are Element Collections not supported with the TexoResource?
Re: [Texo] Does TexoResource support Element Collections? [message #938414 is a reply to message #938099] Tue, 09 October 2012 17:29 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5300
Registered: July 2009
Senior Member
Hi Chris,
ElementCollections should be supported, or it might be a bug... Can you check if the orm.xml/JPA annotations are indeed
correct?

gr. Martin

On 10/09/2012 04:46 PM, Chris Boerger wrote:
> When I tried using ElementCollection of Embeddables with TexoResource I got an eclipselink error complaining that the
> Embeddable object is not a Entity.
>
> Are Element Collections not supported with the TexoResource?

--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] Does TexoResource support Element Collections? [message #938656 is a reply to message #938414] Tue, 09 October 2012 23:38 Go to previous messageGo to next message
Chris Boerger is currently offline Chris Boerger
Messages: 21
Registered: March 2012
Junior Member
I've added to a simplified test case with a Book that has an Element Collection of Authors. Author being embeddable, generates the following code:

@ElementCollection()
@CollectionTable(joinColumns = { @JoinColumn(name = "BOOK_ID", referencedColumnName = "ID") }, name = "AUTHOR")
@OneToMany(cascade = { CascadeType.ALL })
private List<Author> authors = new ArrayList<Author>();


I thought maybe the OneToMany interfered and removed it from the JPA annotation but it did not change the result:

Object: Author  [name: Hermann Melville] is not a known entity type.
[EL Config]: Using OSGi initializer: [org.eclipse.persistence.internal.jpa.deployment.osgi.equinox.EquinoxInitializer].
java.lang.IllegalArgumentException: Object: Author  [name: Hermann Melville] is not a known entity type.
	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:4176)
	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persist(EntityManagerImpl.java:451)
	at org.eclipse.emf.texo.server.store.BaseDao.insert(BaseDao.java:204)
	at org.eclipse.emf.texo.server.store.EntityManagerObjectStore.insert(EntityManagerObjectStore.java:108)
	at org.eclipse.emf.texo.server.store.EPersistenceService.persist(EPersistenceService.java:86)
	at org.eclipse.emf.texo.store.TexoResource.save(TexoResource.java:133)


It may be a bug, but at this point I'm not experienced enough to say that I've not configured something improperly in the orm.annotationsmodel or ecore.
Re: [Texo] Does TexoResource support Element Collections? [message #938801 is a reply to message #938656] Wed, 10 October 2012 02:58 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5300
Registered: July 2009
Senior Member
Hi Chris,
Ha now I understand, Texo does not know that Author is embedded so tries to explicitly insert it. Can you enter a
bugzilla for this? And attach your example project to it?

gr. Martin

On 10/10/2012 05:38 AM, Chris Boerger wrote:
> I've added to a simplified test case with a Book that has an Element Collection of Authors. Author being embeddable, generates the following code:
>
> @ElementCollection()
> @CollectionTable(joinColumns = { @JoinColumn(name = "BOOK_ID", referencedColumnName = "ID") }, name = "AUTHOR")
> @OneToMany(cascade = { CascadeType.ALL })
> private List<Author> authors = new ArrayList<Author>();
>
>
> I thought maybe the OneToMany interfered and removed it from the JPA annotation but it did not change the result:
>
> Object: Author [name: Hermann Melville] is not a known entity type.
> [EL Config]: Using OSGi initializer: [org.eclipse.persistence.internal.jpa.deployment.osgi.equinox.EquinoxInitializer].
> java.lang.IllegalArgumentException: Object: Author [name: Hermann Melville] is not a known entity type.
> at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:4176)
> at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persist(EntityManagerImpl.java:451)
> at org.eclipse.emf.texo.server.store.BaseDao.insert(BaseDao.java:204)
> at org.eclipse.emf.texo.server.store.EntityManagerObjectStore.insert(EntityManagerObjectStore.java:108)
> at org.eclipse.emf.texo.server.store.EPersistenceService.persist(EPersistenceService.java:86)
> at org.eclipse.emf.texo.store.TexoResource.save(TexoResource.java:133)
>
>
> It may be a bug, but at this point I'm not experienced enough to say that I've not configured something improperly in the orm.annotationsmodel or ecore.
>


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] Does TexoResource support Element Collections? [message #939771 is a reply to message #938801] Wed, 10 October 2012 23:16 Go to previous message
Chris Boerger is currently offline Chris Boerger
Messages: 21
Registered: March 2012
Junior Member
Bug 391624 created.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=391624
Previous Topic:[Texo] Cannot resolve referring EObjects when using TexoResource
Next Topic:[Texo] How to improve speed of generating java classes?
Goto Forum:
  


Current Time: Wed Apr 16 00:38:27 EDT 2014

Powered by FUDForum. Page generated in 0.05662 seconds