Jump to: navigation, search

Texo/EMFResourceObjectStore

Introduction

The Texo EMFResource ObjectStore persists data using an EMF Resource. This makes it possible to store data in a xml/xmi file for example.

As xml/xmi files are used for storing data not all the object store functionality is supported. For example the EMF Resource object store has no support of free format querying.

The EMF Resource Object Store is implemented as a Texo component, so you can replace its implementation by your own class using the Texo Component framework.

Jar files/Plugins

The EMF Resource Object Store is defined in the core org.eclipse.emf.texo plugin which is part of the Texo SDK and runtime feature (see Download & Install).

Creating an Object Store using the Object Store Factory

The runtime layer uses an Object Store factory to create an object store. The object store factory uses the request uri to determine what store to create. Next to the entity manager object store described here there are other implementations such the EMFResourceObjectStore.

You can implement/set your own object store factory using the Texo Component infrastructure or by calling ObjectStoreFactory.setInstance with your own instance.

EMF Resource Object Store specifics

The EMF Resource Object Store will read the content of the EMF resource in memory when the objectStore.begin method is called. It will persist the current in-memory representation in an EMF resource when the objectStore.commit method is called.

The EMF Resource Object Store can be overridden by a subclass, there are override points to create an EMF Resource or its ResourceSet.

The EMF Resource Object store uses a specific URI Resolver, TexoEMFResourceURIConverter. This uri converter persists and reads data from files in the java temp directory. This uri converter is implemented as a Texo component, so you can replace its implementation by your own class using the Texo Component framework.