Difference between revisions of "Texo/Generate JPA-ORM Introduction"

From Eclipsepedia

Jump to: navigation, search
Line 3: Line 3:
 
== Introduction ==
 
== Introduction ==
  
With Texo you can generate an orm.xml directly from an ecore model. The orm.xml can be used to configure the persistence layer. See here for more information on using EclipseLink and configuring EclipseLink:
+
With Texo you can generate an orm.xml directly from an ecore model. The orm.xml can be used to configure the persistence layer.  
 +
 
 +
For example EclipseLink, see here for more information on using EclipseLink and configuring EclipseLink:
 
http://wiki.eclipse.org/EclipseLink/UserGuide
 
http://wiki.eclipse.org/EclipseLink/UserGuide
  
The generated orm.xml uses the classes/java members/types as generated by Texo code generation. This means that if you control the code generation through model annotations, that these same choices for
+
The generated orm.xml refers to the classes/java members/types as generated by Texo code generation.  
  
 
When generating the orm.xml Texo tries to make use of the default capabilities of the ORM layer. This means that only the necessary decisions (for example naming) are made by Texo. You can override/extend the generated orm.xml by specifying annotations on the model. This is done in the same way as with the code generation annotations. For more information on annotations models, see [[Texo/Code_Generation_Details|here]].
 
When generating the orm.xml Texo tries to make use of the default capabilities of the ORM layer. This means that only the necessary decisions (for example naming) are made by Texo. You can override/extend the generated orm.xml by specifying annotations on the model. This is done in the same way as with the code generation annotations. For more information on annotations models, see [[Texo/Code_Generation_Details|here]].
Line 13: Line 15:
  
 
It is quite easy to generate an orm.xml from a model: right-click on the ecore model and select Texo > Generate
 
It is quite easy to generate an orm.xml from a model: right-click on the ecore model and select Texo > Generate
 +
 +
 +
[[Image:org.eclipse.emf.texo.generate.orm.png|center]]
 +
 +
 +
The orm.xml will be created in the same folder as the ecore file which was selected. ''Any existing orm.xml in that same folder will be overwritten''.

Revision as of 16:40, 17 May 2010

Contents


Introduction

With Texo you can generate an orm.xml directly from an ecore model. The orm.xml can be used to configure the persistence layer.

For example EclipseLink, see here for more information on using EclipseLink and configuring EclipseLink: http://wiki.eclipse.org/EclipseLink/UserGuide

The generated orm.xml refers to the classes/java members/types as generated by Texo code generation.

When generating the orm.xml Texo tries to make use of the default capabilities of the ORM layer. This means that only the necessary decisions (for example naming) are made by Texo. You can override/extend the generated orm.xml by specifying annotations on the model. This is done in the same way as with the code generation annotations. For more information on annotations models, see here.

Generating an orm.xml

It is quite easy to generate an orm.xml from a model: right-click on the ecore model and select Texo > Generate


Org.eclipse.emf.texo.generate.orm.png


The orm.xml will be created in the same folder as the ecore file which was selected. Any existing orm.xml in that same folder will be overwritten.