Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] Cannot resolve referring EObjects when using TexoResource
[Texo] Cannot resolve referring EObjects when using TexoResource [message #938095] Tue, 09 October 2012 14:43 Go to next message
Chris Boerger is currently offline Chris Boerger
Messages: 21
Registered: March 2012
Junior Member
When querying for an entity using the EPersistenceTexoResource, the returned EObject's EReferences point to references with every field being null. The proxyURI is filled in with the EObject's class and id but when I try to use getXXX, it only returns null.

i.e.
I've created two entities, Book & Page. Book is NOT a container for Pages. (Although trying it that way did not help)
I created a Book and saved it to the database using a EPersistenceTexoResource.
I created a Page and saved it to the database using a different EPersistenceTexoResource using the same ObjectStore (EPersistenceService).

Then I create a new EPersistenceTexoResource with a different ObjectStore, but the same EntityManagerFactory.

I query for the Page and get it from the database. (The eclipselink query selects only from the Page table)
The Book the Page refers to has the proxyURI to the right Book but when I call getBook().getId() I only get 'null'.

I've included this simplified plugin here. I not sure what I've done wrong. I'm sure I've not configured something correctly.

Any pointers in the right direction would be appreciated.
Re: [Texo] Cannot resolve referring EObjects when using TexoResource [message #938413 is a reply to message #938095] Tue, 09 October 2012 21:28 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5339
Registered: July 2009
Senior Member
Hi Chris,
For proxy resolving to work you need to create the resources using a ResourceSet. The easiest is to create your own
ResourceSet implementation (extending ResourceSetImpl) which creates the database resource for you.

Let me know if the ResourceSet concept is not known to you, then I can give some more examples.

gr. Martin

On 10/09/2012 04:43 PM, Chris Boerger wrote:
> When querying for an entity using the EPersistenceTexoResource, the returned EObject's EReferences point to references with every field being null. The proxyURI is filled in with the EObject's class and id but when I try to use getXXX, it only returns null.
>
> i.e.
> I've created two entities, Book & Page. Book is NOT a container for Pages. (Although trying it that way did not help)
> I created a Book and saved it to the database using a EPersistenceTexoResource.
> I created a Page and saved it to the database using a different EPersistenceTexoResource using the same ObjectStore (EPersistenceService).
>
> Then I create a new EPersistenceTexoResource with a different ObjectStore, but the same EntityManagerFactory.
>
> I query for the Page and get it from the database. (The eclipselink query selects only from the Page table)
> The Book the Page refers to has the proxyURI to the right Book but when I call getBook().getId() I only get 'null'.
>
> I've included this simplified plugin here. I not sure what I've done wrong. I'm sure I've not configured something correctly.
>
> Any pointers in the right direction would be appreciated.
>


--

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] Cannot resolve referring EObjects when using TexoResource [message #938646 is a reply to message #938413] Wed, 10 October 2012 03:23 Go to previous message
Chris Boerger is currently offline Chris Boerger
Messages: 21
Registered: March 2012
Junior Member
Unfortunately, I am not that well versed in EMF Resource Sets or Factories or any of that part of EMF. I've extended ResourceSetFactory and used the extension_parser extension point to get my resources which now resolves the proxies.

Thank you for your help!
Previous Topic:EMFStore browser to configure server port/ip
Next Topic:[Texo] Does TexoResource support Element Collections?
Goto Forum:
  


Current Time: Sat Oct 25 10:32:28 GMT 2014

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

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