The Texo ObjectStore concept integrates the model layer with JPA. It makes it possible to query using an EClass or to perform cross reference queries. In addition the object store can be used to create XML with correct URI's for the reference (persisted inside the XML). When reading/de-serializing the XML the URI's are correctly converted back from the database using an Object Store. This is
The Texo Object Store api is defined in the org.eclipse.emf.texo plugin, the EntityManager Object Store is defined in the org.eclipse.emf.texo.server plugin.
Creating an Object Store
An Object Store instance can be created directly if you have an EntityManager available:
EntityManagerObjectStore objectStore = new EntityManagerObjectStore(); objectStore.setEntityManager(em); // the URI is used for de-resolving references when serializing to XML objectStore.setUri("http://jpa.test");
if created through the ObjectStoreFactory, but
Cross Reference Queries
(De-)Serializing XML with correct id's
When (de-)serializing XML most of the time the references to other objects should be serialized as external references (the referenced object is not present in the XML). When de-serializing the XML these references should be correctly resolved to objects again. This resolving needs to be able to read the objects from the database again.
This (de-)resolving of references while reading from the database is done using the ObjectStore.