|Re: [Texo] Cannot resolve referring EObjects when using TexoResource [message #938413 is a reply to message #938095]
||Tue, 09 October 2012 21:28
| Martin Taal
Registered: July 2009
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.
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'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
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
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
Powered by FUDForum
. Page generated in 0.02676 seconds