Jump to: navigation, search

Difference between revisions of "Texo/EMFResource"

(New page: __TOC__ == Introduction == Texo also supports you in when developing a RCP solution. The solution architecture has 2 parts: * an EMF generated user interface which uses EObjects * a Texo...)
 
Line 9: Line 9:
 
To support this architecture Texo has the  
 
To support this architecture Texo has the  
  
== 2-Tier Architecture ==
+
== Architecture ==
 +
=== 2-Tier Architecture ===
  
Currently (build 9th May 2012) a 2-tier architecture is supported through the EPersistenceTexoResource which is located in the org.eclipse.emf.texo.server plugin.  
+
Currently (build 9th May 2012) a 2-tier architecture is supported through the [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/runtime/org.eclipse.emf.texo.server/src/org/eclipse/emf/texo/server/store/EPersistenceTexoResource.java EPersistenceTexoResource] which is located in the org.eclipse.emf.texo.server plugin. This resource implementation makes use of the Texo [[Texo/EntityManagerHandling|EntityManager]] integration to have access to an EntityManager to retrieve and read information.  
  
 
In this 2-tier architecture the EMF Resource talks directly (through Texo) with the ORM layer and the database.  
 
In this 2-tier architecture the EMF Resource talks directly (through Texo) with the ORM layer and the database.  
Line 20: Line 21:
  
  
== 3-Tier Architecture ==
+
=== 3-Tier Architecture ===
  
In the near future also a 3-tier architecture will be supported. A new type of EMF resource: TexoJSONResource is being implemented (May 2012) which allows you  
+
In the near future also a 3-tier architecture will be supported. A new type of EMF resource: TexoJSONResource is being implemented (May 2012) which allows you to have a 3 tier architecture:
 +
* front-end: the user interface - client using standard EMF generated code
 +
* middle-tier: the web server layer provides a [[Texo/JSON_REST_Web_Services|CRUD JSON]] web service function and the JPA/ORM persistence
 +
* database
  
  
 
[[Image:org.eclipse.emf.texo.resource.3tier.png|center]]
 
[[Image:org.eclipse.emf.texo.resource.3tier.png|center]]
 +
 +
 +
== Using the Texo Resource ==
 +
 +
Information can be loaded in the Texo resource in 2 ways:
 +
* by setting the types URI parameter in the URI of the resource, the types parameter should be a comma delimited list of JPA entity names, normally the EClass name is used. For example: http:/localhost:8080/texo?types=Library,Book
 +
* by directly calling the query method on the TexoResource, the query method allows free format HQL/JPQL queries with named parameters.
 +
 +
Persisting your changes can be done by calling the save method (the one without the outputstream parameter) on the resource. Updates, new objects and deletions are persisted.

Revision as of 16:30, 9 May 2012

Introduction

Texo also supports you in when developing a RCP solution. The solution architecture has 2 parts:

  • an EMF generated user interface which uses EObjects
  • a Texo generated persistence layer, using standard JPA/ORM

To support this architecture Texo has the

Architecture

2-Tier Architecture

Currently (build 9th May 2012) a 2-tier architecture is supported through the EPersistenceTexoResource which is located in the org.eclipse.emf.texo.server plugin. This resource implementation makes use of the Texo EntityManager integration to have access to an EntityManager to retrieve and read information.

In this 2-tier architecture the EMF Resource talks directly (through Texo) with the ORM layer and the database.


Org.eclipse.emf.texo.resource.2tier.png


3-Tier Architecture

In the near future also a 3-tier architecture will be supported. A new type of EMF resource: TexoJSONResource is being implemented (May 2012) which allows you to have a 3 tier architecture:

  • front-end: the user interface - client using standard EMF generated code
  • middle-tier: the web server layer provides a CRUD JSON web service function and the JPA/ORM persistence
  • database


Org.eclipse.emf.texo.resource.3tier.png


Using the Texo Resource

Information can be loaded in the Texo resource in 2 ways:

  • by setting the types URI parameter in the URI of the resource, the types parameter should be a comma delimited list of JPA entity names, normally the EClass name is used. For example: http:/localhost:8080/texo?types=Library,Book
  • by directly calling the query method on the TexoResource, the query method allows free format HQL/JPQL queries with named parameters.

Persisting your changes can be done by calling the save method (the one without the outputstream parameter) on the resource. Updates, new objects and deletions are persisted.