https://wiki.eclipse.org/api.php?action=feedcontributions&user=Mtaal.elver.org&feedformat=atomEclipsepedia - User contributions [en]2024-03-29T06:57:19ZUser contributionsMediaWiki 1.26.4https://wiki.eclipse.org/index.php?title=Eclipse_and_log4j2_vulnerability_(CVE-2021-44228)&diff=444439Eclipse and log4j2 vulnerability (CVE-2021-44228)2021-12-14T13:06:22Z<p>Mtaal.springsite.com: </p>
<hr />
<div>{| class="wikitable"<br />
!Project<br />
!Version<br />
!Status<br />
!Comment<br />
|-<br />
|Passage<br />
| >= 1.2.0 && <= 2.2.0<br />
|Vulnerable<br />
| The risk of exposure due to the tooling support in an IDE is negligible. Tools can be updated to the 2.2.1 release and runtimes should be upgraded to the 2.2.1 release. Older versions of Passage also work with log4j >= 2.15. See [https://projects.eclipse.org/projects/technology.passage/downloads Passage Downloads] for site details.<br />
|-<br />
|Eclipse Packaging Project (Eclipse IDE for ...)<br />
|*.*.*<br />
|Not Vulnerable / Vulnerable<br />
|All packages available from [https://www.eclipse.org/downloads/packages/ Eclipse Downloads] are not vulnerable, except for the Eclipse IDE for RCP and RAP Developers which contain Passage. Even for packages containing Passage, the risk of exposure due to the tooling support in an IDE is negligible. Adding the site https://download.eclipse.org/passage/updates/release/2.2.1/ to ''Window &rarr; Preferences &rarr; Install/Update &rarr; Available Sites'' and using ''Help &rarr; Check for Updates'' can be used to upgrade the version of Passage and thereby replace the vulnerable version of log4j2.<br />
|-<br />
|Eclipse Installer<br />
|*.*.*<br />
|Not Vulnerable<br />
|Does not use log4j. The catalogs used by the installer for installing the Eclipse Packaging Project's products are dynamically loaded and have been updated such that installing any version of the Eclipse IDE for RCP and RAP Developers will install Passage 2.2.1 with the repaired version of log4j2, i.e., >= 2.15.<br />
|-<br />
|Eclipse SDK<br />
|*.*.*<br />
|Not Vulnerable<br />
|Eclipse SDK does not use log4j<br />
|-<br />
|JGit<br />
|1.0-5.13.0,6.0.0<br />
|Not Vulnerable<br />
|org.eclipse.jgit.pgm uses log4j 1.2.15<br />
|-<br />
|EGit<br />
|1.0-5.13.0,6.0.0<br />
|Not Vulnerable<br />
|EGit does not use log4j<br />
|-<br />
|Jetty<br />
|*.*.*<br />
|Not Vulnerable<br />
|[https://webtide.com/jetty-log4j2-exploit-cve-2021-44228/ Blog: Jetty & Log4j2 exploit CVE-2021-44228]<br />
|-<br />
|StatET<br />
|*.*.*<br />
|Not Vulnerable<br />
|<br />
|-<br />
|Web Tools Platform<br />
|*.*.*<br />
|Not Vulnerable<br />
|log4j 1.2.15 is used in an unused dependency in a single test plug-in<br />
|-<br />
|Scout Runtime<br />
|10.x - 22.x<br />
|Not Vulnerable<br />
|<br />
|-<br />
|Eclipse Hawk<br />
|*.*.*<br />
|Not Vulnerable<br />
|<br />
|-<br />
|Eclipse Theia<br />
|*.*.*<br />
|Not Vulnerable<br />
|-<br />
|Eclipse Dash<br />
|*.*.*<br />
|Not Vulnerable<br />
|<br />
|-<br />
|Linux Tools<br />
|*.*.*<br />
|Not Vulnerable<br />
|<br />
|-<br />
|Eclipse JKube<br />
|*.*.*<br />
|Not Vulnerable<br />
|Eclipse JKube does not use log4j<br />
|-<br />
|Eclipse Modeling Framework (EMF)<br />
|*.*.*<br />
|Not Vulnerable<br />
| Uses log4j 1.x, but only in Xcore tools bundles, not in any runtime bundles deployed in applications.<br />
|-<br />
|XML Schema Definition (XSD)<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use log4j.<br />
|-<br />
|JustJ<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use log4j and log4j is not included in the JRE themselves.<br />
|-<br />
|Oomph<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use log4j.<br />
|-<br />
|CDO Model Repository<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use log4j.<br />
|-<br />
|EMF Teneo<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use log4j.<br />
|-<br />
|N4JS<br />
|1.2.15<br />
|Not Vulnerable<br />
|-<br />
|Eclipse Krazo<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use log4j.<br />
|-<br />
|Eclipse APP4MC IDE<br />
|*.*.*<br />
|Not Vulnerable<br />
| Uses log4j 1.2.15<br />
|-<br />
|Eclipse APP4MC Cloud Service Manager<br />
|*.*.*<br />
|Not Vulnerable<br />
| Contains log4j API 2.13 as transitive dependency introduced by Spring Boot. Actual logging done via Logback.<br />
|-<br />
|Eclipse APP4MC Cloud Services (Migration, Validation, Transformation)<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use log4j.<br />
|-<br />
|Eclipse GlassFish<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use log4j.<br />
|-<br />
|Eclipse RAP<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use log4j.<br />
|-<br />
|Eclipse SWTChart<br />
|1.2.15<br />
|Not Vulnerable<br />
|<br />
|-<br />
|Eclipse ChemClipse<br />
|1.2.15<br />
|Not Vulnerable<br />
|<br />
|-<br />
|VIATRA<br />
|*.*.*<br />
|Not Vulnerable<br />
|VIATRA uses log4j 1.2.15 only<br />
|-<br />
|Sirius<br />
|*.*.*<br />
|Not Vulnerable<br />
| Sirius Desktop uses log4j 1.x, but only in SWTBot-based tests, not in any runtime bundles deployed in applications. Sirius Web uses Spring Boot, which is not vulnerable in its default configuration (see https://spring.io/blog/2021/12/10/log4j2-vulnerability-and-spring-boot)<br />
|-<br />
|EMF Validation<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use Log4J<br />
|-<br />
|EMF Transaction<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use Log4J<br />
|-<br />
|GMF Runtime<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use Log4J<br />
|-<br />
|Ecore Tools<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use Log4J<br />
|-<br />
|EMF Compare<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use Log4J<br />
|-<br />
|Acceleo<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use Log4J<br />
|-<br />
|Graphiti<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use Log4J<br />
|-<br />
|Eclipse BaSyx<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use Log4J<br />
|-<br />
|Eclipse Lyo<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use Log4J, uses SLF4J to <nowiki><exclude></nowiki> downstream Log4J dependencies, older versions used Log4J 1.2.<br />
|-<br />
|Eclipse mdmbl<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use Log4J<br />
|-<br />
|Eclipse Capella<br />
|*.*.*<br />
|Not Vulnerable<br />
| Uses log4j 1.2.15<br />
|-<br />
|Eclipse Kitalpha<br />
|*.*.*<br />
|Not Vulnerable<br />
| Uses log4j 1.2.15<br />
|-<br />
|Eclipse Amalgam<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use Log4J<br />
|-<br />
|Eclipse Diffmerge<br />
|*.*.*<br />
|Not Vulnerable<br />
| Uses log4j 1.2.15<br />
|-<br />
|Eclipse EGF<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use Log4J<br />
|-<br />
|Eclipse Memory Analyzer<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use Log4J<br />
|-<br />
|Eclipse Babel<br />
|*.*.*<br />
|Not Vulnerable<br />
| Does not use Log4J<br />
|-<br />
|}</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo/Hibernate/FAQ&diff=401090Teneo/Hibernate/FAQ2016-01-30T21:44:21Z<p>Mtaal.springsite.com: /* Unknown Entity */</p>
<hr />
<div>__TOC__<br />
<br />
===Lazy loading (Hibernate Proxying) of many-to-one does not work===<br />
To get lazy loading of many-to-one associations working you have to set the option: [[Teneo/Hibernate/Configuration_Options|SET_PROXY]] to "true". <br />
<br />
Also you need to have 'resolve proxies' to false in your model for the association, otherwise EMF will force a load by calling several methods on the proxied object.<br />
<br />
===Mapping Exception Unknown Entity===<br />
This exception is thrown when building the EntityManagerFactory. The entityPersistors in the Hibernate session are all keyed by the mapping's entity-name. In Teneo/EMF's case, the eClass name is the key, but Hibernate tries to use the impl class name as the key. <br />
<br />
See [http://www.eclipse.org/forums/index.php?t=tree&th=168644&#page_top this post] on the forum. <br />
<br />
See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=241537 this bugzilla] for a workaround. Or try setting the following hibernate property:<br />
hibernate.ejb.metamodel.generation=disabled<br />
<br />
===Derby and Hibernate IDBag===<br />
Apparently the Hibernate Derby driver does not handle Hibernate idbags correctly. See this link [http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg37757.html here] for more information.<br />
<br />
===DB Schema constraint error using MS Sql===<br />
Teneo generates the names of foreign key constraints. MS Sql reports errors if the FK constraint name are the same as table names. See this post on the EMF newsgroup. The solution is to set the option: PersistenceOptions.SET_FOREIGN_KEY_NAME to "false".<br />
<br />
===Duplicate method exception with javaassist===<br />
This exception occurs when using the same EStructuralFeature name in different EClasses related through the same super EClass. There can also be other cases where this occurs.<br />
<br />
This seems to be a javaassist issue.<br />
<br />
At this point the solution is to use cglib instead of javassist. See this 292151 bugzilla for more information.<br />
<br />
===File Not Found Exception for a file called: document-v13.dtd===<br />
This exception occurs when initializing a datastore.<br />
<br />
It can happen when you have a xml file for annotations which contains illegal entities or entities which can not be resolved. For example . Check your annotations.xml and try again.<br />
<br />
Another reason why it can happen is that you have a DOCTYPE tag in the top of the xml:<br />
<br />
<source lang="xml"><br />
<!DOCTYPE persistence-mapping PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "document-v13.dtd"><br />
</source><br />
<br />
===Issue: too many tables in join sql statement===<br />
When there are many associations in a model then it is possible that you encounter a 'too many tables' exception when executing a query in hibernate. A possible workaround is to control the default fetch behavior of hibernate. For example the hibernate.max_fetch_depth option can be set to a lower value (its default is 3). See also the section: 19.1. Fetching strategies, in the hibernate manual.<br />
<br />
===Unknown Entity===<br />
This exception can occur when you try to use the getReference, find or get methods on the EntityManager/Session objects and you call these methods using the Interface class name or the Implementation clas name. To solve this Teneo has a special entity naming strategy: EntityInterfaceNameStrategy. This entity naming strategy will use the interface name as the entity-name. You can set this naming strategy through this call: yourDataStore.getExtensionManager().registerExtension(EntityNameStrategy.class.getName(), EntityInterfaceNameStrategy.class.getName()). This call should be done after the datastore was created but before it is initialized.<br />
<br />
===org.hibernate.StaleStateException: Batch update returned unexpected row count===<br />
<source lang="java"><br />
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1<br />
</source><br />
<br />
This exception can occur when using synthetic id's in combination with the creation of multiple session factories. For example when doing test runs with a database clean up between the test run. The exception occurs because the Idenfifier Cache, which is used by Teneo to handle synthetic id's, is not in-sync with the database.<br />
<br />
To solve this you have to clear the Identifier cache by calling: IdentifierCacheHandler.clear();<br />
<br />
===Troubleshooting the Mapping and Runtime layer/Hibernate===<br />
The runtime layer uses commons-logging for logging. Here you can find an example [[media:Teneo.log4j.properties.zip|log4j.properties]] file. This file should be placed directly in the src directory of your EMF Model project. Note: also check if Eclipse copies the file to your bin/build directory. For a plugin project this can be specified in the build.properties.<br />
<br />
The example log4j.properties also contains log4j settings for Hibernate.<br />
<br />
If you use the runtime layer within a plugin then log messages will not appear in the console. In this case check the error log view (Window > Show View > Error Log) or let the log messages be written to a file.<br />
<br />
===Troubleshooting the automatic in-memory mapping===<br />
The mapping is generated in memory. To view the mapping created by Teneo please call the method getMappingXML on the HbDataStore. The returned String contains the Hibernate mapping.<br />
<br />
===Troubleshooting the OR Mapper Menu Option===<br />
If an error popup is shown or no popup box appears after the OR Mapper plugin is finished then an application error has occured within the OR Mapper.<br />
<br />
When the console shows this exception: Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/emf/teneo/hibernate/mapper/GenerateHBM then you have not added the org.eclipse.emf.teneo.hibernate plugin to the dependencies of the model plugin.<br />
<br />
See also this forum post: https://www.eclipse.org/forums/index.php/t/315151/<br />
<br />
To analyze what the problem is first view the error log. The error log can be opened through: Window > Show View > Error Log. By doubleclicking on the lines in the error log you can get more information.<br />
<br />
===More debug information from Eclipse===<br />
As an extra debug enabling you can add the following line in the EMF editor plugin:<br />
<br />
org.eclipse.osgi.framework.debug.Debug.DEBUG_GENERAL = true;<br />
<br />
This will result in much more debugging information in the console.<br />
<br />
===Cut and Paste does not work in the Editor===<br />
Please look [[Teneo/Hibernate/EMF_Hibernate_Integration_Details#Move_an_EObject_between_EContainers_or_support_cut_and_paste_in_the_EMF_editor|here]].<br />
<br />
===Client-server scenario: when saving on the server always new objects are created or I get a duplicate key exception===<br />
What can be the case is that you did not explicitly model an id and/or version attribute in each type. Both are required to be modeled explicitly, see [[Teneo/Hibernate/Configuration_Options|here]].<br />
<br />
===Column name e_version not supported by database===<br />
Teneo will automatically add a version column to the database for each object. The default version column name is e_version. However not all databases support an _ in the column name. To set the version column name you can set an option as explained [[Teneo/Hibernate/Configuration_Options|here]].<br />
<br />
===Column names too long===<br />
Teneo creates foreign key column names by concatenating the name of the (e)class and the property name. The result can be a column name which is too long for certain databases. You can control the maximum column name length by setting the relevant runtime option, see [[Teneo/Hibernate/Configuration_Options|here]].<br />
<br />
===org.hibernate.DuplicateMappingException: Duplicate class/entitymapping===<br />
This exception occurs when two EClasses (of different EPackages) have the same name. To solve this you need to direct Teneo to use qualified EClass names, see [[Teneo/Hibernate/Extensions#EntityNameStrategy_ExtensionPoint_.28org.eclipse.emf.teneo.mapping.strategy.EntityNameStrategy.29|here]]. Note that when using qualified EClass names that also HQL needs to use the qualified EClass names. The EClass names are qualified by prepending the nsprefix of the EPackage with a dot (.) as a separator.<br />
<br />
===Created new model through new model wizard: diagnostic error===<br />
The generated EMF model wizard allows invalid documents. When going through the wizard you need to select a type to create as the first document in the resource. The EMF model wizard creates an empty (all members are null) instance of this type and adds it to the Hibernate resource. Before the Hibernate resource is saved it checks if the content of the resource is valid. When nullable-constraints are violated a StoreValidationException (with Diagnostics) is thrown.<br />
<br />
To solve this you should make your model more relaxed (make elements nullable) or add a small amount of code, which sets the non-nullable fields, to the model wizard. An example of this last solution is illustrated in the [[Teneo/Hibernate/Library_Tutorial|Tutorial]].<br />
<br />
===java.lang.NoClassDefFoundError when starting/initializing runtime layer===<br />
When your model is divided over different projects/plugins then the dependency on org.eclipse.emf.teneo.hibernate has to be set in the project with the 'widest' classpath (the project with a classpath containing the other plugins). For example if you have the following two emf projects:<br />
* Core<br />
* Specific (which uses/imports Core)<br />
<br />
Then the dependency should preferably be in the META-INF of the 'Specific' project. This is required otherwise Hibernate will not see the 'Specific' project.<br />
<br />
===No class def found: org.hibernate.proxy.ProxyFactory===<br />
This exception can occur when your classes have been enhanced by JPOX and you try to persist them via hibernate. Another reason can be that the name you used to register the SessionFactory does not correspond to the expected extension (e.g. library).<br />
<br />
===Could not determine type for: org.eclipse.emf.common.util.AbstractEnumerator, for columns: [org.hibernate.mapping.Column(enu)]===<br />
This exception can occur when you have a enumerate object type in your model. An enumerate object type differs from a standard enumerate because it has a nillable="true" attribute on the element, for example:<br />
<br />
<source lang="xml"><br />
<element name="enu" type="this:SimpleEnum" nillable="true"/><br />
<br />
<simpleType name="SimpleEnum"><br />
<restriction base="xsd:NCName"><br />
<enumeration value="Enum1"/><br />
<enumeration value="Enum2"/><br />
</restriction><br />
</simpleType><br />
</source><br />
<br />
As a workaround add an Enumerated annotation (see ejb3 annotations on this site) to the element.<br />
<br />
===The resource is empty in the generated editor===<br />
The standard behavior of a Hibernate resource is to only read types which have no container in the model. All other EObjects can be reached from these top-entities. However, this means that even if an EObject instance does not have a container but can be contained according to the model then it will still not be loaded in the resource. A common model is a an object which contains itself, for example a folder-like model. Workaround: to workaround this issue you should load the resource using specific queries, see [[Teneo/Hibernate/EMF_Resource|customizing load behavior]].<br />
<br />
===Update manager does not find the upgrade of the EMF Hibernate plugin===<br />
As a workaround use find new features to install a new version of the EMF Hibernate plugin.<br />
<br />
===Editor does not start, the error log gives a sql error 'Missing column....'===<br />
This can occur if your model has changed or you just upgraded the OR Mapper plugin and have generated a new hibernate.hbm.xml file. Before upgrading it is best to export the current database (see the relevant methods in the data store). After exporting start with a new database and re-import the data (through the relevant methods in the datastore).<br />
<br />
===Editor does not start, ClassNotFoundException on the Editor Plugin===<br />
This can happen when the Hibernate libraries can not find the model classes. You can check if you have set the BuddyPolicy in the Manifest.MF of the plugin containing the Hibernate jar files. If not add the following to the Manifest.MF of the plugin containing the Hibernate jar files: <br />
Eclipse-BuddyPolicy: dependent<br />
<br />
===Editor does not start, AssertionFailedException===<br />
When you start the editor you get the following exteption (stacktrace truncated):<br />
<br />
<source lang="java"><br />
org.eclipse.core.runtime.AssertionFailedException: assertion failed: <br />
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)<br />
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)<br />
at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:688)<br />
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:280) <br />
</source><br />
<br />
You probably started the editor with an empty database, the editor does not support this. You should have at least one root object in the database (for example a Library object in the Library tutorial).<br />
<br />
===Properties are not editable with EMF generated property editor===<br />
If you store the .ehb file within the plugin and open the EMF editor using different urls there are situations that the editor opens in read-only mode.<br />
<br />
If the url is opened as follows: FileLocator.find(Activator.getDefault().getBundle(), new Path("myfile.ehb"), null). Then the property editor does not allow any modifications.<br />
<br />
If however, the editor is opened using a 'file:/' based URL (file://myfile.ehb), then the EMF property editor works as expected.<br />
<br />
The first situation can be solved by creating a class similar to this one:<br />
<br />
<source lang="java"><br />
public class CustomAdapterFactoryEditingDomain extends<br />
AdapterFactoryEditingDomain {<br />
public CustomAdapterFactoryEditingDomain(AdapterFactory adapterFactory,<br />
CommandStack commandStack,<br />
Map<Resource, Boolean> resourceToReadOnlyMap) {<br />
super(adapterFactory, commandStack, resourceToReadOnlyMap);<br />
}<br />
<br />
@Override<br />
protected boolean isReadOnlyURI(URI uri) {<br />
return super.isReadOnlyURI(uri)<br />
&& !uri.fileExtension().equals("ehb");<br />
}<br />
}<br />
</source><br />
<br />
And using an instance of this class as the editingDomain in the initializeEditingDomain() method of the EMF generated XXXEditor class:<br />
<br />
<source lang="java"><br />
protected void initializeEditingDomain() {<br />
.........<br />
.........<br />
editingDomain = new CustomAdapterFactoryEditingDomain(adapterFactory,<br />
commandStack, new HashMap<Resource, Boolean>());<br />
}<br />
</source><br />
<br />
Reported and solution by Florian Hackenberger.<br />
<br />
===Validation exception on enumerate properties when saving the editor content===<br />
Symptom: a validation error is thrown (see the console) that certain enumerate fields have not been set.<br />
<br />
Cause: the EMF validator incorrectly enforces that the value of an enumerate field should not be the same as the default value.<br />
<br />
Solution: is an EMF issue which has been solved (see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=104723 here]). Upgrading EMF to a 2.2 or a later 2.1 release solves this.<br />
<br />
===Stacktraces when starting Eclipse with already open EMF editor===<br />
Symptom: This occurs when keeping an EMF generated editor open when closing eclipse and then starting eclipse again. When starting Eclipse again you see many stack traces in the console with messages like: class not found exception: org/hibernate/proxy/proxy.<br />
<br />
Consequence: The editor will open correctly and can be used. The only 'consequence' is that the data is not lazily loaded.<br />
<br />
Solution: A solution has been implemented in release 0.2.0.1.<br />
<br />
===Teneo does not see my changes in the ecore model===<br />
Teneo uses the runtime version of the ecore model. The runtime version is present as java code in the generated EPackage implementation class. This runtime ecore can differ from the ecore file when the model code is not regenerated after a change in the ecore file. To let Teneo use the changes in the ecore file the model code needs to be regenerated.<br />
<br />
===JoinTable name clash===<br />
If you have two EReferences between two EClasses then it is possible that you will get a jointable name clash. To prevent this set the PersistenceOptions.JOIN_TABLE_NAMING_STRATEGY to unique (see [[Teneo/Hibernate/Configuration_Options|here]]).</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo/Hibernate/FAQ&diff=401089Teneo/Hibernate/FAQ2016-01-30T21:32:05Z<p>Mtaal.springsite.com: </p>
<hr />
<div>__TOC__<br />
<br />
===Lazy loading (Hibernate Proxying) of many-to-one does not work===<br />
To get lazy loading of many-to-one associations working you have to set the option: [[Teneo/Hibernate/Configuration_Options|SET_PROXY]] to "true". <br />
<br />
Also you need to have 'resolve proxies' to false in your model for the association, otherwise EMF will force a load by calling several methods on the proxied object.<br />
<br />
===Mapping Exception Unknown Entity===<br />
This exception is thrown when building the EntityManagerFactory. The entityPersistors in the Hibernate session are all keyed by the mapping's entity-name. In Teneo/EMF's case, the eClass name is the key, but Hibernate tries to use the impl class name as the key. <br />
<br />
See [http://www.eclipse.org/forums/index.php?t=tree&th=168644&#page_top this post] on the forum. <br />
<br />
See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=241537 this bugzilla] for a workaround. Or try setting the following hibernate property:<br />
hibernate.ejb.metamodel.generation=disabled<br />
<br />
===Derby and Hibernate IDBag===<br />
Apparently the Hibernate Derby driver does not handle Hibernate idbags correctly. See this link [http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg37757.html here] for more information.<br />
<br />
===DB Schema constraint error using MS Sql===<br />
Teneo generates the names of foreign key constraints. MS Sql reports errors if the FK constraint name are the same as table names. See this post on the EMF newsgroup. The solution is to set the option: PersistenceOptions.SET_FOREIGN_KEY_NAME to "false".<br />
<br />
===Duplicate method exception with javaassist===<br />
This exception occurs when using the same EStructuralFeature name in different EClasses related through the same super EClass. There can also be other cases where this occurs.<br />
<br />
This seems to be a javaassist issue.<br />
<br />
At this point the solution is to use cglib instead of javassist. See this 292151 bugzilla for more information.<br />
<br />
===File Not Found Exception for a file called: document-v13.dtd===<br />
This exception occurs when initializing a datastore.<br />
<br />
It can happen when you have a xml file for annotations which contains illegal entities or entities which can not be resolved. For example . Check your annotations.xml and try again.<br />
<br />
Another reason why it can happen is that you have a DOCTYPE tag in the top of the xml:<br />
<br />
<source lang="xml"><br />
<!DOCTYPE persistence-mapping PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "document-v13.dtd"><br />
</source><br />
<br />
===Issue: too many tables in join sql statement===<br />
When there are many associations in a model then it is possible that you encounter a 'too many tables' exception when executing a query in hibernate. A possible workaround is to control the default fetch behavior of hibernate. For example the hibernate.max_fetch_depth option can be set to a lower value (its default is 3). See also the section: 19.1. Fetching strategies, in the hibernate manual.<br />
<br />
===Unknown Entity===<br />
This exception can occur when you try to use the getReference or get methods on the EntityManager/Session objects and you call these methods using the Interface class name or the Implementation clas name. To solve this Teneo has a special entity naming strategy: EntityInterfaceNameStrategy. This entity naming strategy will use the interface name as the entity-name. You can set this naming strategy through this call: yourDataStore.getExtensionManager().registerExtension(EntityNameStrategy.class.getName(), EntityInterfaceNameStrategy.class.getName()). This call should be done after the datastore was created but before it is initialized.<br />
<br />
===org.hibernate.StaleStateException: Batch update returned unexpected row count===<br />
<source lang="java"><br />
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1<br />
</source><br />
<br />
This exception can occur when using synthetic id's in combination with the creation of multiple session factories. For example when doing test runs with a database clean up between the test run. The exception occurs because the Idenfifier Cache, which is used by Teneo to handle synthetic id's, is not in-sync with the database.<br />
<br />
To solve this you have to clear the Identifier cache by calling: IdentifierCacheHandler.clear();<br />
<br />
===Troubleshooting the Mapping and Runtime layer/Hibernate===<br />
The runtime layer uses commons-logging for logging. Here you can find an example [[media:Teneo.log4j.properties.zip|log4j.properties]] file. This file should be placed directly in the src directory of your EMF Model project. Note: also check if Eclipse copies the file to your bin/build directory. For a plugin project this can be specified in the build.properties.<br />
<br />
The example log4j.properties also contains log4j settings for Hibernate.<br />
<br />
If you use the runtime layer within a plugin then log messages will not appear in the console. In this case check the error log view (Window > Show View > Error Log) or let the log messages be written to a file.<br />
<br />
===Troubleshooting the automatic in-memory mapping===<br />
The mapping is generated in memory. To view the mapping created by Teneo please call the method getMappingXML on the HbDataStore. The returned String contains the Hibernate mapping.<br />
<br />
===Troubleshooting the OR Mapper Menu Option===<br />
If an error popup is shown or no popup box appears after the OR Mapper plugin is finished then an application error has occured within the OR Mapper.<br />
<br />
When the console shows this exception: Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/emf/teneo/hibernate/mapper/GenerateHBM then you have not added the org.eclipse.emf.teneo.hibernate plugin to the dependencies of the model plugin.<br />
<br />
See also this forum post: https://www.eclipse.org/forums/index.php/t/315151/<br />
<br />
To analyze what the problem is first view the error log. The error log can be opened through: Window > Show View > Error Log. By doubleclicking on the lines in the error log you can get more information.<br />
<br />
===More debug information from Eclipse===<br />
As an extra debug enabling you can add the following line in the EMF editor plugin:<br />
<br />
org.eclipse.osgi.framework.debug.Debug.DEBUG_GENERAL = true;<br />
<br />
This will result in much more debugging information in the console.<br />
<br />
===Cut and Paste does not work in the Editor===<br />
Please look [[Teneo/Hibernate/EMF_Hibernate_Integration_Details#Move_an_EObject_between_EContainers_or_support_cut_and_paste_in_the_EMF_editor|here]].<br />
<br />
===Client-server scenario: when saving on the server always new objects are created or I get a duplicate key exception===<br />
What can be the case is that you did not explicitly model an id and/or version attribute in each type. Both are required to be modeled explicitly, see [[Teneo/Hibernate/Configuration_Options|here]].<br />
<br />
===Column name e_version not supported by database===<br />
Teneo will automatically add a version column to the database for each object. The default version column name is e_version. However not all databases support an _ in the column name. To set the version column name you can set an option as explained [[Teneo/Hibernate/Configuration_Options|here]].<br />
<br />
===Column names too long===<br />
Teneo creates foreign key column names by concatenating the name of the (e)class and the property name. The result can be a column name which is too long for certain databases. You can control the maximum column name length by setting the relevant runtime option, see [[Teneo/Hibernate/Configuration_Options|here]].<br />
<br />
===org.hibernate.DuplicateMappingException: Duplicate class/entitymapping===<br />
This exception occurs when two EClasses (of different EPackages) have the same name. To solve this you need to direct Teneo to use qualified EClass names, see [[Teneo/Hibernate/Extensions#EntityNameStrategy_ExtensionPoint_.28org.eclipse.emf.teneo.mapping.strategy.EntityNameStrategy.29|here]]. Note that when using qualified EClass names that also HQL needs to use the qualified EClass names. The EClass names are qualified by prepending the nsprefix of the EPackage with a dot (.) as a separator.<br />
<br />
===Created new model through new model wizard: diagnostic error===<br />
The generated EMF model wizard allows invalid documents. When going through the wizard you need to select a type to create as the first document in the resource. The EMF model wizard creates an empty (all members are null) instance of this type and adds it to the Hibernate resource. Before the Hibernate resource is saved it checks if the content of the resource is valid. When nullable-constraints are violated a StoreValidationException (with Diagnostics) is thrown.<br />
<br />
To solve this you should make your model more relaxed (make elements nullable) or add a small amount of code, which sets the non-nullable fields, to the model wizard. An example of this last solution is illustrated in the [[Teneo/Hibernate/Library_Tutorial|Tutorial]].<br />
<br />
===java.lang.NoClassDefFoundError when starting/initializing runtime layer===<br />
When your model is divided over different projects/plugins then the dependency on org.eclipse.emf.teneo.hibernate has to be set in the project with the 'widest' classpath (the project with a classpath containing the other plugins). For example if you have the following two emf projects:<br />
* Core<br />
* Specific (which uses/imports Core)<br />
<br />
Then the dependency should preferably be in the META-INF of the 'Specific' project. This is required otherwise Hibernate will not see the 'Specific' project.<br />
<br />
===No class def found: org.hibernate.proxy.ProxyFactory===<br />
This exception can occur when your classes have been enhanced by JPOX and you try to persist them via hibernate. Another reason can be that the name you used to register the SessionFactory does not correspond to the expected extension (e.g. library).<br />
<br />
===Could not determine type for: org.eclipse.emf.common.util.AbstractEnumerator, for columns: [org.hibernate.mapping.Column(enu)]===<br />
This exception can occur when you have a enumerate object type in your model. An enumerate object type differs from a standard enumerate because it has a nillable="true" attribute on the element, for example:<br />
<br />
<source lang="xml"><br />
<element name="enu" type="this:SimpleEnum" nillable="true"/><br />
<br />
<simpleType name="SimpleEnum"><br />
<restriction base="xsd:NCName"><br />
<enumeration value="Enum1"/><br />
<enumeration value="Enum2"/><br />
</restriction><br />
</simpleType><br />
</source><br />
<br />
As a workaround add an Enumerated annotation (see ejb3 annotations on this site) to the element.<br />
<br />
===The resource is empty in the generated editor===<br />
The standard behavior of a Hibernate resource is to only read types which have no container in the model. All other EObjects can be reached from these top-entities. However, this means that even if an EObject instance does not have a container but can be contained according to the model then it will still not be loaded in the resource. A common model is a an object which contains itself, for example a folder-like model. Workaround: to workaround this issue you should load the resource using specific queries, see [[Teneo/Hibernate/EMF_Resource|customizing load behavior]].<br />
<br />
===Update manager does not find the upgrade of the EMF Hibernate plugin===<br />
As a workaround use find new features to install a new version of the EMF Hibernate plugin.<br />
<br />
===Editor does not start, the error log gives a sql error 'Missing column....'===<br />
This can occur if your model has changed or you just upgraded the OR Mapper plugin and have generated a new hibernate.hbm.xml file. Before upgrading it is best to export the current database (see the relevant methods in the data store). After exporting start with a new database and re-import the data (through the relevant methods in the datastore).<br />
<br />
===Editor does not start, ClassNotFoundException on the Editor Plugin===<br />
This can happen when the Hibernate libraries can not find the model classes. You can check if you have set the BuddyPolicy in the Manifest.MF of the plugin containing the Hibernate jar files. If not add the following to the Manifest.MF of the plugin containing the Hibernate jar files: <br />
Eclipse-BuddyPolicy: dependent<br />
<br />
===Editor does not start, AssertionFailedException===<br />
When you start the editor you get the following exteption (stacktrace truncated):<br />
<br />
<source lang="java"><br />
org.eclipse.core.runtime.AssertionFailedException: assertion failed: <br />
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)<br />
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)<br />
at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:688)<br />
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:280) <br />
</source><br />
<br />
You probably started the editor with an empty database, the editor does not support this. You should have at least one root object in the database (for example a Library object in the Library tutorial).<br />
<br />
===Properties are not editable with EMF generated property editor===<br />
If you store the .ehb file within the plugin and open the EMF editor using different urls there are situations that the editor opens in read-only mode.<br />
<br />
If the url is opened as follows: FileLocator.find(Activator.getDefault().getBundle(), new Path("myfile.ehb"), null). Then the property editor does not allow any modifications.<br />
<br />
If however, the editor is opened using a 'file:/' based URL (file://myfile.ehb), then the EMF property editor works as expected.<br />
<br />
The first situation can be solved by creating a class similar to this one:<br />
<br />
<source lang="java"><br />
public class CustomAdapterFactoryEditingDomain extends<br />
AdapterFactoryEditingDomain {<br />
public CustomAdapterFactoryEditingDomain(AdapterFactory adapterFactory,<br />
CommandStack commandStack,<br />
Map<Resource, Boolean> resourceToReadOnlyMap) {<br />
super(adapterFactory, commandStack, resourceToReadOnlyMap);<br />
}<br />
<br />
@Override<br />
protected boolean isReadOnlyURI(URI uri) {<br />
return super.isReadOnlyURI(uri)<br />
&& !uri.fileExtension().equals("ehb");<br />
}<br />
}<br />
</source><br />
<br />
And using an instance of this class as the editingDomain in the initializeEditingDomain() method of the EMF generated XXXEditor class:<br />
<br />
<source lang="java"><br />
protected void initializeEditingDomain() {<br />
.........<br />
.........<br />
editingDomain = new CustomAdapterFactoryEditingDomain(adapterFactory,<br />
commandStack, new HashMap<Resource, Boolean>());<br />
}<br />
</source><br />
<br />
Reported and solution by Florian Hackenberger.<br />
<br />
===Validation exception on enumerate properties when saving the editor content===<br />
Symptom: a validation error is thrown (see the console) that certain enumerate fields have not been set.<br />
<br />
Cause: the EMF validator incorrectly enforces that the value of an enumerate field should not be the same as the default value.<br />
<br />
Solution: is an EMF issue which has been solved (see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=104723 here]). Upgrading EMF to a 2.2 or a later 2.1 release solves this.<br />
<br />
===Stacktraces when starting Eclipse with already open EMF editor===<br />
Symptom: This occurs when keeping an EMF generated editor open when closing eclipse and then starting eclipse again. When starting Eclipse again you see many stack traces in the console with messages like: class not found exception: org/hibernate/proxy/proxy.<br />
<br />
Consequence: The editor will open correctly and can be used. The only 'consequence' is that the data is not lazily loaded.<br />
<br />
Solution: A solution has been implemented in release 0.2.0.1.<br />
<br />
===Teneo does not see my changes in the ecore model===<br />
Teneo uses the runtime version of the ecore model. The runtime version is present as java code in the generated EPackage implementation class. This runtime ecore can differ from the ecore file when the model code is not regenerated after a change in the ecore file. To let Teneo use the changes in the ecore file the model code needs to be regenerated.<br />
<br />
===JoinTable name clash===<br />
If you have two EReferences between two EClasses then it is possible that you will get a jointable name clash. To prevent this set the PersistenceOptions.JOIN_TABLE_NAMING_STRATEGY to unique (see [[Teneo/Hibernate/Configuration_Options|here]]).</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo/Hibernate/ModelRelational/Annotations_Format&diff=400520Teneo/Hibernate/ModelRelational/Annotations Format2016-01-14T23:07:18Z<p>Mtaal.springsite.com: /* JPA Annotations in XML */</p>
<hr />
<div>__TOC__ <br />
<br />
<br />
Teneo makes it possible to override the default mapping with JPA annotations in the model. Teneo allows two ways to specify EJB3/JPA-like annotations:<br />
<br />
# using the java annotations syntax in EAnnotations (ecore and xsd) ([[CDO_Hibernate_Store_Annotation_Examples#Examples_of_annotations_defined_in_Ecore_or_in_a_XML_Schema_model|examples]])<br />
# a separate xml document ([[CDO_Hibernate_Store_Annotation_Examples#Examples_of_annotations_in_XML|examples]]).<br />
<br />
This page shows examples of both approaches.<br />
<br />
<br />
A JPA Annotation can have different targets: TYPE, METHOD and FIELD (see the EJB3/JPA spec). Annotations with a TYPE target can be used for EMF EClasses, annotations with METHOD and FIELD targets can be used for EStructuralFeatures. Note: JPA annotations relevant for a non-reference type java member can also be set on an EDataType (see [[Teneo/Hibernate/ModelRelational/Annotations_Support#Annotations_on_EDataType|here]] for more information).<br />
<br />
<br />
Note: when specifying enumerated values then the constant value of the enumeration should be used without the annotation class name. For example the annotation: @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) should (in Teneo) be written as: @Cache(usage = NONSTRICT_READ_WRITE) (without quotes)<br />
<br />
== JPA Annotations in EAnnotations using the java annotation syntax ==<br />
The EAnnotations should adhere to the following format:<br />
* The source must be: '''teneo.jpa'''. Note, Teneo will always consider all annotations starting with teneo.jpa and teneo.mapping (deprecated). You can also configure your own annotation source, see the PersistenceOptions.EXTRA_ANNOTATION_SOURCES and the section on annotation sets below.<br />
* The key must be: '''appinfo''' or '''value'''<br />
<br />
See [[Teneo/Hibernate/ModelRelational/Teneo_Annotation_Examples#Examples_of_annotations_defined_in_Ecore_or_in_a_XML_Schema_model|here]] for examples of how to define eannotations in Ecore or in a XML Schema file.<br />
<br />
==JPA Annotations in XML==<br />
JPA annotations can also be specified in a separate xml file. The advantage of this approach is that you can annotate models which are not in your control. The separate annotated xml means that the original model file does not need to be changed. You can even annotate the Ecore model itself! <br />
<br />
You can tell Teneo where to find the xml file by setting the resource path (to the xml file) in this persistence option: PersistenceOptions.PERSISTENCE_XML (teneo.mapping.persistence_xml), see this [[Teneo/Hibernate/Configuration_Options|options]] page for this and the other Teneo options.<br />
<br />
The xsd for the XML annotations can be downloaded [http://git.eclipse.org/c/teneo/org.eclipse.emf.teneo.git/tree/hibernate/org.eclipse.emf.teneo.hibernate.mapper/src/org/eclipse/emf/teneo/hibernate/annotations/persistence-mapping.xsd here]. The xsd shows that it is possible to specify annotations on EPackage, EClass, EAttribute, EReference and EDataType level. In addition there is a special property element which combines the annotations for EAttribute and EReference. The property tag is a convenience tag which can be used to in place of both an EAttribute and an EReference tag.<br />
<br />
A number of examples of annotations in xml can be found [[Teneo/Hibernate/ModelRelational/Teneo_Annotation_Examples#Examples_of_annotations_in_XML|here]].<br />
<br />
When using Teneo within CDO then the location of the annotations xml (a class path location) should be set in the cdo-server.xml using the option: PersistenceOptions.PERSISTENCE_XML. The location should be a resource/class path. <br />
When using Teneo stand alone this same option should be used, but then it should be passed to the HbDataStore.setProperties(..) method.<br />
<br />
To '''make the annotations xml file available to the CDO server at runtime''' you have to place the annotations xml in a separate plugin, see [[CDO_Hibernate_Store_Configuration_and_Setup#Additional_Hibernate_or_other_Config_files|here]] for more information.<br />
<br />
The example project (org.eclipse.emf.cdo.examples.hibernate.server) makes use of an annotations xml file. See the config/cdo-server.xml and the annotations xml file in the META-INF directory.<br />
<br />
==Simple Annotation Example==<br />
An example of an JPA annotation without a key-value pair is the Embedded annotation.<br />
<br />
In a XML Schema model the Embedded annotation is specified as follows:<br />
<source lang="xml"><br />
<xsd:element name="secondEmbedded" type="this:Embeddable"><br />
<xsd:annotation><br />
<xsd:appinfo source="teneo.jpa">@Embedded</xsd:appinfo><br />
</xsd:annotation><br />
</xsd:element><br />
</source><br />
<br />
An example of a (different) simple annotation in xml:<br />
<source lang="xml"> <br />
<eclass name="Name"><br />
<embeddable /><br />
</eclass><br />
</source><br />
<br />
==Annotation with key-value==<br />
An example of an EJB3 annotation with a key-value pair is the Basic annotation.<br />
<br />
In a XML Schema model the Basic annotation is specified as follows:<br />
<br />
<source lang="xml"><br />
<xsd:element name="myOptionalBasic" type="xsd:string"><br />
<xsd:annotation><br />
<xsd:appinfo source="teneo.jpa">@Basic(optional=true fetch=EAGER)</xsd:appinfo><br />
</xsd:annotation><br />
</xsd:element><br />
</source><br />
<br />
An example of a (different) key-value annotation in xml:<br />
<br />
<source lang="xml"><br />
<property name="head"><br />
<one-to-one fetch="EAGER" target-entity="Head" optional="true" cascade="ALL" /><br />
</property><br />
</source><br />
<br />
As you can see this example uses the property tag. The property tag is a convenience tag which can be used to in place of both an EAttribute and an EReference tag.<br />
<br />
==Complex Annotation with multi-level structure==<br />
An example of a more complex annotation is the SecondaryTable annotation which can contain a pkJoinColumns annotation:<br />
<br />
<source lang="xml"><br />
<xsd:annotation><br />
<xsd:appinfo source="teneo.jpa"><br />
@SecondaryTable(name="THETONER" pkJoinColumns={@PrimaryKeyJoinColumn(name="PRINTER_ID")})<br />
</xsd:appinfo><br />
</xsd:annotation><br />
</source><br />
<br />
An example of a (different) more complex annotation in xml:<br />
<br />
<source lang="xml"> <br />
<eclass name="Employee"><br />
<association-override name="address"><br />
<join-column name="employee_address_id"/><br />
</association-override><br />
</eclass><br />
</source><br />
<br />
==Multiple sets of annotations in one model==<br />
It can make sense to have multiple sets of annotations in your model and disable or enable them when needed. For example to have different mappings for different databases.<br />
<br />
Teneo will always map all annotations with a source starting with teneo.jpa and teneo.mapping (deprecated).<br />
<br />
You can configure additional annotation sources to be considered using the PersistenceOptions.EXTRA_ANNOTATION_SOURCES option. The value of this option is a comma delimited list of sources. Teneo will then also consider all annotations which have a source equal to one of the sources defined in the PersistenceOptions.EXTRA_ANNOTATION_SOURCES option. <br />
<br />
There is another option which plays a role here: PersistenceOptions.EXTRA_ANNOTATIONS_OVERRIDES_DEFAULT. If set to true then the extra annotations are considered to override the default annotations, so if there is an extra-source-annotation then the default annotation is not used.<br />
<br />
For standard Teneo these options can be passed when creating the datatore (dataStore.setProperties(...)).<br />
<br />
For usage of Teneo within CDO (see the [[CDO_Hibernate_Store|CDO Hibernate Store]]), these options can be set in the cdo-server.xml file which configures the hibernate store.</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo/EMFResourceObjectStore&diff=394617Texo/EMFResourceObjectStore2015-12-08T13:21:12Z<p>Mtaal.springsite.com: Created page with "__TOC__ == Introduction == The Texo [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/store/EMFResourceObjectSt..."</p>
<hr />
<div>__TOC__<br />
<br />
== Introduction ==<br />
<br />
The Texo [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/store/EMFResourceObjectStore.java EMFResource ObjectStore] persists data using an EMF Resource. This makes it possible to store data in a xml/xmi file for example.<br />
<br />
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.<br />
<br />
The EMF Resource Object Store is implemented as a Texo component, so you can replace its implementation by your own class using the [[Texo/Components|Texo Component]] framework.<br />
<br />
== Jar files/Plugins ==<br />
<br />
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 [[Texo/Download_and_Install|Download & Install]]).<br />
<br />
== Creating an Object Store using the Object Store Factory ==<br />
<br />
The runtime layer uses an [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/ObjectStoreFactory.java 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 [[Texo/EMFResourceObjectStore|EMFResourceObjectStore]].<br />
<br />
You can implement/set your own object store factory using the [[Texo/Components|Texo Component]] infrastructure or by calling ObjectStoreFactory.setInstance with your own instance.<br />
<br />
== EMF Resource Object Store specifics ==<br />
<br />
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.<br />
<br />
The EMF Resource Object Store can be overridden by a subclass, there are override points to create an EMF Resource or its ResourceSet.<br />
<br />
The EMF Resource Object store uses a specific URI Resolver, [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/store/TexoEMFResourceURIConverter.java 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/Components|Texo Component]] framework.</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo/EntityManagerObjectStore&diff=394613Texo/EntityManagerObjectStore2015-12-08T13:17:18Z<p>Mtaal.springsite.com: </p>
<hr />
<div>__TOC__<br />
<br />
== Introduction ==<br />
<br />
The Texo Entity Manager ObjectStore concept integrates the model layer with JPA. It provides the following functionality:<br />
* It makes it possible to query using an EClass<br />
* Supports cross reference queries<br />
* Supports (de-)serialization with (de-)resolving of references in the XML/XMI against the ObjectStore (the database)<br />
<br />
If you want more specific Dao functionality, check out the [[Texo/Dao|Texo Dao]] support.<br />
<br />
The Entity Manager Object Store is implemented as a Texo component, so you can replace its implementation by your own class using the [[Texo/Components|Texo Component]] framework.<br />
<br />
== Jar files/Plugins ==<br />
<br />
The Texo Object Store is defined in the org.eclipse.emf.texo.server plugin which is part of the Texo runtime feature (see [[Texo/Download_and_Install|Download & Install]]).<br />
<br />
== Creating an Object Store using the Object Store Factory ==<br />
<br />
The runtime layer uses an [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/ObjectStoreFactory.java 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 [[Texo/EMFResourceObjectStore|EMFResourceObjectStore]].<br />
<br />
You can implement/set your own object store factory using the [[Texo/Components|Texo Component]] infrastructure or by calling ObjectStoreFactory.setInstance with your own instance.<br />
<br />
== Creating an the Entity Manager Object Store Directly ==<br />
<br />
An Object Store instance can be created directly if you have an EntityManager available:<br />
<source lang="java">EntityManagerObjectStore objectStore = new EntityManagerObjectStore();<br />
objectStore.setEntityManager(entityManager);<br />
// the URI is used for de-resolving references when serializing to XML, see below<br />
objectStore.setUri("http://jpa.test");<br />
</source><br />
<br />
'''Note that for the ObjectStore to be able to read the model layer: the model package class needs to be loaded and initialized, just touching it is enough, for example:'''<br />
<source lang="java">LibraryModelPackage.initialize();<br />
</source><br />
<br />
== Cross Reference Queries ==<br />
<br />
The ObjectStore allows you to retrieve all the objects which reference a certain target object:<br />
<source lang="java">// get maximum 3 referers and include containment referers<br />
List<Object> referers = objectStore.getReferingObjects(target, 3, true);<br />
</source><br />
<br />
See the ObjectStore getReferingObjects api and the isReferenced method.<br />
<br />
== EntityManager ==<br />
<br />
The ObjectStore needs an EntityManager to perform database queries. The ObjectStore uses the standard Texo approach to get an instance of the EntityManager, see [[Texo/EntityManagerHandling|this]] wiki page for more information.<br />
<br />
== (De-)Serializing XML with correct id's ==<br />
<br />
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. <br />
<br />
This (de-)resolving of references while reading from the database is done using the ObjectStore. It is quite simple:<br />
<source lang="java">// serialize a set of objects to xml, use XMI (specified by the second parameter<br />
String xml = objectStore.toXML(objects, true);<br />
// and get it back<br />
List<Object> objects = objectStore.fromXML(xml, true);<br />
</source></div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo/EntityManagerObjectStore&diff=394611Texo/EntityManagerObjectStore2015-12-08T13:14:00Z<p>Mtaal.springsite.com: </p>
<hr />
<div>__TOC__<br />
<br />
== Introduction ==<br />
<br />
The Texo Entity Manager ObjectStore concept integrates the model layer with JPA. It provides the following functionality:<br />
* It makes it possible to query using an EClass<br />
* Supports cross reference queries<br />
* Supports (de-)serialization with (de-)resolving of references in the XML/XMI against the ObjectStore (the database)<br />
<br />
If you want more specific Dao functionality, check out the [[Texo/Dao|Texo Dao]] support.<br />
<br />
== Jar files/Plugins ==<br />
<br />
The Texo Object Store is defined in the org.eclipse.emf.texo.server plugin which is part of the Texo runtime feature (see [[Texo/Download_and_Install|Download & Install]]).<br />
<br />
== Creating an Object Store using the Object Store Factory ==<br />
<br />
The runtime layer uses an [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/ObjectStoreFactory.java 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 [[Texo/EMFResourceObjectStore|EMFResourceObjectStore]].<br />
<br />
You can implement/set your own object store factory using the [[Texo/Components|Texo Component]] infrastructure or by calling ObjectStoreFactory.setInstance with your own instance.<br />
<br />
== Creating an the Entity Manager Object Store Directly ==<br />
<br />
An Object Store instance can be created directly if you have an EntityManager available:<br />
<source lang="java">EntityManagerObjectStore objectStore = new EntityManagerObjectStore();<br />
objectStore.setEntityManager(entityManager);<br />
// the URI is used for de-resolving references when serializing to XML, see below<br />
objectStore.setUri("http://jpa.test");<br />
</source><br />
<br />
'''Note that for the ObjectStore to be able to read the model layer: the model package class needs to be loaded and initialized, just touching it is enough, for example:'''<br />
<source lang="java">LibraryModelPackage.initialize();<br />
</source><br />
<br />
== Cross Reference Queries ==<br />
<br />
The ObjectStore allows you to retrieve all the objects which reference a certain target object:<br />
<source lang="java">// get maximum 3 referers and include containment referers<br />
List<Object> referers = objectStore.getReferingObjects(target, 3, true);<br />
</source><br />
<br />
See the ObjectStore getReferingObjects api and the isReferenced method.<br />
<br />
== EntityManager ==<br />
<br />
The ObjectStore needs an EntityManager to perform database queries. The ObjectStore uses the standard Texo approach to get an instance of the EntityManager, see [[Texo/EntityManagerHandling|this]] wiki page for more information.<br />
<br />
== (De-)Serializing XML with correct id's ==<br />
<br />
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. <br />
<br />
This (de-)resolving of references while reading from the database is done using the ObjectStore. It is quite simple:<br />
<source lang="java">// serialize a set of objects to xml, use XMI (specified by the second parameter<br />
String xml = objectStore.toXML(objects, true);<br />
// and get it back<br />
List<Object> objects = objectStore.fromXML(xml, true);<br />
</source></div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo&diff=394609Texo2015-12-08T13:13:12Z<p>Mtaal.springsite.com: /* Object Store */</p>
<hr />
<div>==Introduction==<br />
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and full REST JSON web service functionality at runtime. <br />
<br />
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].<br />
<br />
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. <br />
<br />
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.<br />
<br />
<br />
[[Image:texo-client-server.png|center|600px]]<br />
<br />
== Benefits of using Texo ==<br />
<br />
Benefits of using current Texo (November 2012):<br />
* Code Generation:<br />
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore model or XSD''' without direct compile time link from generated entities to EMF, Texo or other framework types. '''Facilitates integration of EMF concepts with other frameworks''' such as Google Web Toolkit or Object Relational Mapping solutions<br />
** Supports '''manual change of generated code''' (the same approach as EMF)<br />
** '''[[Template_Overriding|Overridable and Extendable code generation]]''' with support for EMF-like merge, formatting, import-organizing<br />
<br />
* Provides a generic CRUD REST and Query web service layer for all your models, [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]<br />
<br />
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.<br />
<br />
* Supports most '''XML Schema constructs''' (as EMF)<br />
<br />
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.<br />
<br />
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation<br />
<br />
== Download & Install ==<br />
<br />
Texo is installed through the Eclipse update manager. For more details see the [[Texo/Download_and_Install|Download & Install]] page.<br />
<br />
== Quick Start ==<br />
<br />
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...<br />
<br />
== Documentation ==<br />
<br />
The following pages contain detailed information on different parts of the Texo solution. <br />
<br />
=== Blog ===<br />
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].<br />
<br />
=== Code generation topics ===<br />
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.<br />
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.<br />
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.<br />
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.<br />
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).<br />
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).<br />
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.<br />
<br />
=== ORM/JPA generation topics ===<br />
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.<br />
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.<br />
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.<br />
<br />
=== Runtime topics ===<br />
<br />
==== JPA/Persistence integration ====<br />
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.<br />
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality. <br />
<br />
==== XML/JSON REST Web Service Support ====<br />
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]<br />
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]<br />
<br />
==== Object Store Implementations ====<br />
The Texo web runtime layer uses the object store concept to store and retrieve data. Texo offers different object store implementations:<br />
* [[Texo/EntityManagerObjectStore|Entity Manager Object Store]]: the entity manager object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.<br />
* [[Texo/EMFResourceObjectStore|EMF Resource Object Store]]: the EMF resource object store uses EMF resources to persist its data.<br />
<br />
==== Framework ====<br />
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.<br />
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.<br />
<br />
==== RCP Persistence using EMF Resources and Texo ====<br />
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.<br />
<br />
==== EMF/XML/XMI ====<br />
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI. <br />
* [[Texo/Convert to EMF|EMF Conversion]]: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.<br />
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.<br />
<br />
==== Miscellaneous ====<br />
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.<br />
<br />
== Main Design Concepts ==<br />
<br />
The Texo project is based on a number of main design concepts and philosophies.<br />
* Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators. <br />
* Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api. <br />
* Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.<br />
<br />
For a more detailed description visit the [[Texo/Design%20Concepts|Design Concepts]] page.<br />
<br />
== Texo and EMF ==<br />
<br />
Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on [[Texo/Texo_and_EMF|this page]].<br />
<br />
== Support & Troubleshooting & Bugzilla ==<br />
<br />
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.<br />
<br />
To enter a new bugzilla you can use the following link:<br />
<br />
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.9.0<br />
<br />
Support is given on the EMFT newsgroup which you can find here:<br />
* nntp: news://news.eclipse.org/eclipse.technology.emft<br />
* forum: http://www.eclipse.org/forums/eclipse.technology.emft<br />
<br />
== Backward Compatibility ==<br />
<br />
Starting from the 0.9.0 version backward compatibility related topics will be published in this section.<br />
<br />
=== 0.9.0 - Version 28 December 2014 ===<br />
<br />
* This issue [https://bugs.eclipse.org/bugs/show_bug.cgi?id=420913 420913] is resolved. There is a property of the EPackage or EReference generation annotation which controls if [https://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29 bi-directional association] support is generated in the java code. This was not working correctly, in that to get this to be working also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved. Note bi-directional access is (and was) 'true'/enabled by default. This can mean that newly generated code (previously generated by a previous Texo version) will change as now the bi-directional property is correctly considered. To keep the old behavior, create an annotation model which sets generateBidirectionalAssociationSupport to false (see [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/tests/org.eclipse.emf.texo.modelgenerator.test/models/samples/extlibrary.annotationsmodel here] for an example, only the generateBidirectionalAssociationSupport part is relevant for this bullet).<br />
<br />
* The createModelObject method of the ModelFactory has been [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/commit/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/model/ModelFactory.java?id=31fb5c7415651646109f711634d0895053ecb0d0 changed] to return a parameterized ModelObject (ModelObject<T>) instead of earlier the ModelObject<?>. With this it is not needed anymore to cast the returned value from createModelObject.<br />
<br />
== Developing ==<br />
<br />
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.<br />
<br />
== Future Topics ==<br />
<br />
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:<br />
* Runtime Layer<br />
** Backend Store: nosql database, elasticsearch<br />
** WebService Support: odata integration<br />
** Integrated with EMF Client Platform<br />
** Introduce service oriented architecture concepts, focusing on micro-service architectures<br />
** integrate with OLAP/Mondrian solutions, back-end and front-end<br />
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box<br />
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF<br />
** use this generic model editor as a basis for a generated model editor in html5/mobile<br />
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor<br />
* Code/Artifact Generation:<br />
** Support JPA 2.1<br />
** Support Ecore/XCore generic types<br />
** Support Ecore/XCore operations<br />
** Add JPA/Texo annotation support in Xcore<br />
<br />
Feel free to react on the EMFT newsgroup with more ideas.<br />
<br />
== See also ==<br />
<br />
* [[Teneo]]<br />
* [[CDO]]<br />
<br />
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo/ObjectStore&diff=394608Texo/ObjectStore2015-12-08T13:12:19Z<p>Mtaal.springsite.com: Mtaal.elver.org moved page Texo/ObjectStore to Texo/EntityManagerObjectStore</p>
<hr />
<div>#REDIRECT [[Texo/EntityManagerObjectStore]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo/EntityManagerObjectStore&diff=394607Texo/EntityManagerObjectStore2015-12-08T13:12:19Z<p>Mtaal.springsite.com: Mtaal.elver.org moved page Texo/ObjectStore to Texo/EntityManagerObjectStore</p>
<hr />
<div>__TOC__<br />
<br />
== Introduction ==<br />
<br />
The Texo ObjectStore concept integrates the model layer with JPA. It provides the following functionality:<br />
* It makes it possible to query using an EClass<br />
* Supports cross reference queries<br />
* Supports (de-)serialization with (de-)resolving of references in the XML/XMI against the ObjectStore (the database)<br />
<br />
If you want more specific Dao functionality, check out the [[Texo/Dao|Texo Dao]] support.<br />
<br />
== Jar files/Plugins ==<br />
<br />
The Texo Object Store is defined in the org.eclipse.emf.texo.server plugin which is part of the Texo runtime feature (see [[Texo/Download_and_Install|Download & Install]]).<br />
<br />
== Creating an Object Store using the Object Store Factory ==<br />
<br />
The runtime layer uses an [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/ObjectStoreFactory.java 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 [[Texo/EMFResourceObjectStore|EMFResourceObjectStore]].<br />
<br />
You can implement/set your own object store factory using the [[Texo/Components|Texo Component]] infrastructure or by calling ObjectStoreFactory.setInstance with your own instance.<br />
<br />
== Creating an the Entity Manager Object Store Directly ==<br />
<br />
An Object Store instance can be created directly if you have an EntityManager available:<br />
<source lang="java">EntityManagerObjectStore objectStore = new EntityManagerObjectStore();<br />
objectStore.setEntityManager(entityManager);<br />
// the URI is used for de-resolving references when serializing to XML, see below<br />
objectStore.setUri("http://jpa.test");<br />
</source><br />
<br />
'''Note that for the ObjectStore to be able to read the model layer: the model package class needs to be loaded and initialized, just touching it is enough, for example:'''<br />
<source lang="java">LibraryModelPackage.initialize();<br />
</source><br />
<br />
== Cross Reference Queries ==<br />
<br />
The ObjectStore allows you to retrieve all the objects which reference a certain target object:<br />
<source lang="java">// get maximum 3 referers and include containment referers<br />
List<Object> referers = objectStore.getReferingObjects(target, 3, true);<br />
</source><br />
<br />
See the ObjectStore getReferingObjects api and the isReferenced method.<br />
<br />
== EntityManager ==<br />
<br />
The ObjectStore needs an EntityManager to perform database queries. The ObjectStore uses the standard Texo approach to get an instance of the EntityManager, see [[Texo/EntityManagerHandling|this]] wiki page for more information.<br />
<br />
== (De-)Serializing XML with correct id's ==<br />
<br />
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. <br />
<br />
This (de-)resolving of references while reading from the database is done using the ObjectStore. It is quite simple:<br />
<source lang="java">// serialize a set of objects to xml, use XMI (specified by the second parameter<br />
String xml = objectStore.toXML(objects, true);<br />
// and get it back<br />
List<Object> objects = objectStore.fromXML(xml, true);<br />
</source></div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo&diff=394606Texo2015-12-08T13:12:07Z<p>Mtaal.springsite.com: /* Runtime topics */</p>
<hr />
<div>==Introduction==<br />
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and full REST JSON web service functionality at runtime. <br />
<br />
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].<br />
<br />
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. <br />
<br />
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.<br />
<br />
<br />
[[Image:texo-client-server.png|center|600px]]<br />
<br />
== Benefits of using Texo ==<br />
<br />
Benefits of using current Texo (November 2012):<br />
* Code Generation:<br />
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore model or XSD''' without direct compile time link from generated entities to EMF, Texo or other framework types. '''Facilitates integration of EMF concepts with other frameworks''' such as Google Web Toolkit or Object Relational Mapping solutions<br />
** Supports '''manual change of generated code''' (the same approach as EMF)<br />
** '''[[Template_Overriding|Overridable and Extendable code generation]]''' with support for EMF-like merge, formatting, import-organizing<br />
<br />
* Provides a generic CRUD REST and Query web service layer for all your models, [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]<br />
<br />
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.<br />
<br />
* Supports most '''XML Schema constructs''' (as EMF)<br />
<br />
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.<br />
<br />
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation<br />
<br />
== Download & Install ==<br />
<br />
Texo is installed through the Eclipse update manager. For more details see the [[Texo/Download_and_Install|Download & Install]] page.<br />
<br />
== Quick Start ==<br />
<br />
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...<br />
<br />
== Documentation ==<br />
<br />
The following pages contain detailed information on different parts of the Texo solution. <br />
<br />
=== Blog ===<br />
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].<br />
<br />
=== Code generation topics ===<br />
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.<br />
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.<br />
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.<br />
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.<br />
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).<br />
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).<br />
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.<br />
<br />
=== ORM/JPA generation topics ===<br />
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.<br />
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.<br />
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.<br />
<br />
=== Runtime topics ===<br />
<br />
==== JPA/Persistence integration ====<br />
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.<br />
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality. <br />
<br />
==== XML/JSON REST Web Service Support ====<br />
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]<br />
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]<br />
<br />
==== Object Store ====<br />
* [[Texo/EntityManagerObjectStore|Entity Manager Object Store]]: the entity manager object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.<br />
* [[Texo/EMFResourceObjectStore|EMF Resource Object Store]]: the EMF resource object store uses EMF resources to persist its data.<br />
<br />
==== Framework ====<br />
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.<br />
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.<br />
<br />
==== RCP Persistence using EMF Resources and Texo ====<br />
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.<br />
<br />
==== EMF/XML/XMI ====<br />
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI. <br />
* [[Texo/Convert to EMF|EMF Conversion]]: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.<br />
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.<br />
<br />
==== Miscellaneous ====<br />
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.<br />
<br />
== Main Design Concepts ==<br />
<br />
The Texo project is based on a number of main design concepts and philosophies.<br />
* Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators. <br />
* Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api. <br />
* Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.<br />
<br />
For a more detailed description visit the [[Texo/Design%20Concepts|Design Concepts]] page.<br />
<br />
== Texo and EMF ==<br />
<br />
Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on [[Texo/Texo_and_EMF|this page]].<br />
<br />
== Support & Troubleshooting & Bugzilla ==<br />
<br />
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.<br />
<br />
To enter a new bugzilla you can use the following link:<br />
<br />
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.9.0<br />
<br />
Support is given on the EMFT newsgroup which you can find here:<br />
* nntp: news://news.eclipse.org/eclipse.technology.emft<br />
* forum: http://www.eclipse.org/forums/eclipse.technology.emft<br />
<br />
== Backward Compatibility ==<br />
<br />
Starting from the 0.9.0 version backward compatibility related topics will be published in this section.<br />
<br />
=== 0.9.0 - Version 28 December 2014 ===<br />
<br />
* This issue [https://bugs.eclipse.org/bugs/show_bug.cgi?id=420913 420913] is resolved. There is a property of the EPackage or EReference generation annotation which controls if [https://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29 bi-directional association] support is generated in the java code. This was not working correctly, in that to get this to be working also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved. Note bi-directional access is (and was) 'true'/enabled by default. This can mean that newly generated code (previously generated by a previous Texo version) will change as now the bi-directional property is correctly considered. To keep the old behavior, create an annotation model which sets generateBidirectionalAssociationSupport to false (see [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/tests/org.eclipse.emf.texo.modelgenerator.test/models/samples/extlibrary.annotationsmodel here] for an example, only the generateBidirectionalAssociationSupport part is relevant for this bullet).<br />
<br />
* The createModelObject method of the ModelFactory has been [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/commit/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/model/ModelFactory.java?id=31fb5c7415651646109f711634d0895053ecb0d0 changed] to return a parameterized ModelObject (ModelObject<T>) instead of earlier the ModelObject<?>. With this it is not needed anymore to cast the returned value from createModelObject.<br />
<br />
== Developing ==<br />
<br />
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.<br />
<br />
== Future Topics ==<br />
<br />
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:<br />
* Runtime Layer<br />
** Backend Store: nosql database, elasticsearch<br />
** WebService Support: odata integration<br />
** Integrated with EMF Client Platform<br />
** Introduce service oriented architecture concepts, focusing on micro-service architectures<br />
** integrate with OLAP/Mondrian solutions, back-end and front-end<br />
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box<br />
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF<br />
** use this generic model editor as a basis for a generated model editor in html5/mobile<br />
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor<br />
* Code/Artifact Generation:<br />
** Support JPA 2.1<br />
** Support Ecore/XCore generic types<br />
** Support Ecore/XCore operations<br />
** Add JPA/Texo annotation support in Xcore<br />
<br />
Feel free to react on the EMFT newsgroup with more ideas.<br />
<br />
== See also ==<br />
<br />
* [[Teneo]]<br />
* [[CDO]]<br />
<br />
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo/EntityManagerObjectStore&diff=394605Texo/EntityManagerObjectStore2015-12-08T13:10:10Z<p>Mtaal.springsite.com: </p>
<hr />
<div>__TOC__<br />
<br />
== Introduction ==<br />
<br />
The Texo ObjectStore concept integrates the model layer with JPA. It provides the following functionality:<br />
* It makes it possible to query using an EClass<br />
* Supports cross reference queries<br />
* Supports (de-)serialization with (de-)resolving of references in the XML/XMI against the ObjectStore (the database)<br />
<br />
If you want more specific Dao functionality, check out the [[Texo/Dao|Texo Dao]] support.<br />
<br />
== Jar files/Plugins ==<br />
<br />
The Texo Object Store is defined in the org.eclipse.emf.texo.server plugin which is part of the Texo runtime feature (see [[Texo/Download_and_Install|Download & Install]]).<br />
<br />
== Creating an Object Store using the Object Store Factory ==<br />
<br />
The runtime layer uses an [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/ObjectStoreFactory.java 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 [[Texo/EMFResourceObjectStore|EMFResourceObjectStore]].<br />
<br />
You can implement/set your own object store factory using the [[Texo/Components|Texo Component]] infrastructure or by calling ObjectStoreFactory.setInstance with your own instance.<br />
<br />
== Creating an the Entity Manager Object Store Directly ==<br />
<br />
An Object Store instance can be created directly if you have an EntityManager available:<br />
<source lang="java">EntityManagerObjectStore objectStore = new EntityManagerObjectStore();<br />
objectStore.setEntityManager(entityManager);<br />
// the URI is used for de-resolving references when serializing to XML, see below<br />
objectStore.setUri("http://jpa.test");<br />
</source><br />
<br />
'''Note that for the ObjectStore to be able to read the model layer: the model package class needs to be loaded and initialized, just touching it is enough, for example:'''<br />
<source lang="java">LibraryModelPackage.initialize();<br />
</source><br />
<br />
== Cross Reference Queries ==<br />
<br />
The ObjectStore allows you to retrieve all the objects which reference a certain target object:<br />
<source lang="java">// get maximum 3 referers and include containment referers<br />
List<Object> referers = objectStore.getReferingObjects(target, 3, true);<br />
</source><br />
<br />
See the ObjectStore getReferingObjects api and the isReferenced method.<br />
<br />
== EntityManager ==<br />
<br />
The ObjectStore needs an EntityManager to perform database queries. The ObjectStore uses the standard Texo approach to get an instance of the EntityManager, see [[Texo/EntityManagerHandling|this]] wiki page for more information.<br />
<br />
== (De-)Serializing XML with correct id's ==<br />
<br />
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. <br />
<br />
This (de-)resolving of references while reading from the database is done using the ObjectStore. It is quite simple:<br />
<source lang="java">// serialize a set of objects to xml, use XMI (specified by the second parameter<br />
String xml = objectStore.toXML(objects, true);<br />
// and get it back<br />
List<Object> objects = objectStore.fromXML(xml, true);<br />
</source></div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo/EntityManagerObjectStore&diff=394604Texo/EntityManagerObjectStore2015-12-08T13:09:48Z<p>Mtaal.springsite.com: /* Creating an Object Store */</p>
<hr />
<div>__TOC__<br />
<br />
== Introduction ==<br />
<br />
The Texo ObjectStore concept integrates the model layer with JPA. It provides the following functionality:<br />
* It makes it possible to query using an EClass<br />
* Supports cross reference queries<br />
* Supports (de-)serialization with (de-)resolving of references in the XML/XMI against the ObjectStore (the database)<br />
<br />
If you want more specific Dao functionality, check out the [[Texo/Dao|Texo Dao]] support.<br />
<br />
== Jar files/Plugins ==<br />
<br />
The Texo Object Store is defined in the org.eclipse.emf.texo.server plugin which is part of the Texo runtime feature (see [[Texo/Download_and_Install|Download & Install]]).<br />
<br />
== Creating an the Entity Manager Object Store Directly ==<br />
<br />
An Object Store instance can be created directly if you have an EntityManager available:<br />
<source lang="java">EntityManagerObjectStore objectStore = new EntityManagerObjectStore();<br />
objectStore.setEntityManager(entityManager);<br />
// the URI is used for de-resolving references when serializing to XML, see below<br />
objectStore.setUri("http://jpa.test");<br />
</source><br />
<br />
'''Note that for the ObjectStore to be able to read the model layer: the model package class needs to be loaded and initialized, just touching it is enough, for example:'''<br />
<source lang="java">LibraryModelPackage.initialize();<br />
</source><br />
<br />
== Creating an Object Store using the Object Store Factory ==<br />
<br />
The runtime layer uses an [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/ObjectStoreFactory.java 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 [[Texo/EMFResourceObjectStore|EMFResourceObjectStore]].<br />
<br />
You can implement/set your own object store factory using the [[Texo/Components|Texo Component]] infrastructure or by calling ObjectStoreFactory.setInstance with your own instance.<br />
<br />
== Cross Reference Queries ==<br />
<br />
The ObjectStore allows you to retrieve all the objects which reference a certain target object:<br />
<source lang="java">// get maximum 3 referers and include containment referers<br />
List<Object> referers = objectStore.getReferingObjects(target, 3, true);<br />
</source><br />
<br />
See the ObjectStore getReferingObjects api and the isReferenced method.<br />
<br />
== EntityManager ==<br />
<br />
The ObjectStore needs an EntityManager to perform database queries. The ObjectStore uses the standard Texo approach to get an instance of the EntityManager, see [[Texo/EntityManagerHandling|this]] wiki page for more information.<br />
<br />
== (De-)Serializing XML with correct id's ==<br />
<br />
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. <br />
<br />
This (de-)resolving of references while reading from the database is done using the ObjectStore. It is quite simple:<br />
<source lang="java">// serialize a set of objects to xml, use XMI (specified by the second parameter<br />
String xml = objectStore.toXML(objects, true);<br />
// and get it back<br />
List<Object> objects = objectStore.fromXML(xml, true);<br />
</source></div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo/EntityManagerObjectStore&diff=394603Texo/EntityManagerObjectStore2015-12-08T13:09:23Z<p>Mtaal.springsite.com: /* Creating an Object Store using the Object Store Factory */</p>
<hr />
<div>__TOC__<br />
<br />
== Introduction ==<br />
<br />
The Texo ObjectStore concept integrates the model layer with JPA. It provides the following functionality:<br />
* It makes it possible to query using an EClass<br />
* Supports cross reference queries<br />
* Supports (de-)serialization with (de-)resolving of references in the XML/XMI against the ObjectStore (the database)<br />
<br />
If you want more specific Dao functionality, check out the [[Texo/Dao|Texo Dao]] support.<br />
<br />
== Jar files/Plugins ==<br />
<br />
The Texo Object Store is defined in the org.eclipse.emf.texo.server plugin which is part of the Texo runtime feature (see [[Texo/Download_and_Install|Download & Install]]).<br />
<br />
== Creating an Object Store ==<br />
<br />
An Object Store instance can be created directly if you have an EntityManager available:<br />
<source lang="java">EntityManagerObjectStore objectStore = new EntityManagerObjectStore();<br />
objectStore.setEntityManager(entityManager);<br />
// the URI is used for de-resolving references when serializing to XML, see below<br />
objectStore.setUri("http://jpa.test");<br />
</source><br />
<br />
'''Note that for the ObjectStore to be able to read the model layer: the model package class needs to be loaded and initialized, just touching it is enough, for example:'''<br />
<source lang="java">LibraryModelPackage.initialize();<br />
</source><br />
<br />
<br />
== Creating an Object Store using the Object Store Factory ==<br />
<br />
The runtime layer uses an [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/ObjectStoreFactory.java 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 [[Texo/EMFResourceObjectStore|EMFResourceObjectStore]].<br />
<br />
You can implement/set your own object store factory using the [[Texo/Components|Texo Component]] infrastructure or by calling ObjectStoreFactory.setInstance with your own instance.<br />
<br />
== Cross Reference Queries ==<br />
<br />
The ObjectStore allows you to retrieve all the objects which reference a certain target object:<br />
<source lang="java">// get maximum 3 referers and include containment referers<br />
List<Object> referers = objectStore.getReferingObjects(target, 3, true);<br />
</source><br />
<br />
See the ObjectStore getReferingObjects api and the isReferenced method.<br />
<br />
== EntityManager ==<br />
<br />
The ObjectStore needs an EntityManager to perform database queries. The ObjectStore uses the standard Texo approach to get an instance of the EntityManager, see [[Texo/EntityManagerHandling|this]] wiki page for more information.<br />
<br />
== (De-)Serializing XML with correct id's ==<br />
<br />
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. <br />
<br />
This (de-)resolving of references while reading from the database is done using the ObjectStore. It is quite simple:<br />
<source lang="java">// serialize a set of objects to xml, use XMI (specified by the second parameter<br />
String xml = objectStore.toXML(objects, true);<br />
// and get it back<br />
List<Object> objects = objectStore.fromXML(xml, true);<br />
</source></div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo/EntityManagerObjectStore&diff=394602Texo/EntityManagerObjectStore2015-12-08T13:08:13Z<p>Mtaal.springsite.com: </p>
<hr />
<div>__TOC__<br />
<br />
== Introduction ==<br />
<br />
The Texo ObjectStore concept integrates the model layer with JPA. It provides the following functionality:<br />
* It makes it possible to query using an EClass<br />
* Supports cross reference queries<br />
* Supports (de-)serialization with (de-)resolving of references in the XML/XMI against the ObjectStore (the database)<br />
<br />
If you want more specific Dao functionality, check out the [[Texo/Dao|Texo Dao]] support.<br />
<br />
== Jar files/Plugins ==<br />
<br />
The Texo Object Store is defined in the org.eclipse.emf.texo.server plugin which is part of the Texo runtime feature (see [[Texo/Download_and_Install|Download & Install]]).<br />
<br />
== Creating an Object Store ==<br />
<br />
An Object Store instance can be created directly if you have an EntityManager available:<br />
<source lang="java">EntityManagerObjectStore objectStore = new EntityManagerObjectStore();<br />
objectStore.setEntityManager(entityManager);<br />
// the URI is used for de-resolving references when serializing to XML, see below<br />
objectStore.setUri("http://jpa.test");<br />
</source><br />
<br />
'''Note that for the ObjectStore to be able to read the model layer: the model package class needs to be loaded and initialized, just touching it is enough, for example:'''<br />
<source lang="java">LibraryModelPackage.initialize();<br />
</source><br />
<br />
<br />
== Creating an Object Store using the Object Store Factory ==<br />
<br />
The runtime layer uses an [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/ObjectStoreFactory.java Object Store factory] to create an object store. The object store factory uses the request uri to determine what store to create. You can implement/set your own object store factory using the [[Texo/Components|Texo Component]] infrastructure or by calling ObjectStoreFactory.setInstance with your own instance.<br />
<br />
== Cross Reference Queries ==<br />
<br />
The ObjectStore allows you to retrieve all the objects which reference a certain target object:<br />
<source lang="java">// get maximum 3 referers and include containment referers<br />
List<Object> referers = objectStore.getReferingObjects(target, 3, true);<br />
</source><br />
<br />
See the ObjectStore getReferingObjects api and the isReferenced method.<br />
<br />
== EntityManager ==<br />
<br />
The ObjectStore needs an EntityManager to perform database queries. The ObjectStore uses the standard Texo approach to get an instance of the EntityManager, see [[Texo/EntityManagerHandling|this]] wiki page for more information.<br />
<br />
== (De-)Serializing XML with correct id's ==<br />
<br />
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. <br />
<br />
This (de-)resolving of references while reading from the database is done using the ObjectStore. It is quite simple:<br />
<source lang="java">// serialize a set of objects to xml, use XMI (specified by the second parameter<br />
String xml = objectStore.toXML(objects, true);<br />
// and get it back<br />
List<Object> objects = objectStore.fromXML(xml, true);<br />
</source></div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo&diff=394600Texo2015-12-08T10:47:28Z<p>Mtaal.springsite.com: /* Future Topics */</p>
<hr />
<div>==Introduction==<br />
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and full REST JSON web service functionality at runtime. <br />
<br />
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].<br />
<br />
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. <br />
<br />
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.<br />
<br />
<br />
[[Image:texo-client-server.png|center|600px]]<br />
<br />
== Benefits of using Texo ==<br />
<br />
Benefits of using current Texo (November 2012):<br />
* Code Generation:<br />
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore model or XSD''' without direct compile time link from generated entities to EMF, Texo or other framework types. '''Facilitates integration of EMF concepts with other frameworks''' such as Google Web Toolkit or Object Relational Mapping solutions<br />
** Supports '''manual change of generated code''' (the same approach as EMF)<br />
** '''[[Template_Overriding|Overridable and Extendable code generation]]''' with support for EMF-like merge, formatting, import-organizing<br />
<br />
* Provides a generic CRUD REST and Query web service layer for all your models, [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]<br />
<br />
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.<br />
<br />
* Supports most '''XML Schema constructs''' (as EMF)<br />
<br />
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.<br />
<br />
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation<br />
<br />
== Download & Install ==<br />
<br />
Texo is installed through the Eclipse update manager. For more details see the [[Texo/Download_and_Install|Download & Install]] page.<br />
<br />
== Quick Start ==<br />
<br />
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...<br />
<br />
== Documentation ==<br />
<br />
The following pages contain detailed information on different parts of the Texo solution. <br />
<br />
=== Blog ===<br />
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].<br />
<br />
=== Code generation topics ===<br />
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.<br />
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.<br />
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.<br />
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.<br />
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).<br />
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).<br />
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.<br />
<br />
=== ORM/JPA generation topics ===<br />
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.<br />
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.<br />
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.<br />
<br />
=== Runtime topics ===<br />
<br />
==== JPA/Persistence integration ====<br />
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.<br />
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality. <br />
* [[Texo/ObjectStore|Object Store concept]]: the object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.<br />
<br />
==== XML/JSON REST Web Service Support ====<br />
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]<br />
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]<br />
<br />
==== Framework ====<br />
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.<br />
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.<br />
<br />
==== RCP Persistence using EMF Resources and Texo ====<br />
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.<br />
<br />
==== EMF/XML/XMI ====<br />
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI. <br />
* [[Texo/Convert to EMF|EMF Conversion]]: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.<br />
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.<br />
<br />
==== Miscellaneous ====<br />
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.<br />
<br />
== Main Design Concepts ==<br />
<br />
The Texo project is based on a number of main design concepts and philosophies.<br />
* Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators. <br />
* Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api. <br />
* Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.<br />
<br />
For a more detailed description visit the [[Texo/Design%20Concepts|Design Concepts]] page.<br />
<br />
== Texo and EMF ==<br />
<br />
Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on [[Texo/Texo_and_EMF|this page]].<br />
<br />
== Support & Troubleshooting & Bugzilla ==<br />
<br />
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.<br />
<br />
To enter a new bugzilla you can use the following link:<br />
<br />
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.9.0<br />
<br />
Support is given on the EMFT newsgroup which you can find here:<br />
* nntp: news://news.eclipse.org/eclipse.technology.emft<br />
* forum: http://www.eclipse.org/forums/eclipse.technology.emft<br />
<br />
== Backward Compatibility ==<br />
<br />
Starting from the 0.9.0 version backward compatibility related topics will be published in this section.<br />
<br />
=== 0.9.0 - Version 28 December 2014 ===<br />
<br />
* This issue [https://bugs.eclipse.org/bugs/show_bug.cgi?id=420913 420913] is resolved. There is a property of the EPackage or EReference generation annotation which controls if [https://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29 bi-directional association] support is generated in the java code. This was not working correctly, in that to get this to be working also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved. Note bi-directional access is (and was) 'true'/enabled by default. This can mean that newly generated code (previously generated by a previous Texo version) will change as now the bi-directional property is correctly considered. To keep the old behavior, create an annotation model which sets generateBidirectionalAssociationSupport to false (see [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/tests/org.eclipse.emf.texo.modelgenerator.test/models/samples/extlibrary.annotationsmodel here] for an example, only the generateBidirectionalAssociationSupport part is relevant for this bullet).<br />
<br />
* The createModelObject method of the ModelFactory has been [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/commit/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/model/ModelFactory.java?id=31fb5c7415651646109f711634d0895053ecb0d0 changed] to return a parameterized ModelObject (ModelObject<T>) instead of earlier the ModelObject<?>. With this it is not needed anymore to cast the returned value from createModelObject.<br />
<br />
== Developing ==<br />
<br />
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.<br />
<br />
== Future Topics ==<br />
<br />
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:<br />
* Runtime Layer<br />
** Backend Store: nosql database, elasticsearch<br />
** WebService Support: odata integration<br />
** Integrated with EMF Client Platform<br />
** Introduce service oriented architecture concepts, focusing on micro-service architectures<br />
** integrate with OLAP/Mondrian solutions, back-end and front-end<br />
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box<br />
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF<br />
** use this generic model editor as a basis for a generated model editor in html5/mobile<br />
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor<br />
* Code/Artifact Generation:<br />
** Support JPA 2.1<br />
** Support Ecore/XCore generic types<br />
** Support Ecore/XCore operations<br />
** Add JPA/Texo annotation support in Xcore<br />
<br />
Feel free to react on the EMFT newsgroup with more ideas.<br />
<br />
== See also ==<br />
<br />
* [[Teneo]]<br />
* [[CDO]]<br />
<br />
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo/Hibernate/Download_and_Install&diff=389479Teneo/Hibernate/Download and Install2015-08-05T23:23:41Z<p>Mtaal.springsite.com: /* Usage in Eclipse/OSGI: download and install using the update manager */</p>
<hr />
<div>__TOC__<br />
<br />
<br />
The installation method for Teneo depends on the target environment(Eclipse/OSGI or web container). Both cases are discussed on this page. This page also describes where to find the example projects used in the tutorials in the wiki. <br />
<br />
== Dependencies ==<br />
<br />
To run Teneo you need the following software:<br />
* EMF <br />
* Hibernate<br />
* JDBC driver<br />
<br />
Some dependencies can not be downloaded from eclipse.org because of licensing differences. Teneo provide update sites with the required dependencies (see below for the correct update site depending on your version).<br />
<br />
== Usage in Eclipse/OSGI: download and install using the update manager ==<br />
<br />
=== Plugins and dependencies, update site locations ===<br />
<br />
Teneo is delivered in the following versions:<br />
<br />
* '''2.1.0: EMF 2.10/Eclipse 4.4/Hibernate 4.3.*/JPA 2.0:'''<br />
** Teneo: http://download.eclipse.org/modeling/emf/teneo/updates/2.1.0/interim/<br />
** EMF: http://download.eclipse.org/releases/luna<br />
** Hibernate and other dependencies: http://www.elver.org/eclipse/2.1.0/update<br />
<br />
* '''2.0.0: EMF 2.7-2.8-2.9/Eclipse 3.7-3.8-4.2-4.3/Hibernate 4.1/JPA 2.0:'''<br />
** Teneo: http://download.eclipse.org/modeling/emf/teneo/updates/2.0.0/interim/<br />
** EMF: http://download.eclipse.org/releases/kepler<br />
** Hibernate and other dependencies: http://www.elver.org/eclipse/2.0.0/update<br />
<br />
'''The following update sites are no longer available''':<br />
** http://www.elver.org/eclipse/1.2.0/update<br />
** http://www.elver.org/eclipse/1.1.2/update<br />
<br />
'''Note: update site urls in the screenshots below maybe outdated, use the update site urls listed above.'''<br />
<br />
The EMF update site, select the EMF/XSD SDK:<br />
<br />
[[Image:org.eclipse.emf.teneo.install_emf.png|center|600px]]<br />
<br />
<br />
The Teneo update site will look similar to this image. Select the Teneo Hibernate SDK:<br />
<br />
<br />
[[Image:org.eclipse.emf.teneo.update.site.png|center|700px]]<br />
<br />
<br />
The elver update site lists the Hibernate, dom4j and a number of JDBC plugins. Select the followings, plus some connectors, depending on your needs :<br />
<br />
<br />
[[Image:org.eclipse.emf.teneo.install_dependency.png|center]]<br />
<br />
=== Creating your own Hibernate plugin ===<br />
<br />
If you want to make your own Hibernate/library plugin there is one specific setting which needs to be set in your plugin: make sure to add the following line to the MANIFEST.MF of the Hibernate/libraries plugin you create:<br />
<br />
'''Eclipse-BuddyPolicy: dependent'''<br />
<br />
This is required otherwise the Hibernate libraries can not find your model classes when performing runtime class enhancement. See [http://manuelselva.wordpress.com/2008/04/03/eclipse-and-hibernate-and-class-loaders/ here] for more information. Note that also other Eclipse-BuddyPolicy settings can be used (and can make sense in production environments) but the 'dependent' setting is the safest one.<br />
<br />
=== Teneo, import-packages and ClassNotFoundException when running junit testcases ===<br />
<br />
The Teneo and Hibernate plugins declare dependencies using import-packages. When running junit testcases as normal Java applications or standard junit tests then there is no OSGI environment which takes care of resolving these import-packages. This means that the import-package dependencies are not resolved and ClassNotFoundExceptions are thrown. <br />
<br />
This can be solved by explicitly declaring the dependency in the MANIFEST.MF of your test or model project. As an example: these are the dependendencies set in the examples project:<br />
<source lang="javascript"><br />
Require-Bundle: org.eclipse.core.runtime,<br />
org.eclipse.emf.ecore;visibility:=reexport,<br />
org.eclipse.emf.ecore.xmi;visibility:=reexport,<br />
org.eclipse.emf.teneo.hibernate;bundle-version="1.1.2",<br />
org.hibernate;bundle-version="3.3.2",<br />
org.eclipse.emf.ecore.change,<br />
org.apache.commons.logging,<br />
org.dom4j,<br />
org.hsqldb,<br />
com.mysql.jdbc<br />
</source><br />
<br />
== Usage in a Web Container - Maven ==<br />
<br />
For usage within a web container the following jar files are required. You can download these files from the plugins section on the [http://download.eclipse.org/modeling/emf/teneo/updates/1.2.0/interim/ update site] using your web browser, or you can use Maven (see below):<br />
<br />
=== Jars and Dependencies ===<br />
<br />
* '''Teneo jar files''':<br />
** org.eclipse.emf.teneo<br />
** org.eclipse.emf.teneo.annotations<br />
** org.eclipse.emf.teneo.hibernate<br />
** org.eclipse.emf.teneo.hibernate.mapper<br />
<br />
* '''EMF jar files''':<br />
** org.eclipse.emf.ecore<br />
** org.eclipse.emf.common<br />
** org.eclipse.emf.ecore.xmi<br />
<br />
* '''Dependencies''': Teneo depends on the [http://www.hibernate.org hibernate] and [http://commons.apache.org/logging/ commons-logging] jars (and a jdbc jar). You can find them in maven central or you can download directly from their respective websites.<br />
<br />
=== Maven ===<br />
<br />
Teneo and related EMF jar files are published in [http://search.maven.org/#search%7Cga%7C1%7Corg.eclipse.emf.teneo central maven] and in the [https://oss.sonatype.org/content/repositories/releases/org/eclipse/emf/ sonatype-snapshot] repository. All of them are published in the [http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.eclipse.emf%22 org.eclipse.emf] group.<br />
<br />
'''The Teneo pom files do not define explicit dependencies. This means that your pom files should list the EMF, commons-logging and hibernate jar file as dependencies.'''<br />
<br />
== Download Example Project for Tutorials ==<br />
<br />
The example project (org.eclipse.emf.teneo.hibernate.examples) can be found in git [http://git.eclipse.org/c/teneo/org.eclipse.emf.teneo.git/tree/hibernate/org.eclipse.emf.teneo.hibernate.examples here]. To clone the Teneo git repository execute this action:<br />
<br />
git clone git://git.eclipse.org/gitroot/teneo/org.eclipse.emf.teneo.git<br />
<br />
See [[Git|this page]] on how to work with Eclipse GIT repositories.<br />
<br />
The main examples project used in the tutorials is the: '''org.eclipse.emf.teneo.hibernate.examples''' project.<br />
<br />
This example project uses an extended version of the well-known EMF library example. The example project contains the generated model code and a number of tutorial classes showing how to work with EMF, Teneo and Hibernate.<br />
<br />
Some more details regarding the example project. The example project consists of the following:<br />
* an ecore model and genmodel (in the model subfolder)<br />
* generated model code (no manual changes done, so you can change the ecore model and regenerate the code)<br />
* a number of tutorial java classes in the org.eclipse.emf.teneo.hibernate.examples package<br />
<br />
The MANIFEST.MF of the examples project lists dependencies on several plugins, see the next section for more information on this.</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo/Hibernate/Configuration_Options&diff=379777Teneo/Hibernate/Configuration Options2015-03-10T19:18:33Z<p>Mtaal.springsite.com: /* System property: Identifier Cache Handling/Purging */</p>
<hr />
<div>__TOC__<br />
<br />
The options described here are all present in the [http://git.eclipse.org/c/teneo/org.eclipse.emf.teneo.git/tree/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/PersistenceOptions.java org.eclipse.emf.teneo.PersistenceOptions] class. <br />
<br />
For controlling the naming of tables/columns/foreign keys in more detail use the [[Teneo/Hibernate/Extensions#SqlNameStrategy_ExtensionPoint_.28org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy.29|SqlNameStrategy extension point]].<br />
<br />
For detailed control of entity naming use the [[Teneo/Hibernate/Extensions#EntityNameStrategy_ExtensionPoint_.28org.eclipse.emf.teneo.mapping.strategy.EntityNameStrategy.29|EntityNameStrategy extension point]].<br />
<br />
'''For a description of auditing options see the [[Teneo/Hibernate/Auditing|auditing]] page.'''<br />
<br />
==Passing/Setting Configuration Options==<br />
<br />
Options are passed to the HbDataStore using a Properties object which is set using the HbDataStore.setProperties method. <br />
<br />
For programmatic setting of properties:<br />
* Use the static members in the [http://git.eclipse.org/c/teneo/org.eclipse.emf.teneo.git/tree/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/PersistenceOptions.java org.eclipse.emf.teneo.PersistenceOptions] class.<br />
* All properties are considered to be passed as a String, Boolean options should be set to the lower case String values: "false" or "true".<br />
<br />
In the [[CDO_Hibernate_Store|CDO Hibernate Store]] the configuration options are set in the [[CDO_Hibernate_Store_Configuration_and_Setup#Teneo_Properties|cdo-server.xml]]. <br />
<br />
==SQL Naming Related Options==<br />
<br />
The tables shown below gives the following information:<br />
* Property: the name of the property as it can be set in a properties file or configuration file.<br />
* Default: all properties should be passed in as expect string values, so the default value should be read/considered as a String.<br />
* Description: describes the option.<br />
<br />
(*) because of backward compatibility some properties do not have a teneo.* prefix.<br />
<br />
{|cellpadding="2" cellspacing="0" border="1"<br />
! Property<br />
! Default<br />
! Description<br />
|-<br />
|'''teneo.naming.discriminator_column_name'''<br />
|DTYPE<br />
|the column name used for the discriminator column<br />
|-<br />
|'''econtainer_class_column''' (*)<br />
|econtainer_class<br />
|the column used to store the class of the id of the econtainer<br />
|-<br />
|'''e_container_column''' (*)<br />
|e_container<br />
|the column used to store the id of the econtainer<br />
|-<br />
|'''e_container_feature_name_column''' (*)<br />
|e_container_feature_name<br />
|the column used to store the feature name of the containment feature<br />
|-<br />
|'''teneo.naming.auto_adapt_manual_set_sql_names'''<br />
|true<br />
|should manual set names be truncated or upper-lower cased, the default is true because of backward compatibility.<br />
|-<br />
|'''teneo.naming.idbag_id_column_name'''<br />
|ID<br />
|is used to set the id column name in the join table containing the idbag elements<br />
|-<br />
|'''teneo.naming.default_id_column'''<br />
|e_id<br />
|can be used to set the id column name which is used to store the id of an object. The id column is only added automatically if the model does not define a primary key for the type. Default the id column name is e_id, however not all databases support _ in the name.<br />
|-<br />
|'''teneo.naming.max_sql_name_length'''<br />
| -1, no maximum<br />
|can be used to control the column and table name length. This is especially relevant in case the default annotation process creates foreign key columns or your property names are too long. Foreign key column names are created by concatenating the name of the (e)class and the propertyname. The resulting name can be to long for certain databases. By setting this option the system will truncate column names to this length. If the column/table name has a suffix (separated by a _) then the system will truncate the part before the suffix.<br />
|-<br />
|'''teneo.naming.set_foreign_key_name'''<br />
|true<br />
|if this option is true then Teneo will also generate descriptive names of the foreign key relations. If this option is false then Hibernate will take care of foreign key naming. However these names can be too long or are less meaningfull. Note when setting this property to true it is possible that foreign key names will be the same as table names, this can give issues in Postgresql (and maybe other database also). To prevent this, set the sql_fk_name_prefix option also.<br />
|-<br />
|'''teneo.naming.strategy'''<br />
|lowercase<br />
|controls if the table and column names are uppercased, lowercased or no specific casing is done. The value lowercase will force lower case for all table/column name, the value uppercase will force uppercase for all table/column names, none wil do not casing. It is also possible to set this option to the classname of a class implementing the org.eclipse.emf.teneo.util.SQLCaseStrategy interface.<br />
|-<br />
|'''teneo.naming.sql_name_escape_character'''<br />
|` (the backquote character)<br />
| <br />
Teneo will escape table and column names (see [[Teneo/Hibernate/EMF_Hibernate_Integration_Details#Escaping_of_table_and_column_names | here]]). As a default the ` backtick character is used. This option allows you to change the escape character or disable it by setting it to an empty string.<br />
|-<br />
|'''teneo.naming.sql_column_name_prefix'''<br />
|<br />
|Sets the prefix of all column names (including join column names).<br />
|-<br />
|'''teneo.naming.sql_fk_name_prefix'''<br />
|<br />
|Sets the prefix of all foreign key names, only relevant if foreign key names are generated by Teneo (see the set_foreign_key_name option).<br />
|-<br />
|'''teneo.naming.sql_index_name_prefix'''<br />
|<br />
|Sets the prefix of all generated index names, only relevant if indexes are generated by Teneo for foreign key references (see the add_index_for_fk option).<br />
|-<br />
|'''teneo.naming.sql_table_name_prefix'''<br />
|<br />
|Sets the prefix of all table names (including join table names).<br />
|-<br />
|'''teneo.naming.version_column'''<br />
|e_version<br />
|Can be used to set the version column name which is used to store the version of an object in case of optimistic locking. Default the version column name is e_version, however not all databases support _ in the name.<br />
|}<br />
<br />
==General Options==<br />
<br />
{|cellpadding="2" cellspacing="0" border="1"<br />
! Property<br />
! Default<br />
! Description<br />
|-<br />
|'''teneo.mapping.add_index_for_fk'''<br />
|false<br />
|there are databases which do not automatically create an index for a foreign key relation. This option '''(default is false)''' forces Teneo to explicitly set an index for each foreign key relation. The index name will be generated by Teneo.<br />
Note that generated index names can be the same as table names, this can give issues in Postgresql (and maybe other database also). To prevent this, set the sql_index_name_prefix option also.<br />
|-<br />
|'''teneo.mapping.always_map_list_as_bag'''<br />
|false<br />
|often modeling the index of a list in a relational database is not usefull. This option controls if al lists are mapped as a Hibernate bag. This is more efficient as Hibernate does not need to maintain an ordering in the database. Note that if you specified a manual OneToMany annotation on an EReference then for that EReference the settings on the onetomany are followed.<br />
|-<br />
|'''teneo.mapping.always_version'''<br />
|true<br />
|this option (boolean) determines if the system should automatically add a version attribute to each class mapping. If set to true (the default) then the system will add a version property to the mapping if no other eattribute has a version annotation. If set to false then the version property is not added automatically.<br />
|-<br />
|'''teneo.mapping.also_map_as_class'''<br />
|true<br />
|this option will add a name attribute to each class mapping. This makes it possible to query using actual class and interface names (next to the entityname).<br />
|-<br />
|'''teneo.mapping.auto_add_referenced_epackages'''<br />
|false<br />
|if set to true then Teneo will automatically add EPackages, which are referenced from the EPackages registered for a data store, to that datastore.<br />
|-<br />
|'''teneo.mapping.cascade_policy_on_containment'''<br />
|ALL<br />
|Can be used to set custom cascade policy for containment : ALL or a combination of REMOVE, REFRESH, PERSIST, MERGE. For example: REMOVE,PERSIST,MERGE. Note: ALL != REMOVE,REFRESH,PERSIST,MERGE. However, ALL == REMOVE with delete Orphan, REFRESH,PERSIST,MERGE<br />
|-<br />
|'''teneo.mapping.cascade_policy_on_non_containment'''<br />
|<br />
|this option allows you to set the default cascade policy for non containment relations. It can be set to a comma delimited set of cascade values, for example MERGE, PERSIST, REFRESH. If this option is not set then then the system will use the following set: MERGE, PERSIST, REFRESH.<br />
|-<br />
|'''teneo.runtime.convert_unset_to_null'''<br />
|false<br />
|if true then an unset eAttribute is stored as null in the database, when reading the null is again used as the EAttribute value of the object (unless the handle_unset_as_null option is set, see below).<br />
'''NOTE: DEPRECATED ''' has the same behavior as the handle_unset_as_null option, use that option.<br />
|-<br />
|'''teneo.mapping.default_cache_strategy'''<br />
|NONE<br />
|this option allows you to set second level caching at a global level. If set to a value other than NONE then all EClasses and collection EFeatures will have caching set. The value is one of NONE, READ_ONLY, NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL.<br />
|-<br />
|'''teneo.mapping.default_id_feature'''<br />
|e_id<br />
|with this option it is possible to let Teneo automatically identify the id-property. All efeatures with this name are used as persistence id. The default value is e_id (same as for the default id column name). To ensure that no efeature is by accident considered as the id-feature this should be set to an empty string.<br />
|-<br />
|'''teneo.mapping.default_temporal'''<br />
|TIMESTAMP<br />
|this option controls the default mapping to use for temporal (e.g. java.util.Date) properties. The default is TIMESTAMP, other allowed values are DATE, TIME.<br />
|-<br />
|'''teneo.mapping.default_varchar_length'''<br />
|255 (default by Hibernate)<br />
|as a default Hibernate will use a length of 255 for varchar columns. This option makes it possible to choose another default length. Note that it is also possible to set the length for each individual Column/EFeature using the @Column annotation.<br />
|-<br />
|'''teneo.mapping.disable_econtainer'''<br />
|false<br />
|this option (boolean) controls if the container relations are mapped explicitly in the database, see also [[Teneo/Hibernate/ModelRelational/Association_Mapping#Storing_container_relation|here]].<br />
|-<br />
|'''teneo.mapping.eav_mapping'''<br />
|false<br />
|If set to true then the system will map all eclasses as an EAV mapping. See [[Teneo/Hibernate/ModelRelational/Entity_Attribute_Value_Mapping|Entity Attribute Value mapping]].<br />
|-<br />
|'''teneo.mapping.eav_location'''<br />
|<br />
|this option (string) controls which mapping file is used to create the EAV database schema. If not set then the org.eclipse.emf.teneo.hibernate.mapping.eav.eav.hbm.xml is used. The value is resolved as a class path against the PersistenceFileProvider class.<br />
|-<br />
|'''teneo.runtime.elist_efficient_size_operation'''<br />
|false<br />
|this option (boolean) controls if the size operation on an elist will load the elist (if option is false) or perform a separate query for computing the size (if the option is true). The option is set to false for backward compatibility.<br />
|-<br />
|'''teneo.mapping.emap_as_true_map'''<br />
|true<br />
|this option controls how an EMF EMap is mapped to the db. An EMF EMap is not a real map but a list of map entries (subtle but important difference). It can be mapped to the database as a list or as a map. In previous releases of Teneo the EMap was mapped as a list. However, this is less efficient and does not work in cases that the data needs to be serialized (because the list content was stored with a synthetic id which is not supported in case of serialization). Therefor now the default approach is to map an EMap as a true Hibernate map. To support backward compatibility this option is introduced. Its default is true (use the new approach), by setting it to "false" the old approach is followed.<br />
|-<br />
|'''teneo.mapping.extra_annotation_sources'''<br />
|<br />
|as a default Teneo will only use model annotations with a source equal to teneo.jpa (see [[Teneo/Hibernate/ModelRelational/Annotations_Format|here]]). This option allows you to specify extra annotation sources which are considered. This makes it possible to work with different [[Teneo/Hibernate/ModelRelational/Annotations_Format#Multiple_sets_of_annotations_in_one_model|annotation sets]] in your model and disable or enable them (using this option) when required.<br />
|-<br />
|'''teneo.mapping.extra_annotations_overrides_default'''<br />
|<br />
|Default is false, if true will consider the extra annotation source(s) as overriding the default annotations, so if a model element has an annotation with a source specified in the extra_annotation_sources then the eannotations with the default sources is not used.<br />
|-<br />
|'''teneo.mapping.featuremap_as_component'''<br />
|false<br />
|if set to "true" will map a feature map entry as a Hibernate component without its own id. If set to false then a feature map entry will be mapped as a separate entity.<br />
|-<br />
|'''teneo.mapping.fetch_containment_eagerly'''<br />
|false<br />
|if set to "true" will set the fetch strategy of all containment references to EAGER. This means that containment relations are completely read in memory. Default is "false".<br />
|-<br />
|'''teneo.mapping.fetch_one_to_many_extra_lazy'''<br />
|false<br />
|if set to "true" will set all associations to be extra-lazy, this means that for common collection operations the list is not loaded completely in memory but separate calls to the database are done. For more information see [[Teneo/Hibernate/Collection_Extra-Lazy_Loading|this]] wiki page.<br />
|-<br />
|'''teneo.runtime.handle_unset_as_null'''<br />
|false in Teneo, true in the CDO Hibernate Store<br />
|if false then always the value of the EAttribute is stored eventhough the EAttribute is not set (unset==true), reading an object from the database will always set the value if it has a default. If true then if the EAttribute value is not set on an EObject then null is set in the database and when reading the object from the database the EAttribute remains not-set.<br />
|-<br />
|'''teneo.naming.id_feature_as_primary_key'''<br />
|true<br />
|as a default eattributes with ID=true will be denoted as the primary key of the eclass. If this feature''' (default is true) is set to false then this default behavior is disabled.<br />
|-<br />
|'''teneo.mapping.ignore_eannotations'''<br />
|false<br />
|Ignore mapping EAnnotations. Primarily meant for test cases that use Persistence XML mapping, so that they can reuse the same sample models.<br />
|-<br />
|'''teneo.mapping.inheritance'''<br />
|SINGLE_TABLE<br />
|the default inheritance mapping strategy to use, this can be JOINED or SINGLE_TABLE, see [[Teneo/Hibernate/ModelRelational/Inheritance_Mapping|here]] for more information.<br />
|-<br />
|'''teneo.mapping.join_table_for_non_contained_associations'''<br />
|true<br />
|boolean, if set to true then always a join table is created for one-to-many non-contained associations.<br />
|-<br />
|'''teneo.mapping.map_all_lists_as_idbag'''<br />
|false<br />
|the Hibernate idbag maps a list as a very efficient bag in which each list entry gets an id. This makes it possible to update the list very efficiently. This option allows you to force Teneo to use the idbag for all lists. Note that if you specified a manual OneToMany annotation on an EReference then for that EReference no IdBag annotation is added. Also it makes sense to combine this option with setting the option JOIN_TABLE_FOR_NON_CONTAINED_ASSOCIATIONS to true also. Note, there is an issue with Derby and IDBAG, see [[Teneo/Hibernate/FAQ#Derby_and_Hibernate_IDBag|here]].<br />
|-<br />
|'''teneo.mapping.map_document_root'''<br />
|false<br />
|the option controls if Teneo should support persisting the very generic DocumentRoot EClass which is generated when EMF encounters global elements which are not complex types.<br />
|-<br />
|'''teneo.mapping.map_embeddable_as_embedded'''<br />
|false<br />
|if set to true then an EReference to an EClass which is annotated with @Embeddable will automatically be annotated with @Embedded. If false (the default) then an EReference to an embeddable EClass needs to be manually annotated with @Embedded.<br />
|-<br />
|'''teneo.mapping.mapping_file_name'''<br />
|<br />
|with this option you can specify one or more comma-delimited resource paths (incl. filename) to a mapping file. Instead of generating a mapping Teneo will then use the mapping file found through this path.<br />
|-<br />
|'''teneo.mapping.force_lazy'''<br />
|false<br />
|will set lazy="true" on an entity without setting the proxy attribute, hibernate will use the implementation class itself as the proxy class. When setting this option then the set_proxy option should not be used.<br />
|-<br />
|'''teneo.mapping.max_comment_length'''<br />
|0<br />
|comments in the model can be copied to the mapping file. This option sets the maximum length of these comments, the default specifies the maximum length with this option you can specify a resource path (incl. filename) to a mapping file. Instead of generating a mapping Teneo will then use the mapping file found through this path.<br />
|-<br />
|'''teneo.mapping.optimistic_locking'''<br />
|true<br />
|if this property is "false" then no version properties are added to the mapping of EClasses.<br />
|-<br />
|'''teneo.mapping.persistence_xml'''<br />
|<br />
|the location of the xml annotations file. The location should be a resource path.<br />
|-<br />
|'''teneo.mapping.set_entity_automatically'''<br />
|true<br />
|if set to "false" then only EClasses which have an Entity annotation will be mapped. Default is "true", this means that all EClasses are mapped to the persistent store.<br />
|-<br />
|'''teneo.mapping.set_generated_value_on_id_feature'''<br />
|true<br />
|only applies if ID_FEATURE_AS_PRIMARY_KEY is true (which is the default). This option forces Teneo to also add a generator tag (with class="native") to the id tag. This is only done for EAttributes which have ID="true" and only if ID_FEATURE_AS_PRIMARY_KEY is true and no manual @Id annotation was set on the EAttribute.<br />
|-<br />
|'''teneo.mapping.set_proxy'''<br />
|false<br />
|this option controls if Hibernate will use a cglib/javaassist proxy when loading objects for many-to-one/one-to-one relations. If set to true then Teneo will automatically add a @Proxy annotation to each type. In addition the fetch of the many-to-one and one-to-one is set to LAZY (if not set by the user). If this option is false then for individual types the @Proxy annotation can also be used (see the Hibernate annotation extensions).<br />
<br />
See also the force_lazy option above, when using the force_lazy option, the set_proxy option should not be set (it should be false).<br />
|-<br />
|'''teneo.mapping.hibernate_mapping_file'''<br />
|false<br />
|if set to "true" then Teneo will not do an automatic mapping of the ecore model to Hibernate but instead search for a hibernate.hbm.xml in the classpath of the EMF generated java classes.<br />
|}<br />
<br />
== System property: Identifier Cache Handling/Purging ==<br />
<br />
Teneo keeps an internal weak-reference map for caching id's and versions of objects. The map is purged for stale references every 60 seconds (versions and ids separately). You can control the interval by passing the following system property, '''org.eclipse.teneo.hibernate.identifierPurgingPeriod''': interval in seconds by which purging should happen. If the purging (of either versions or ids) takes longer than 1000 millisecond, this occurrence is logged in info level. This last threshold can be configured using following system property, '''org.eclipse.teneo.hibernate.identifierPurgingLogTimeThreshold''': count of milliseconds which if exceeded the occurrence gets logged.<br />
<br />
== Options related to XSD Date handling==<br />
<br />
A number of options are related to handling a specific issue with the XMLGregorianCalendar implementation in different java-providers. See bugzilla [https://bugs.eclipse.org/bugs/show_bug.cgi?id=227673 227673]. <br />
<br />
The options are ''teneo.mapping.UserDateType'', ''teneo.mapping.UserDateTimeType'' and ''teneo.mapping.XSDDateClass''. <br />
<br />
The first two options define which usertype is used when generating the hibernate mapping for xsddate/xsddatetime types. The last option defines the actual class used for the date instance, the default is javax.xml.datatype.XMLGregorianCalendar.</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo/Hibernate/Configuration_Options&diff=379769Teneo/Hibernate/Configuration Options2015-03-10T18:16:22Z<p>Mtaal.springsite.com: </p>
<hr />
<div>__TOC__<br />
<br />
The options described here are all present in the [http://git.eclipse.org/c/teneo/org.eclipse.emf.teneo.git/tree/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/PersistenceOptions.java org.eclipse.emf.teneo.PersistenceOptions] class. <br />
<br />
For controlling the naming of tables/columns/foreign keys in more detail use the [[Teneo/Hibernate/Extensions#SqlNameStrategy_ExtensionPoint_.28org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy.29|SqlNameStrategy extension point]].<br />
<br />
For detailed control of entity naming use the [[Teneo/Hibernate/Extensions#EntityNameStrategy_ExtensionPoint_.28org.eclipse.emf.teneo.mapping.strategy.EntityNameStrategy.29|EntityNameStrategy extension point]].<br />
<br />
'''For a description of auditing options see the [[Teneo/Hibernate/Auditing|auditing]] page.'''<br />
<br />
==Passing/Setting Configuration Options==<br />
<br />
Options are passed to the HbDataStore using a Properties object which is set using the HbDataStore.setProperties method. <br />
<br />
For programmatic setting of properties:<br />
* Use the static members in the [http://git.eclipse.org/c/teneo/org.eclipse.emf.teneo.git/tree/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/PersistenceOptions.java org.eclipse.emf.teneo.PersistenceOptions] class.<br />
* All properties are considered to be passed as a String, Boolean options should be set to the lower case String values: "false" or "true".<br />
<br />
In the [[CDO_Hibernate_Store|CDO Hibernate Store]] the configuration options are set in the [[CDO_Hibernate_Store_Configuration_and_Setup#Teneo_Properties|cdo-server.xml]]. <br />
<br />
==SQL Naming Related Options==<br />
<br />
The tables shown below gives the following information:<br />
* Property: the name of the property as it can be set in a properties file or configuration file.<br />
* Default: all properties should be passed in as expect string values, so the default value should be read/considered as a String.<br />
* Description: describes the option.<br />
<br />
(*) because of backward compatibility some properties do not have a teneo.* prefix.<br />
<br />
{|cellpadding="2" cellspacing="0" border="1"<br />
! Property<br />
! Default<br />
! Description<br />
|-<br />
|'''teneo.naming.discriminator_column_name'''<br />
|DTYPE<br />
|the column name used for the discriminator column<br />
|-<br />
|'''econtainer_class_column''' (*)<br />
|econtainer_class<br />
|the column used to store the class of the id of the econtainer<br />
|-<br />
|'''e_container_column''' (*)<br />
|e_container<br />
|the column used to store the id of the econtainer<br />
|-<br />
|'''e_container_feature_name_column''' (*)<br />
|e_container_feature_name<br />
|the column used to store the feature name of the containment feature<br />
|-<br />
|'''teneo.naming.auto_adapt_manual_set_sql_names'''<br />
|true<br />
|should manual set names be truncated or upper-lower cased, the default is true because of backward compatibility.<br />
|-<br />
|'''teneo.naming.idbag_id_column_name'''<br />
|ID<br />
|is used to set the id column name in the join table containing the idbag elements<br />
|-<br />
|'''teneo.naming.default_id_column'''<br />
|e_id<br />
|can be used to set the id column name which is used to store the id of an object. The id column is only added automatically if the model does not define a primary key for the type. Default the id column name is e_id, however not all databases support _ in the name.<br />
|-<br />
|'''teneo.naming.max_sql_name_length'''<br />
| -1, no maximum<br />
|can be used to control the column and table name length. This is especially relevant in case the default annotation process creates foreign key columns or your property names are too long. Foreign key column names are created by concatenating the name of the (e)class and the propertyname. The resulting name can be to long for certain databases. By setting this option the system will truncate column names to this length. If the column/table name has a suffix (separated by a _) then the system will truncate the part before the suffix.<br />
|-<br />
|'''teneo.naming.set_foreign_key_name'''<br />
|true<br />
|if this option is true then Teneo will also generate descriptive names of the foreign key relations. If this option is false then Hibernate will take care of foreign key naming. However these names can be too long or are less meaningfull. Note when setting this property to true it is possible that foreign key names will be the same as table names, this can give issues in Postgresql (and maybe other database also). To prevent this, set the sql_fk_name_prefix option also.<br />
|-<br />
|'''teneo.naming.strategy'''<br />
|lowercase<br />
|controls if the table and column names are uppercased, lowercased or no specific casing is done. The value lowercase will force lower case for all table/column name, the value uppercase will force uppercase for all table/column names, none wil do not casing. It is also possible to set this option to the classname of a class implementing the org.eclipse.emf.teneo.util.SQLCaseStrategy interface.<br />
|-<br />
|'''teneo.naming.sql_name_escape_character'''<br />
|` (the backquote character)<br />
| <br />
Teneo will escape table and column names (see [[Teneo/Hibernate/EMF_Hibernate_Integration_Details#Escaping_of_table_and_column_names | here]]). As a default the ` backtick character is used. This option allows you to change the escape character or disable it by setting it to an empty string.<br />
|-<br />
|'''teneo.naming.sql_column_name_prefix'''<br />
|<br />
|Sets the prefix of all column names (including join column names).<br />
|-<br />
|'''teneo.naming.sql_fk_name_prefix'''<br />
|<br />
|Sets the prefix of all foreign key names, only relevant if foreign key names are generated by Teneo (see the set_foreign_key_name option).<br />
|-<br />
|'''teneo.naming.sql_index_name_prefix'''<br />
|<br />
|Sets the prefix of all generated index names, only relevant if indexes are generated by Teneo for foreign key references (see the add_index_for_fk option).<br />
|-<br />
|'''teneo.naming.sql_table_name_prefix'''<br />
|<br />
|Sets the prefix of all table names (including join table names).<br />
|-<br />
|'''teneo.naming.version_column'''<br />
|e_version<br />
|Can be used to set the version column name which is used to store the version of an object in case of optimistic locking. Default the version column name is e_version, however not all databases support _ in the name.<br />
|}<br />
<br />
==General Options==<br />
<br />
{|cellpadding="2" cellspacing="0" border="1"<br />
! Property<br />
! Default<br />
! Description<br />
|-<br />
|'''teneo.mapping.add_index_for_fk'''<br />
|false<br />
|there are databases which do not automatically create an index for a foreign key relation. This option '''(default is false)''' forces Teneo to explicitly set an index for each foreign key relation. The index name will be generated by Teneo.<br />
Note that generated index names can be the same as table names, this can give issues in Postgresql (and maybe other database also). To prevent this, set the sql_index_name_prefix option also.<br />
|-<br />
|'''teneo.mapping.always_map_list_as_bag'''<br />
|false<br />
|often modeling the index of a list in a relational database is not usefull. This option controls if al lists are mapped as a Hibernate bag. This is more efficient as Hibernate does not need to maintain an ordering in the database. Note that if you specified a manual OneToMany annotation on an EReference then for that EReference the settings on the onetomany are followed.<br />
|-<br />
|'''teneo.mapping.always_version'''<br />
|true<br />
|this option (boolean) determines if the system should automatically add a version attribute to each class mapping. If set to true (the default) then the system will add a version property to the mapping if no other eattribute has a version annotation. If set to false then the version property is not added automatically.<br />
|-<br />
|'''teneo.mapping.also_map_as_class'''<br />
|true<br />
|this option will add a name attribute to each class mapping. This makes it possible to query using actual class and interface names (next to the entityname).<br />
|-<br />
|'''teneo.mapping.auto_add_referenced_epackages'''<br />
|false<br />
|if set to true then Teneo will automatically add EPackages, which are referenced from the EPackages registered for a data store, to that datastore.<br />
|-<br />
|'''teneo.mapping.cascade_policy_on_containment'''<br />
|ALL<br />
|Can be used to set custom cascade policy for containment : ALL or a combination of REMOVE, REFRESH, PERSIST, MERGE. For example: REMOVE,PERSIST,MERGE. Note: ALL != REMOVE,REFRESH,PERSIST,MERGE. However, ALL == REMOVE with delete Orphan, REFRESH,PERSIST,MERGE<br />
|-<br />
|'''teneo.mapping.cascade_policy_on_non_containment'''<br />
|<br />
|this option allows you to set the default cascade policy for non containment relations. It can be set to a comma delimited set of cascade values, for example MERGE, PERSIST, REFRESH. If this option is not set then then the system will use the following set: MERGE, PERSIST, REFRESH.<br />
|-<br />
|'''teneo.runtime.convert_unset_to_null'''<br />
|false<br />
|if true then an unset eAttribute is stored as null in the database, when reading the null is again used as the EAttribute value of the object (unless the handle_unset_as_null option is set, see below).<br />
'''NOTE: DEPRECATED ''' has the same behavior as the handle_unset_as_null option, use that option.<br />
|-<br />
|'''teneo.mapping.default_cache_strategy'''<br />
|NONE<br />
|this option allows you to set second level caching at a global level. If set to a value other than NONE then all EClasses and collection EFeatures will have caching set. The value is one of NONE, READ_ONLY, NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL.<br />
|-<br />
|'''teneo.mapping.default_id_feature'''<br />
|e_id<br />
|with this option it is possible to let Teneo automatically identify the id-property. All efeatures with this name are used as persistence id. The default value is e_id (same as for the default id column name). To ensure that no efeature is by accident considered as the id-feature this should be set to an empty string.<br />
|-<br />
|'''teneo.mapping.default_temporal'''<br />
|TIMESTAMP<br />
|this option controls the default mapping to use for temporal (e.g. java.util.Date) properties. The default is TIMESTAMP, other allowed values are DATE, TIME.<br />
|-<br />
|'''teneo.mapping.default_varchar_length'''<br />
|255 (default by Hibernate)<br />
|as a default Hibernate will use a length of 255 for varchar columns. This option makes it possible to choose another default length. Note that it is also possible to set the length for each individual Column/EFeature using the @Column annotation.<br />
|-<br />
|'''teneo.mapping.disable_econtainer'''<br />
|false<br />
|this option (boolean) controls if the container relations are mapped explicitly in the database, see also [[Teneo/Hibernate/ModelRelational/Association_Mapping#Storing_container_relation|here]].<br />
|-<br />
|'''teneo.mapping.eav_mapping'''<br />
|false<br />
|If set to true then the system will map all eclasses as an EAV mapping. See [[Teneo/Hibernate/ModelRelational/Entity_Attribute_Value_Mapping|Entity Attribute Value mapping]].<br />
|-<br />
|'''teneo.mapping.eav_location'''<br />
|<br />
|this option (string) controls which mapping file is used to create the EAV database schema. If not set then the org.eclipse.emf.teneo.hibernate.mapping.eav.eav.hbm.xml is used. The value is resolved as a class path against the PersistenceFileProvider class.<br />
|-<br />
|'''teneo.runtime.elist_efficient_size_operation'''<br />
|false<br />
|this option (boolean) controls if the size operation on an elist will load the elist (if option is false) or perform a separate query for computing the size (if the option is true). The option is set to false for backward compatibility.<br />
|-<br />
|'''teneo.mapping.emap_as_true_map'''<br />
|true<br />
|this option controls how an EMF EMap is mapped to the db. An EMF EMap is not a real map but a list of map entries (subtle but important difference). It can be mapped to the database as a list or as a map. In previous releases of Teneo the EMap was mapped as a list. However, this is less efficient and does not work in cases that the data needs to be serialized (because the list content was stored with a synthetic id which is not supported in case of serialization). Therefor now the default approach is to map an EMap as a true Hibernate map. To support backward compatibility this option is introduced. Its default is true (use the new approach), by setting it to "false" the old approach is followed.<br />
|-<br />
|'''teneo.mapping.extra_annotation_sources'''<br />
|<br />
|as a default Teneo will only use model annotations with a source equal to teneo.jpa (see [[Teneo/Hibernate/ModelRelational/Annotations_Format|here]]). This option allows you to specify extra annotation sources which are considered. This makes it possible to work with different [[Teneo/Hibernate/ModelRelational/Annotations_Format#Multiple_sets_of_annotations_in_one_model|annotation sets]] in your model and disable or enable them (using this option) when required.<br />
|-<br />
|'''teneo.mapping.extra_annotations_overrides_default'''<br />
|<br />
|Default is false, if true will consider the extra annotation source(s) as overriding the default annotations, so if a model element has an annotation with a source specified in the extra_annotation_sources then the eannotations with the default sources is not used.<br />
|-<br />
|'''teneo.mapping.featuremap_as_component'''<br />
|false<br />
|if set to "true" will map a feature map entry as a Hibernate component without its own id. If set to false then a feature map entry will be mapped as a separate entity.<br />
|-<br />
|'''teneo.mapping.fetch_containment_eagerly'''<br />
|false<br />
|if set to "true" will set the fetch strategy of all containment references to EAGER. This means that containment relations are completely read in memory. Default is "false".<br />
|-<br />
|'''teneo.mapping.fetch_one_to_many_extra_lazy'''<br />
|false<br />
|if set to "true" will set all associations to be extra-lazy, this means that for common collection operations the list is not loaded completely in memory but separate calls to the database are done. For more information see [[Teneo/Hibernate/Collection_Extra-Lazy_Loading|this]] wiki page.<br />
|-<br />
|'''teneo.runtime.handle_unset_as_null'''<br />
|false in Teneo, true in the CDO Hibernate Store<br />
|if false then always the value of the EAttribute is stored eventhough the EAttribute is not set (unset==true), reading an object from the database will always set the value if it has a default. If true then if the EAttribute value is not set on an EObject then null is set in the database and when reading the object from the database the EAttribute remains not-set.<br />
|-<br />
|'''teneo.naming.id_feature_as_primary_key'''<br />
|true<br />
|as a default eattributes with ID=true will be denoted as the primary key of the eclass. If this feature''' (default is true) is set to false then this default behavior is disabled.<br />
|-<br />
|'''teneo.mapping.ignore_eannotations'''<br />
|false<br />
|Ignore mapping EAnnotations. Primarily meant for test cases that use Persistence XML mapping, so that they can reuse the same sample models.<br />
|-<br />
|'''teneo.mapping.inheritance'''<br />
|SINGLE_TABLE<br />
|the default inheritance mapping strategy to use, this can be JOINED or SINGLE_TABLE, see [[Teneo/Hibernate/ModelRelational/Inheritance_Mapping|here]] for more information.<br />
|-<br />
|'''teneo.mapping.join_table_for_non_contained_associations'''<br />
|true<br />
|boolean, if set to true then always a join table is created for one-to-many non-contained associations.<br />
|-<br />
|'''teneo.mapping.map_all_lists_as_idbag'''<br />
|false<br />
|the Hibernate idbag maps a list as a very efficient bag in which each list entry gets an id. This makes it possible to update the list very efficiently. This option allows you to force Teneo to use the idbag for all lists. Note that if you specified a manual OneToMany annotation on an EReference then for that EReference no IdBag annotation is added. Also it makes sense to combine this option with setting the option JOIN_TABLE_FOR_NON_CONTAINED_ASSOCIATIONS to true also. Note, there is an issue with Derby and IDBAG, see [[Teneo/Hibernate/FAQ#Derby_and_Hibernate_IDBag|here]].<br />
|-<br />
|'''teneo.mapping.map_document_root'''<br />
|false<br />
|the option controls if Teneo should support persisting the very generic DocumentRoot EClass which is generated when EMF encounters global elements which are not complex types.<br />
|-<br />
|'''teneo.mapping.map_embeddable_as_embedded'''<br />
|false<br />
|if set to true then an EReference to an EClass which is annotated with @Embeddable will automatically be annotated with @Embedded. If false (the default) then an EReference to an embeddable EClass needs to be manually annotated with @Embedded.<br />
|-<br />
|'''teneo.mapping.mapping_file_name'''<br />
|<br />
|with this option you can specify one or more comma-delimited resource paths (incl. filename) to a mapping file. Instead of generating a mapping Teneo will then use the mapping file found through this path.<br />
|-<br />
|'''teneo.mapping.force_lazy'''<br />
|false<br />
|will set lazy="true" on an entity without setting the proxy attribute, hibernate will use the implementation class itself as the proxy class. When setting this option then the set_proxy option should not be used.<br />
|-<br />
|'''teneo.mapping.max_comment_length'''<br />
|0<br />
|comments in the model can be copied to the mapping file. This option sets the maximum length of these comments, the default specifies the maximum length with this option you can specify a resource path (incl. filename) to a mapping file. Instead of generating a mapping Teneo will then use the mapping file found through this path.<br />
|-<br />
|'''teneo.mapping.optimistic_locking'''<br />
|true<br />
|if this property is "false" then no version properties are added to the mapping of EClasses.<br />
|-<br />
|'''teneo.mapping.persistence_xml'''<br />
|<br />
|the location of the xml annotations file. The location should be a resource path.<br />
|-<br />
|'''teneo.mapping.set_entity_automatically'''<br />
|true<br />
|if set to "false" then only EClasses which have an Entity annotation will be mapped. Default is "true", this means that all EClasses are mapped to the persistent store.<br />
|-<br />
|'''teneo.mapping.set_generated_value_on_id_feature'''<br />
|true<br />
|only applies if ID_FEATURE_AS_PRIMARY_KEY is true (which is the default). This option forces Teneo to also add a generator tag (with class="native") to the id tag. This is only done for EAttributes which have ID="true" and only if ID_FEATURE_AS_PRIMARY_KEY is true and no manual @Id annotation was set on the EAttribute.<br />
|-<br />
|'''teneo.mapping.set_proxy'''<br />
|false<br />
|this option controls if Hibernate will use a cglib/javaassist proxy when loading objects for many-to-one/one-to-one relations. If set to true then Teneo will automatically add a @Proxy annotation to each type. In addition the fetch of the many-to-one and one-to-one is set to LAZY (if not set by the user). If this option is false then for individual types the @Proxy annotation can also be used (see the Hibernate annotation extensions).<br />
<br />
See also the force_lazy option above, when using the force_lazy option, the set_proxy option should not be set (it should be false).<br />
|-<br />
|'''teneo.mapping.hibernate_mapping_file'''<br />
|false<br />
|if set to "true" then Teneo will not do an automatic mapping of the ecore model to Hibernate but instead search for a hibernate.hbm.xml in the classpath of the EMF generated java classes.<br />
|}<br />
<br />
== System property: Identifier Cache Handling/Purging ==<br />
<br />
Teneo keeps an internal weak-reference map for caching id's and versions of objects. The map is purged for stale references every 60 seconds. You can control the interval by passing the following system property:<br />
'''org.eclipse.teneo.hibernate.identifierPurgingLogTimeThreshold''': interval in seconds by which purging should happen.<br />
<br />
== Options related to XSD Date handling==<br />
<br />
A number of options are related to handling a specific issue with the XMLGregorianCalendar implementation in different java-providers. See bugzilla [https://bugs.eclipse.org/bugs/show_bug.cgi?id=227673 227673]. <br />
<br />
The options are ''teneo.mapping.UserDateType'', ''teneo.mapping.UserDateTimeType'' and ''teneo.mapping.XSDDateClass''. <br />
<br />
The first two options define which usertype is used when generating the hibernate mapping for xsddate/xsddatetime types. The last option defines the actual class used for the date instance, the default is javax.xml.datatype.XMLGregorianCalendar.</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo&diff=378624Texo2015-02-18T19:08:17Z<p>Mtaal.springsite.com: /* Benefits of using Texo */</p>
<hr />
<div>==Introduction==<br />
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and full REST JSON web service functionality at runtime. <br />
<br />
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].<br />
<br />
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. <br />
<br />
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.<br />
<br />
<br />
[[Image:texo-client-server.png|center|600px]]<br />
<br />
== Benefits of using Texo ==<br />
<br />
Benefits of using current Texo (November 2012):<br />
* Code Generation:<br />
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore model or XSD''' without direct compile time link from generated entities to EMF, Texo or other framework types. '''Facilitates integration of EMF concepts with other frameworks''' such as Google Web Toolkit or Object Relational Mapping solutions<br />
** Supports '''manual change of generated code''' (the same approach as EMF)<br />
** '''[[Template_Overriding|Overridable and Extendable code generation]]''' with support for EMF-like merge, formatting, import-organizing<br />
<br />
* Provides a generic CRUD REST and Query web service layer for all your models, [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]<br />
<br />
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.<br />
<br />
* Supports most '''XML Schema constructs''' (as EMF)<br />
<br />
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.<br />
<br />
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation<br />
<br />
== Download & Install ==<br />
<br />
Texo is installed through the Eclipse update manager. For more details see the [[Texo/Download_and_Install|Download & Install]] page.<br />
<br />
== Quick Start ==<br />
<br />
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...<br />
<br />
== Documentation ==<br />
<br />
The following pages contain detailed information on different parts of the Texo solution. <br />
<br />
=== Blog ===<br />
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].<br />
<br />
=== Code generation topics ===<br />
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.<br />
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.<br />
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.<br />
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.<br />
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).<br />
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).<br />
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.<br />
<br />
=== ORM/JPA generation topics ===<br />
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.<br />
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.<br />
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.<br />
<br />
=== Runtime topics ===<br />
<br />
==== JPA/Persistence integration ====<br />
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.<br />
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality. <br />
* [[Texo/ObjectStore|Object Store concept]]: the object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.<br />
<br />
==== XML/JSON REST Web Service Support ====<br />
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]<br />
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]<br />
<br />
==== Framework ====<br />
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.<br />
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.<br />
<br />
==== RCP Persistence using EMF Resources and Texo ====<br />
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.<br />
<br />
==== EMF/XML/XMI ====<br />
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI. <br />
* [[Texo/Convert to EMF|EMF Conversion]]: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.<br />
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.<br />
<br />
==== Miscellaneous ====<br />
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.<br />
<br />
== Main Design Concepts ==<br />
<br />
The Texo project is based on a number of main design concepts and philosophies.<br />
* Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators. <br />
* Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api. <br />
* Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.<br />
<br />
For a more detailed description visit the [[Texo/Design%20Concepts|Design Concepts]] page.<br />
<br />
== Texo and EMF ==<br />
<br />
Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on [[Texo/Texo_and_EMF|this page]].<br />
<br />
== Support & Troubleshooting & Bugzilla ==<br />
<br />
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.<br />
<br />
To enter a new bugzilla you can use the following link:<br />
<br />
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.9.0<br />
<br />
Support is given on the EMFT newsgroup which you can find here:<br />
* nntp: news://news.eclipse.org/eclipse.technology.emft<br />
* forum: http://www.eclipse.org/forums/eclipse.technology.emft<br />
<br />
== Backward Compatibility ==<br />
<br />
Starting from the 0.9.0 version backward compatibility related topics will be published in this section.<br />
<br />
=== 0.9.0 - Version 28 December 2014 ===<br />
<br />
* This issue [https://bugs.eclipse.org/bugs/show_bug.cgi?id=420913 420913] is resolved. There is a property of the EPackage or EReference generation annotation which controls if [https://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29 bi-directional association] support is generated in the java code. This was not working correctly, in that to get this to be working also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved. Note bi-directional access is (and was) 'true'/enabled by default. This can mean that newly generated code (previously generated by a previous Texo version) will change as now the bi-directional property is correctly considered. To keep the old behavior, create an annotation model which sets generateBidirectionalAssociationSupport to false (see [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/tests/org.eclipse.emf.texo.modelgenerator.test/models/samples/extlibrary.annotationsmodel here] for an example, only the generateBidirectionalAssociationSupport part is relevant for this bullet).<br />
<br />
* The createModelObject method of the ModelFactory has been [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/commit/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/model/ModelFactory.java?id=31fb5c7415651646109f711634d0895053ecb0d0 changed] to return a parameterized ModelObject (ModelObject<T>) instead of earlier the ModelObject<?>. With this it is not needed anymore to cast the returned value from createModelObject.<br />
<br />
== Developing ==<br />
<br />
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.<br />
<br />
== Future Topics ==<br />
<br />
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:<br />
* Code/Artifact Generation:<br />
** Support JPA 2.1<br />
** Support Ecore/XCore generic types<br />
** Support Ecore/XCore operations<br />
** Support JAXB annotation generation<br />
** Add JPA/Texo annotation support in Xcore<br />
* Runtime Layer<br />
** Integrated with EMF Client Platform<br />
** Introduce service oriented architecture concepts, focusing on micro-service architectures<br />
** support for no-sql databases on the server side<br />
** integrate with OLAP/Mondrian solutions, back-end and front-end<br />
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box<br />
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF<br />
** use this generic model editor as a basis for a generated model editor in html5/mobile<br />
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor<br />
<br />
Feel free to react on the EMFT newsgroup with more ideas.<br />
<br />
== See also ==<br />
<br />
* [[Teneo]]<br />
* [[CDO]]<br />
<br />
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo&diff=378623Texo2015-02-18T19:07:57Z<p>Mtaal.springsite.com: /* Benefits of using Texo */</p>
<hr />
<div>==Introduction==<br />
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and full REST JSON web service functionality at runtime. <br />
<br />
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].<br />
<br />
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. <br />
<br />
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.<br />
<br />
<br />
[[Image:texo-client-server.png|center|600px]]<br />
<br />
== Benefits of using Texo ==<br />
<br />
Benefits of using current Texo (November 2012):<br />
* Code Generation:<br />
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore model or XSD''' without direct compile time link from generated entities to EMF, Texo or other framework types. '''Facilitates integration of EMF concepts with other frameworks''' such as Google Web Toolkit or Object Relational Mapping solutions<br />
** Supports '''manual change of generated code''' (the same approach as EMF)<br />
** '''[[Template_Overriding|Overridable and Extendable code generation]]''' with support for EMF-like merge, formatting, import-organizing<br />
<br />
* Provides a generic CRUD REST and Query web service layer for all your models, [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]<br />
<br />
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.<br />
<br />
* Supports most '''XML Schema constructs''' (as EMF)<br />
<br />
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.<br />
<br />
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation<br />
<br />
New functionality which is being developed right now gives these additional benefits:<br />
* '''Multiple annotation models''' (JPA, Hibernate Search, etc.) supported<br />
* '''Generic RIA/HTML5 model maintenance UI''' <br />
<br />
These developments will give additional benefits in terms of increased developer productiviy and quality.<br />
<br />
== Download & Install ==<br />
<br />
Texo is installed through the Eclipse update manager. For more details see the [[Texo/Download_and_Install|Download & Install]] page.<br />
<br />
== Quick Start ==<br />
<br />
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...<br />
<br />
== Documentation ==<br />
<br />
The following pages contain detailed information on different parts of the Texo solution. <br />
<br />
=== Blog ===<br />
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].<br />
<br />
=== Code generation topics ===<br />
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.<br />
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.<br />
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.<br />
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.<br />
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).<br />
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).<br />
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.<br />
<br />
=== ORM/JPA generation topics ===<br />
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.<br />
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.<br />
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.<br />
<br />
=== Runtime topics ===<br />
<br />
==== JPA/Persistence integration ====<br />
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.<br />
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality. <br />
* [[Texo/ObjectStore|Object Store concept]]: the object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.<br />
<br />
==== XML/JSON REST Web Service Support ====<br />
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]<br />
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]<br />
<br />
==== Framework ====<br />
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.<br />
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.<br />
<br />
==== RCP Persistence using EMF Resources and Texo ====<br />
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.<br />
<br />
==== EMF/XML/XMI ====<br />
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI. <br />
* [[Texo/Convert to EMF|EMF Conversion]]: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.<br />
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.<br />
<br />
==== Miscellaneous ====<br />
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.<br />
<br />
== Main Design Concepts ==<br />
<br />
The Texo project is based on a number of main design concepts and philosophies.<br />
* Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators. <br />
* Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api. <br />
* Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.<br />
<br />
For a more detailed description visit the [[Texo/Design%20Concepts|Design Concepts]] page.<br />
<br />
== Texo and EMF ==<br />
<br />
Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on [[Texo/Texo_and_EMF|this page]].<br />
<br />
== Support & Troubleshooting & Bugzilla ==<br />
<br />
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.<br />
<br />
To enter a new bugzilla you can use the following link:<br />
<br />
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.9.0<br />
<br />
Support is given on the EMFT newsgroup which you can find here:<br />
* nntp: news://news.eclipse.org/eclipse.technology.emft<br />
* forum: http://www.eclipse.org/forums/eclipse.technology.emft<br />
<br />
== Backward Compatibility ==<br />
<br />
Starting from the 0.9.0 version backward compatibility related topics will be published in this section.<br />
<br />
=== 0.9.0 - Version 28 December 2014 ===<br />
<br />
* This issue [https://bugs.eclipse.org/bugs/show_bug.cgi?id=420913 420913] is resolved. There is a property of the EPackage or EReference generation annotation which controls if [https://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29 bi-directional association] support is generated in the java code. This was not working correctly, in that to get this to be working also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved. Note bi-directional access is (and was) 'true'/enabled by default. This can mean that newly generated code (previously generated by a previous Texo version) will change as now the bi-directional property is correctly considered. To keep the old behavior, create an annotation model which sets generateBidirectionalAssociationSupport to false (see [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/tests/org.eclipse.emf.texo.modelgenerator.test/models/samples/extlibrary.annotationsmodel here] for an example, only the generateBidirectionalAssociationSupport part is relevant for this bullet).<br />
<br />
* The createModelObject method of the ModelFactory has been [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/commit/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/model/ModelFactory.java?id=31fb5c7415651646109f711634d0895053ecb0d0 changed] to return a parameterized ModelObject (ModelObject<T>) instead of earlier the ModelObject<?>. With this it is not needed anymore to cast the returned value from createModelObject.<br />
<br />
== Developing ==<br />
<br />
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.<br />
<br />
== Future Topics ==<br />
<br />
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:<br />
* Code/Artifact Generation:<br />
** Support JPA 2.1<br />
** Support Ecore/XCore generic types<br />
** Support Ecore/XCore operations<br />
** Support JAXB annotation generation<br />
** Add JPA/Texo annotation support in Xcore<br />
* Runtime Layer<br />
** Integrated with EMF Client Platform<br />
** Introduce service oriented architecture concepts, focusing on micro-service architectures<br />
** support for no-sql databases on the server side<br />
** integrate with OLAP/Mondrian solutions, back-end and front-end<br />
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box<br />
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF<br />
** use this generic model editor as a basis for a generated model editor in html5/mobile<br />
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor<br />
<br />
Feel free to react on the EMFT newsgroup with more ideas.<br />
<br />
== See also ==<br />
<br />
* [[Teneo]]<br />
* [[CDO]]<br />
<br />
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo&diff=378622Texo2015-02-18T19:07:20Z<p>Mtaal.springsite.com: /* Introduction */</p>
<hr />
<div>==Introduction==<br />
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and full REST JSON web service functionality at runtime. <br />
<br />
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].<br />
<br />
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. <br />
<br />
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.<br />
<br />
<br />
[[Image:texo-client-server.png|center|600px]]<br />
<br />
== Benefits of using Texo ==<br />
<br />
Benefits of using current Texo (November 2012):<br />
* Code Generation:<br />
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore model or XSD''' without direct compile time link from generated entities to EMF, Texo or other framework types. '''Facilitates integration of EMF concepts with other frameworks''' such as Google Web Toolkit or Object Relational Mapping solutions<br />
** Supports '''manual change of generated code''' (the same approach as EMF)<br />
** '''[[Template_Overriding|Overridable and Extendable code generation]]''' with support for EMF-like merge, formatting, import-organizing<br />
<br />
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.<br />
<br />
* Supports most '''XML Schema constructs''' (as EMF)<br />
<br />
* Generic CRUD and Query web service layer: [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]<br />
<br />
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.<br />
<br />
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation<br />
<br />
New functionality which is being developed right now gives these additional benefits:<br />
* '''Multiple annotation models''' (JPA, Hibernate Search, etc.) supported<br />
* '''Generic RIA/HTML5 model maintenance UI''' <br />
<br />
These developments will give additional benefits in terms of increased developer productiviy and quality.<br />
<br />
== Download & Install ==<br />
<br />
Texo is installed through the Eclipse update manager. For more details see the [[Texo/Download_and_Install|Download & Install]] page.<br />
<br />
== Quick Start ==<br />
<br />
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...<br />
<br />
== Documentation ==<br />
<br />
The following pages contain detailed information on different parts of the Texo solution. <br />
<br />
=== Blog ===<br />
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].<br />
<br />
=== Code generation topics ===<br />
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.<br />
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.<br />
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.<br />
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.<br />
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).<br />
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).<br />
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.<br />
<br />
=== ORM/JPA generation topics ===<br />
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.<br />
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.<br />
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.<br />
<br />
=== Runtime topics ===<br />
<br />
==== JPA/Persistence integration ====<br />
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.<br />
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality. <br />
* [[Texo/ObjectStore|Object Store concept]]: the object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.<br />
<br />
==== XML/JSON REST Web Service Support ====<br />
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]<br />
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]<br />
<br />
==== Framework ====<br />
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.<br />
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.<br />
<br />
==== RCP Persistence using EMF Resources and Texo ====<br />
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.<br />
<br />
==== EMF/XML/XMI ====<br />
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI. <br />
* [[Texo/Convert to EMF|EMF Conversion]]: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.<br />
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.<br />
<br />
==== Miscellaneous ====<br />
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.<br />
<br />
== Main Design Concepts ==<br />
<br />
The Texo project is based on a number of main design concepts and philosophies.<br />
* Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators. <br />
* Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api. <br />
* Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.<br />
<br />
For a more detailed description visit the [[Texo/Design%20Concepts|Design Concepts]] page.<br />
<br />
== Texo and EMF ==<br />
<br />
Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on [[Texo/Texo_and_EMF|this page]].<br />
<br />
== Support & Troubleshooting & Bugzilla ==<br />
<br />
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.<br />
<br />
To enter a new bugzilla you can use the following link:<br />
<br />
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.9.0<br />
<br />
Support is given on the EMFT newsgroup which you can find here:<br />
* nntp: news://news.eclipse.org/eclipse.technology.emft<br />
* forum: http://www.eclipse.org/forums/eclipse.technology.emft<br />
<br />
== Backward Compatibility ==<br />
<br />
Starting from the 0.9.0 version backward compatibility related topics will be published in this section.<br />
<br />
=== 0.9.0 - Version 28 December 2014 ===<br />
<br />
* This issue [https://bugs.eclipse.org/bugs/show_bug.cgi?id=420913 420913] is resolved. There is a property of the EPackage or EReference generation annotation which controls if [https://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29 bi-directional association] support is generated in the java code. This was not working correctly, in that to get this to be working also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved. Note bi-directional access is (and was) 'true'/enabled by default. This can mean that newly generated code (previously generated by a previous Texo version) will change as now the bi-directional property is correctly considered. To keep the old behavior, create an annotation model which sets generateBidirectionalAssociationSupport to false (see [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/tests/org.eclipse.emf.texo.modelgenerator.test/models/samples/extlibrary.annotationsmodel here] for an example, only the generateBidirectionalAssociationSupport part is relevant for this bullet).<br />
<br />
* The createModelObject method of the ModelFactory has been [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/commit/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/model/ModelFactory.java?id=31fb5c7415651646109f711634d0895053ecb0d0 changed] to return a parameterized ModelObject (ModelObject<T>) instead of earlier the ModelObject<?>. With this it is not needed anymore to cast the returned value from createModelObject.<br />
<br />
== Developing ==<br />
<br />
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.<br />
<br />
== Future Topics ==<br />
<br />
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:<br />
* Code/Artifact Generation:<br />
** Support JPA 2.1<br />
** Support Ecore/XCore generic types<br />
** Support Ecore/XCore operations<br />
** Support JAXB annotation generation<br />
** Add JPA/Texo annotation support in Xcore<br />
* Runtime Layer<br />
** Integrated with EMF Client Platform<br />
** Introduce service oriented architecture concepts, focusing on micro-service architectures<br />
** support for no-sql databases on the server side<br />
** integrate with OLAP/Mondrian solutions, back-end and front-end<br />
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box<br />
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF<br />
** use this generic model editor as a basis for a generated model editor in html5/mobile<br />
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor<br />
<br />
Feel free to react on the EMFT newsgroup with more ideas.<br />
<br />
== See also ==<br />
<br />
* [[Teneo]]<br />
* [[CDO]]<br />
<br />
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo/Hibernate/FAQ&diff=376636Teneo/Hibernate/FAQ2015-01-18T12:31:31Z<p>Mtaal.springsite.com: /* org.hibernate.DuplicateMappingException: Duplicate class/entitymapping */</p>
<hr />
<div>__TOC__<br />
<br />
===Lazy loading (Hibernate Proxying) of many-to-one does not work===<br />
To get lazy loading of many-to-one associations working you have to set the option: [[Teneo/Hibernate/Configuration_Options|SET_PROXY]] to "true". <br />
<br />
Also you need to have 'resolve proxies' to false in your model for the association, otherwise EMF will force a load by calling several methods on the proxied object.<br />
<br />
===Mapping Exception Unknown Entity===<br />
This exception is thrown when building the EntityManagerFactory. The entityPersistors in the Hibernate session are all keyed by the mapping's entity-name. In Teneo/EMF's case, the eClass name is the key, but Hibernate tries to use the impl class name as the key. <br />
<br />
See [http://www.eclipse.org/forums/index.php?t=tree&th=168644&#page_top this post] on the forum. <br />
<br />
See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=241537 this bugzilla] for a workaround. Or try setting the following hibernate property:<br />
hibernate.ejb.metamodel.generation=disabled<br />
<br />
===Derby and Hibernate IDBag===<br />
Apparently the Hibernate Derby driver does not handle Hibernate idbags correctly. See this link [http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg37757.html here] for more information.<br />
<br />
===DB Schema constraint error using MS Sql===<br />
Teneo generates the names of foreign key constraints. MS Sql reports errors if the FK constraint name are the same as table names. See this post on the EMF newsgroup. The solution is to set the option: PersistenceOptions.SET_FOREIGN_KEY_NAME to "false".<br />
<br />
===Duplicate method exception with javaassist===<br />
This exception occurs when using the same EStructuralFeature name in different EClasses related through the same super EClass. There can also be other cases where this occurs.<br />
<br />
This seems to be a javaassist issue.<br />
<br />
At this point the solution is to use cglib instead of javassist. See this 292151 bugzilla for more information.<br />
<br />
===File Not Found Exception for a file called: document-v13.dtd===<br />
This exception occurs when initializing a datastore.<br />
<br />
It can happen when you have a xml file for annotations which contains illegal entities or entities which can not be resolved. For example . Check your annotations.xml and try again.<br />
<br />
Another reason why it can happen is that you have a DOCTYPE tag in the top of the xml:<br />
<br />
<source lang="xml"><br />
<!DOCTYPE persistence-mapping PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "document-v13.dtd"><br />
</source><br />
<br />
===Issue: too many tables in join sql statement===<br />
When there are many associations in a model then it is possible that you encounter a 'too many tables' exception when executing a query in hibernate. A possible workaround is to control the default fetch behavior of hibernate. For example the hibernate.max_fetch_depth option can be set to a lower value (its default is 3). See also the section: 19.1. Fetching strategies, in the hibernate manual.<br />
<br />
===Unknown Entity===<br />
This exception can occur when you try to use the getReference or get methods on the EntityManager/Session objects and you call these methods using the Interface class name or the Implementation clas name. To solve this Teneo has a special entity naming strategy: EntityInterfaceNameStrategy. This entity naming strategy will use the interface name as the entity-name. You can set this naming strategy through this call: yourDataStore.getExtensionManager().registerExtension(EntityNameStrategy.class.getName(), EntityInterfaceNameStrategy.class.getName()). This call should be done after the datastore was created but before it is initialized.<br />
<br />
<source lang="java"><br />
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1<br />
</source><br />
<br />
This exception can occur when using synthetic id's in combination with the creation of multiple session factories. For example when doing test runs with a database clean up between the test run. The exception occurs because the Idenfifier Cache, which is used by Teneo to handle synthetic id's, is not in-sync with the database.<br />
<br />
To solve this you have to clear the Identifier cache by calling: IdentifierCacheHandler.clear();<br />
<br />
===Troubleshooting the Mapping and Runtime layer/Hibernate===<br />
The runtime layer uses commons-logging for logging. Here you can find an example [[media:Teneo.log4j.properties.zip|log4j.properties]] file. This file should be placed directly in the src directory of your EMF Model project. Note: also check if Eclipse copies the file to your bin/build directory. For a plugin project this can be specified in the build.properties.<br />
<br />
The example log4j.properties also contains log4j settings for Hibernate.<br />
<br />
If you use the runtime layer within a plugin then log messages will not appear in the console. In this case check the error log view (Window > Show View > Error Log) or let the log messages be written to a file.<br />
<br />
===Troubleshooting the automatic in-memory mapping===<br />
The mapping is generated in memory. To view the mapping created by Teneo please call the method getMappingXML on the HbDataStore. The returned String contains the Hibernate mapping.<br />
<br />
===Troubleshooting the OR Mapper Menu Option===<br />
If an error popup is shown or no popup box appears after the OR Mapper plugin is finished then an application error has occured within the OR Mapper.<br />
<br />
When the console shows this exception: Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/emf/teneo/hibernate/mapper/GenerateHBM then you have not added the org.eclipse.emf.teneo.hibernate plugin to the dependencies of the model plugin.<br />
<br />
See also this forum post: https://www.eclipse.org/forums/index.php/t/315151/<br />
<br />
To analyze what the problem is first view the error log. The error log can be opened through: Window > Show View > Error Log. By doubleclicking on the lines in the error log you can get more information.<br />
<br />
===More debug information from Eclipse===<br />
As an extra debug enabling you can add the following line in the EMF editor plugin:<br />
<br />
org.eclipse.osgi.framework.debug.Debug.DEBUG_GENERAL = true;<br />
<br />
This will result in much more debugging information in the console.<br />
<br />
===Cut and Paste does not work in the Editor===<br />
Please look [[Teneo/Hibernate/EMF_Hibernate_Integration_Details#Move_an_EObject_between_EContainers_or_support_cut_and_paste_in_the_EMF_editor|here]].<br />
<br />
===Client-server scenario: when saving on the server always new objects are created or I get a duplicate key exception===<br />
What can be the case is that you did not explicitly model an id and/or version attribute in each type. Both are required to be modeled explicitly, see [[Teneo/Hibernate/Configuration_Options|here]].<br />
<br />
===Column name e_version not supported by database===<br />
Teneo will automatically add a version column to the database for each object. The default version column name is e_version. However not all databases support an _ in the column name. To set the version column name you can set an option as explained [[Teneo/Hibernate/Configuration_Options|here]].<br />
<br />
===Column names too long===<br />
Teneo creates foreign key column names by concatenating the name of the (e)class and the property name. The result can be a column name which is too long for certain databases. You can control the maximum column name length by setting the relevant runtime option, see [[Teneo/Hibernate/Configuration_Options|here]].<br />
<br />
===org.hibernate.DuplicateMappingException: Duplicate class/entitymapping===<br />
This exception occurs when two EClasses (of different EPackages) have the same name. To solve this you need to direct Teneo to use qualified EClass names, see [[Teneo/Hibernate/Extensions#EntityNameStrategy_ExtensionPoint_.28org.eclipse.emf.teneo.mapping.strategy.EntityNameStrategy.29|here]]. Note that when using qualified EClass names that also HQL needs to use the qualified EClass names. The EClass names are qualified by prepending the nsprefix of the EPackage with a dot (.) as a separator.<br />
<br />
===Created new model through new model wizard: diagnostic error===<br />
The generated EMF model wizard allows invalid documents. When going through the wizard you need to select a type to create as the first document in the resource. The EMF model wizard creates an empty (all members are null) instance of this type and adds it to the Hibernate resource. Before the Hibernate resource is saved it checks if the content of the resource is valid. When nullable-constraints are violated a StoreValidationException (with Diagnostics) is thrown.<br />
<br />
To solve this you should make your model more relaxed (make elements nullable) or add a small amount of code, which sets the non-nullable fields, to the model wizard. An example of this last solution is illustrated in the [[Teneo/Hibernate/Library_Tutorial|Tutorial]].<br />
<br />
===java.lang.NoClassDefFoundError when starting/initializing runtime layer===<br />
When your model is divided over different projects/plugins then the dependency on org.eclipse.emf.teneo.hibernate has to be set in the project with the 'widest' classpath (the project with a classpath containing the other plugins). For example if you have the following two emf projects:<br />
* Core<br />
* Specific (which uses/imports Core)<br />
<br />
Then the dependency should preferably be in the META-INF of the 'Specific' project. This is required otherwise Hibernate will not see the 'Specific' project.<br />
<br />
===No class def found: org.hibernate.proxy.ProxyFactory===<br />
This exception can occur when your classes have been enhanced by JPOX and you try to persist them via hibernate. Another reason can be that the name you used to register the SessionFactory does not correspond to the expected extension (e.g. library).<br />
<br />
===Could not determine type for: org.eclipse.emf.common.util.AbstractEnumerator, for columns: [org.hibernate.mapping.Column(enu)]===<br />
This exception can occur when you have a enumerate object type in your model. An enumerate object type differs from a standard enumerate because it has a nillable="true" attribute on the element, for example:<br />
<br />
<source lang="xml"><br />
<element name="enu" type="this:SimpleEnum" nillable="true"/><br />
<br />
<simpleType name="SimpleEnum"><br />
<restriction base="xsd:NCName"><br />
<enumeration value="Enum1"/><br />
<enumeration value="Enum2"/><br />
</restriction><br />
</simpleType><br />
</source><br />
<br />
As a workaround add an Enumerated annotation (see ejb3 annotations on this site) to the element.<br />
<br />
===The resource is empty in the generated editor===<br />
The standard behavior of a Hibernate resource is to only read types which have no container in the model. All other EObjects can be reached from these top-entities. However, this means that even if an EObject instance does not have a container but can be contained according to the model then it will still not be loaded in the resource. A common model is a an object which contains itself, for example a folder-like model. Workaround: to workaround this issue you should load the resource using specific queries, see [[Teneo/Hibernate/EMF_Resource|customizing load behavior]].<br />
<br />
===Update manager does not find the upgrade of the EMF Hibernate plugin===<br />
As a workaround use find new features to install a new version of the EMF Hibernate plugin.<br />
<br />
===Editor does not start, the error log gives a sql error 'Missing column....'===<br />
This can occur if your model has changed or you just upgraded the OR Mapper plugin and have generated a new hibernate.hbm.xml file. Before upgrading it is best to export the current database (see the relevant methods in the data store). After exporting start with a new database and re-import the data (through the relevant methods in the datastore).<br />
<br />
===Editor does not start, ClassNotFoundException on the Editor Plugin===<br />
This can happen when the Hibernate libraries can not find the model classes. You can check if you have set the BuddyPolicy in the Manifest.MF of the plugin containing the Hibernate jar files. If not add the following to the Manifest.MF of the plugin containing the Hibernate jar files: <br />
Eclipse-BuddyPolicy: dependent<br />
<br />
===Editor does not start, AssertionFailedException===<br />
When you start the editor you get the following exteption (stacktrace truncated):<br />
<br />
<source lang="java"><br />
org.eclipse.core.runtime.AssertionFailedException: assertion failed: <br />
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)<br />
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)<br />
at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:688)<br />
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:280) <br />
</source><br />
<br />
You probably started the editor with an empty database, the editor does not support this. You should have at least one root object in the database (for example a Library object in the Library tutorial).<br />
<br />
===Properties are not editable with EMF generated property editor===<br />
If you store the .ehb file within the plugin and open the EMF editor using different urls there are situations that the editor opens in read-only mode.<br />
<br />
If the url is opened as follows: FileLocator.find(Activator.getDefault().getBundle(), new Path("myfile.ehb"), null). Then the property editor does not allow any modifications.<br />
<br />
If however, the editor is opened using a 'file:/' based URL (file://myfile.ehb), then the EMF property editor works as expected.<br />
<br />
The first situation can be solved by creating a class similar to this one:<br />
<br />
<source lang="java"><br />
public class CustomAdapterFactoryEditingDomain extends<br />
AdapterFactoryEditingDomain {<br />
public CustomAdapterFactoryEditingDomain(AdapterFactory adapterFactory,<br />
CommandStack commandStack,<br />
Map<Resource, Boolean> resourceToReadOnlyMap) {<br />
super(adapterFactory, commandStack, resourceToReadOnlyMap);<br />
}<br />
<br />
@Override<br />
protected boolean isReadOnlyURI(URI uri) {<br />
return super.isReadOnlyURI(uri)<br />
&& !uri.fileExtension().equals("ehb");<br />
}<br />
}<br />
</source><br />
<br />
And using an instance of this class as the editingDomain in the initializeEditingDomain() method of the EMF generated XXXEditor class:<br />
<br />
<source lang="java"><br />
protected void initializeEditingDomain() {<br />
.........<br />
.........<br />
editingDomain = new CustomAdapterFactoryEditingDomain(adapterFactory,<br />
commandStack, new HashMap<Resource, Boolean>());<br />
}<br />
</source><br />
<br />
Reported and solution by Florian Hackenberger.<br />
<br />
===Validation exception on enumerate properties when saving the editor content===<br />
Symptom: a validation error is thrown (see the console) that certain enumerate fields have not been set.<br />
<br />
Cause: the EMF validator incorrectly enforces that the value of an enumerate field should not be the same as the default value.<br />
<br />
Solution: is an EMF issue which has been solved (see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=104723 here]). Upgrading EMF to a 2.2 or a later 2.1 release solves this.<br />
<br />
===Stacktraces when starting Eclipse with already open EMF editor===<br />
Symptom: This occurs when keeping an EMF generated editor open when closing eclipse and then starting eclipse again. When starting Eclipse again you see many stack traces in the console with messages like: class not found exception: org/hibernate/proxy/proxy.<br />
<br />
Consequence: The editor will open correctly and can be used. The only 'consequence' is that the data is not lazily loaded.<br />
<br />
Solution: A solution has been implemented in release 0.2.0.1.<br />
<br />
===Teneo does not see my changes in the ecore model===<br />
Teneo uses the runtime version of the ecore model. The runtime version is present as java code in the generated EPackage implementation class. This runtime ecore can differ from the ecore file when the model code is not regenerated after a change in the ecore file. To let Teneo use the changes in the ecore file the model code needs to be regenerated.<br />
<br />
===JoinTable name clash===<br />
If you have two EReferences between two EClasses then it is possible that you will get a jointable name clash. To prevent this set the PersistenceOptions.JOIN_TABLE_NAMING_STRATEGY to unique (see [[Teneo/Hibernate/Configuration_Options|here]]).</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo/Hibernate/Download_and_Install&diff=375897Teneo/Hibernate/Download and Install2015-01-06T21:29:51Z<p>Mtaal.springsite.com: /* Usage in Eclipse/OSGI: download and install using the update manager */</p>
<hr />
<div>__TOC__<br />
<br />
<br />
The installation method for Teneo depends on the target environment(Eclipse/OSGI or web container). Both cases are discussed on this page. This page also describes where to find the example projects used in the tutorials in the wiki. <br />
<br />
== Dependencies ==<br />
<br />
To run Teneo you need the following software:<br />
* EMF <br />
* Hibernate<br />
* JDBC driver<br />
<br />
Some dependencies can not be downloaded from eclipse.org because of licensing differences. Teneo provide update sites with the required dependencies (see below for the correct update site depending on your version).<br />
<br />
== Usage in Eclipse/OSGI: download and install using the update manager ==<br />
<br />
=== Plugins and dependencies, update site locations ===<br />
<br />
Teneo is delivered in the following versions:<br />
<br />
* '''2.0.0: EMF 2.7-2.8-2.9/Eclipse 3.7-3.8-4.2-4.3/Hibernate 4.1/JPA 2.0:'''<br />
** Teneo: http://download.eclipse.org/modeling/emf/teneo/updates/2.0.0/interim/<br />
** EMF: http://download.eclipse.org/releases/kepler<br />
** Hibernate and other dependencies: http://www.elver.org/eclipse/2.0.0/update<br />
<br />
* '''2.1.0: EMF 2.10/Eclipse 4.4/Hibernate 4.3.*/JPA 2.0:'''<br />
** Teneo: http://download.eclipse.org/modeling/emf/teneo/updates/2.1.0/interim/<br />
** EMF: http://download.eclipse.org/releases/luna<br />
** Hibernate and other dependencies: http://www.elver.org/eclipse/2.1.0/update<br />
<br />
'''The following update sites are no longer available''':<br />
** http://www.elver.org/eclipse/1.2.0/update<br />
** http://www.elver.org/eclipse/1.1.2/update<br />
<br />
'''Note: update site urls in the screenshots below maybe outdated, use the update site urls listed above.'''<br />
<br />
The EMF update site, select the EMF/XSD SDK:<br />
<br />
[[Image:org.eclipse.emf.teneo.install_emf.png|center|600px]]<br />
<br />
<br />
The Teneo update site will look similar to this image. Select the Teneo Hibernate SDK:<br />
<br />
<br />
[[Image:org.eclipse.emf.teneo.update.site.png|center|700px]]<br />
<br />
<br />
The elver update site lists the Hibernate, dom4j and a number of JDBC plugins. Select the followings, plus some connectors, depending on your needs :<br />
<br />
<br />
[[Image:org.eclipse.emf.teneo.install_dependency.png|center]]<br />
<br />
=== Creating your own Hibernate plugin ===<br />
<br />
If you want to make your own Hibernate/library plugin there is one specific setting which needs to be set in your plugin: make sure to add the following line to the MANIFEST.MF of the Hibernate/libraries plugin you create:<br />
<br />
'''Eclipse-BuddyPolicy: dependent'''<br />
<br />
This is required otherwise the Hibernate libraries can not find your model classes when performing runtime class enhancement. See [http://manuelselva.wordpress.com/2008/04/03/eclipse-and-hibernate-and-class-loaders/ here] for more information. Note that also other Eclipse-BuddyPolicy settings can be used (and can make sense in production environments) but the 'dependent' setting is the safest one.<br />
<br />
=== Teneo, import-packages and ClassNotFoundException when running junit testcases ===<br />
<br />
The Teneo and Hibernate plugins declare dependencies using import-packages. When running junit testcases as normal Java applications or standard junit tests then there is no OSGI environment which takes care of resolving these import-packages. This means that the import-package dependencies are not resolved and ClassNotFoundExceptions are thrown. <br />
<br />
This can be solved by explicitly declaring the dependency in the MANIFEST.MF of your test or model project. As an example: these are the dependendencies set in the examples project:<br />
<source lang="javascript"><br />
Require-Bundle: org.eclipse.core.runtime,<br />
org.eclipse.emf.ecore;visibility:=reexport,<br />
org.eclipse.emf.ecore.xmi;visibility:=reexport,<br />
org.eclipse.emf.teneo.hibernate;bundle-version="1.1.2",<br />
org.hibernate;bundle-version="3.3.2",<br />
org.eclipse.emf.ecore.change,<br />
org.apache.commons.logging,<br />
org.dom4j,<br />
org.hsqldb,<br />
com.mysql.jdbc<br />
</source><br />
<br />
== Usage in a Web Container - Maven ==<br />
<br />
For usage within a web container the following jar files are required. You can download these files from the plugins section on the [http://download.eclipse.org/modeling/emf/teneo/updates/1.2.0/interim/ update site] using your web browser, or you can use Maven (see below):<br />
<br />
=== Jars and Dependencies ===<br />
<br />
* '''Teneo jar files''':<br />
** org.eclipse.emf.teneo<br />
** org.eclipse.emf.teneo.annotations<br />
** org.eclipse.emf.teneo.hibernate<br />
** org.eclipse.emf.teneo.hibernate.mapper<br />
<br />
* '''EMF jar files''':<br />
** org.eclipse.emf.ecore<br />
** org.eclipse.emf.common<br />
** org.eclipse.emf.ecore.xmi<br />
<br />
* '''Dependencies''': Teneo depends on the [http://www.hibernate.org hibernate] and [http://commons.apache.org/logging/ commons-logging] jars (and a jdbc jar). You can find them in maven central or you can download directly from their respective websites.<br />
<br />
=== Maven ===<br />
<br />
Teneo and related EMF jar files are published in [http://search.maven.org/#search%7Cga%7C1%7Corg.eclipse.emf.teneo central maven] and in the [https://oss.sonatype.org/content/repositories/releases/org/eclipse/emf/ sonatype-snapshot] repository. All of them are published in the [http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.eclipse.emf%22 org.eclipse.emf] group.<br />
<br />
'''The Teneo pom files do not define explicit dependencies. This means that your pom files should list the EMF, commons-logging and hibernate jar file as dependencies.'''<br />
<br />
== Download Example Project for Tutorials ==<br />
<br />
The example project (org.eclipse.emf.teneo.hibernate.examples) can be found in git [http://git.eclipse.org/c/teneo/org.eclipse.emf.teneo.git/tree/hibernate/org.eclipse.emf.teneo.hibernate.examples here]. To clone the Teneo git repository execute this action:<br />
<br />
git clone git://git.eclipse.org/gitroot/teneo/org.eclipse.emf.teneo.git<br />
<br />
See [[Git|this page]] on how to work with Eclipse GIT repositories.<br />
<br />
The main examples project used in the tutorials is the: '''org.eclipse.emf.teneo.hibernate.examples''' project.<br />
<br />
This example project uses an extended version of the well-known EMF library example. The example project contains the generated model code and a number of tutorial classes showing how to work with EMF, Teneo and Hibernate.<br />
<br />
Some more details regarding the example project. The example project consists of the following:<br />
* an ecore model and genmodel (in the model subfolder)<br />
* generated model code (no manual changes done, so you can change the ecore model and regenerate the code)<br />
* a number of tutorial java classes in the org.eclipse.emf.teneo.hibernate.examples package<br />
<br />
The MANIFEST.MF of the examples project lists dependencies on several plugins, see the next section for more information on this.</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo&diff=375896Teneo2015-01-06T21:29:11Z<p>Mtaal.springsite.com: /* Documentation */</p>
<hr />
<div>__TOC__<br />
<br />
'''EMF & ORM''': Teneo is a Model-Relational mapping and runtime database persistence solution for the [http://www.eclipse.org/emf Eclipse Modeling Framework] (EMF). Teneo integrates EMF with both [http://www.hibernate.org Hibernate] and [http://www.eclipse.org/eclipselink EclipseLink].<br />
<br />
'''Web-service/Web-application''': If you want to work with EMF in a web environment or connect your RCP to a standard JPA web-server, consider using the '''EMFT Texo''' project, for more information see the [[Texo|Texo wiki]]. <br />
<br />
'''RCP''': if you want to develop a RCP with less emphasys on custom server side logic consider using [[CDO|CDO]]. Teneo is used for Model Relational mapping within the [[CDO_Hibernate_Store|CDO Hibernate Store]].<br />
<br />
'''RCP connected to a JPA compliant server''': if you want to connect your RCP to a standards compliant JPA (web-)server consider using the '''EMFT Texo''' project, for more information see the [[Texo|Texo wiki]]. <br />
<br />
==Features==<br />
* '''Powerful Tool Combination''': Teneo integrates EMF with existing persistency solutions, combining strong model-driven code generation functionality with the power of storage, caching and querying of sophisticated object-relational mapping and persistency software.<br />
* '''Flexible Approach''': Teneo automatically maps models to relational database schema. The mapping can be fully controlled, overridden and extended with JPA annotations in the model itself or in a separate xml file.<br />
* '''Extensive Coverage''': Teneo supports persistence of virtually every ecore model out-of-the-box without additional manual mapping work.<br />
* '''Server-Side-Solutions''': Teneo is primarily for server-oriented environments with business logic running on the server. Especially web-service solutions can benefit from the EMF XML (de-) serialization support combined with automatic Model-Relational mapping and runtime database persistence.<br />
<br />
==Documentation==<br />
For detailed information, manuals and tutorials for each solution visit the ORM specific part of the site:<br />
* '''[[Teneo/Hibernate|Hibernate]]''': The EMF - Hibernate integration supports persisting of basic EObjects, ELists with 1:n, n:m, one-way, two-way and contained relations. EMF Objects can be retrieved using HQL queries. For more information see [[Teneo/Hibernate|here]]<br />
* '''[[Teneo/EclipseLink|EclipseLink]]''': '''[[Teneo/EclipseLink|Teneo Eclipselink]] is not actively maintained anymore (from 2012 onwards). For using EMF in combination with Eclipselink please check out the [[Texo|EMFT Texo]] project.'''<br />
<br />
==Versions==<br />
Teneo supports the three current EMF versions:<br />
* EMF 2.7 (Eclipse 3.7): supported by Teneo version 2.0.0.<br />
* EMF 2.8 (Eclipse 3.8): supported by Teneo version 2.0.0.<br />
* EMF 2.9-2.10 (Eclipse 4.0-4.4): supported by Teneo versions 2.0.0 and 2.1.0 (supports Hibernate 4.3 and further).<br />
<br />
== GIT, Support, Commit Mailing List and FAQ ==<br />
<br />
The Teneo source code is stored in git in this location:<br />
<br />
{{Git|teneo|org.eclipse.emf.teneo.git}}<br />
If you encounter issues, check the [[Teneo/Hibernate/FAQ|FAQ]] page. <br />
<br />
Support for Teneo is given on the [http://www.eclipse.org/modeling/emf/newsgroup-mailing-list.php EMF newsgroup]. For accessing the news group through a browser visit this [http://www.eclipse.org/forums/eclipse.tools.emf page]. To read newsgroups using a client application, install [http://pan.rebelbase.com/ Pan Newsreader] (<tt>pan</tt> Debian/Ubuntu package) or [http://knode.sourceforge.net/ KNode] (<tt>knode</tt> Debian/Ubuntu package).<br />
<br />
To subscribe to the commit mailing list, visit this page: https://dev.eclipse.org/mailman/listinfo/teneo-commit<br />
<br />
Before November 2011, source code was stored in cvs, the cvs repository has been converted to git, for your reference you can find the archived cvs repository [http://archive.eclipse.org/modeling/emf/teneo/teneo_cvs.tgz here].<br />
<br />
== Continuous Build == <br />
<br />
Teneo is build using [[Buckminster|Buckminster]] and [[Hudson|Hudson]] in a continuous build system.<br />
<br />
* [https://hudson.eclipse.org/hudson/job/emf-teneo-nightly/ Teneo nightly build job]<br />
* Detailed description on [[Teneo/Teneo_Build_Setup|Teneo's build setup]]<br />
<br />
Update site containing the latest successful nightly builds:<br />
https://hudson.eclipse.org/hudson/job/emf-teneo-nightly/lastSuccessfulBuild/artifact/build/result/p2site/<br />
<br />
[[Category:Teneo]][[Category:EMF]][[Category:Hibernate]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo&diff=375895Teneo2015-01-06T21:27:41Z<p>Mtaal.springsite.com: /* Versions */</p>
<hr />
<div>__TOC__<br />
<br />
'''EMF & ORM''': Teneo is a Model-Relational mapping and runtime database persistence solution for the [http://www.eclipse.org/emf Eclipse Modeling Framework] (EMF). Teneo integrates EMF with both [http://www.hibernate.org Hibernate] and [http://www.eclipse.org/eclipselink EclipseLink].<br />
<br />
'''Web-service/Web-application''': If you want to work with EMF in a web environment or connect your RCP to a standard JPA web-server, consider using the '''EMFT Texo''' project, for more information see the [[Texo|Texo wiki]]. <br />
<br />
'''RCP''': if you want to develop a RCP with less emphasys on custom server side logic consider using [[CDO|CDO]]. Teneo is used for Model Relational mapping within the [[CDO_Hibernate_Store|CDO Hibernate Store]].<br />
<br />
'''RCP connected to a JPA compliant server''': if you want to connect your RCP to a standards compliant JPA (web-)server consider using the '''EMFT Texo''' project, for more information see the [[Texo|Texo wiki]]. <br />
<br />
==Features==<br />
* '''Powerful Tool Combination''': Teneo integrates EMF with existing persistency solutions, combining strong model-driven code generation functionality with the power of storage, caching and querying of sophisticated object-relational mapping and persistency software.<br />
* '''Flexible Approach''': Teneo automatically maps models to relational database schema. The mapping can be fully controlled, overridden and extended with JPA annotations in the model itself or in a separate xml file.<br />
* '''Extensive Coverage''': Teneo supports persistence of virtually every ecore model out-of-the-box without additional manual mapping work.<br />
* '''Server-Side-Solutions''': Teneo is primarily for server-oriented environments with business logic running on the server. Especially web-service solutions can benefit from the EMF XML (de-) serialization support combined with automatic Model-Relational mapping and runtime database persistence.<br />
<br />
==Documentation==<br />
For detailed information, manuals and tutorials for each solution visit the ORM specific part of the site:<br />
* '''[[Teneo/Hibernate|Hibernate]]''': The EMF - Hibernate integration supports persisting of basic EObjects, ELists with 1:n, n:m, one-way, two-way and contained relations. EMF Objects can be retrieved using HQL queries. For more information see [[Teneo/Hibernate|here]]<br />
* '''[[Teneo/EclipseLink|EclipseLink]]''': The EMF - EclipseLink integration is a fully JPA compliant solution using the EclipseLink orm tool. For more information see [[Teneo/EclipseLink|here]]<br />
<br />
==Versions==<br />
Teneo supports the three current EMF versions:<br />
* EMF 2.7 (Eclipse 3.7): supported by Teneo version 2.0.0.<br />
* EMF 2.8 (Eclipse 3.8): supported by Teneo version 2.0.0.<br />
* EMF 2.9-2.10 (Eclipse 4.0-4.4): supported by Teneo versions 2.0.0 and 2.1.0 (supports Hibernate 4.3 and further).<br />
<br />
== GIT, Support, Commit Mailing List and FAQ ==<br />
<br />
The Teneo source code is stored in git in this location:<br />
<br />
{{Git|teneo|org.eclipse.emf.teneo.git}}<br />
If you encounter issues, check the [[Teneo/Hibernate/FAQ|FAQ]] page. <br />
<br />
Support for Teneo is given on the [http://www.eclipse.org/modeling/emf/newsgroup-mailing-list.php EMF newsgroup]. For accessing the news group through a browser visit this [http://www.eclipse.org/forums/eclipse.tools.emf page]. To read newsgroups using a client application, install [http://pan.rebelbase.com/ Pan Newsreader] (<tt>pan</tt> Debian/Ubuntu package) or [http://knode.sourceforge.net/ KNode] (<tt>knode</tt> Debian/Ubuntu package).<br />
<br />
To subscribe to the commit mailing list, visit this page: https://dev.eclipse.org/mailman/listinfo/teneo-commit<br />
<br />
Before November 2011, source code was stored in cvs, the cvs repository has been converted to git, for your reference you can find the archived cvs repository [http://archive.eclipse.org/modeling/emf/teneo/teneo_cvs.tgz here].<br />
<br />
== Continuous Build == <br />
<br />
Teneo is build using [[Buckminster|Buckminster]] and [[Hudson|Hudson]] in a continuous build system.<br />
<br />
* [https://hudson.eclipse.org/hudson/job/emf-teneo-nightly/ Teneo nightly build job]<br />
* Detailed description on [[Teneo/Teneo_Build_Setup|Teneo's build setup]]<br />
<br />
Update site containing the latest successful nightly builds:<br />
https://hudson.eclipse.org/hudson/job/emf-teneo-nightly/lastSuccessfulBuild/artifact/build/result/p2site/<br />
<br />
[[Category:Teneo]][[Category:EMF]][[Category:Hibernate]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo&diff=375804Texo2014-12-29T05:53:21Z<p>Mtaal.springsite.com: /* Backward Compatibility */</p>
<hr />
<div>==Introduction==<br />
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and JSON web service functionality at runtime. <br />
<br />
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].<br />
<br />
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. <br />
<br />
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.<br />
<br />
<br />
[[Image:texo-client-server.png|center|600px]]<br />
<br />
== Benefits of using Texo ==<br />
<br />
Benefits of using current Texo (November 2012):<br />
* Code Generation:<br />
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore model or XSD''' without direct compile time link from generated entities to EMF, Texo or other framework types. '''Facilitates integration of EMF concepts with other frameworks''' such as Google Web Toolkit or Object Relational Mapping solutions<br />
** Supports '''manual change of generated code''' (the same approach as EMF)<br />
** '''[[Template_Overriding|Overridable and Extendable code generation]]''' with support for EMF-like merge, formatting, import-organizing<br />
<br />
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.<br />
<br />
* Supports most '''XML Schema constructs''' (as EMF)<br />
<br />
* Generic CRUD and Query web service layer: [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]<br />
<br />
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.<br />
<br />
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation<br />
<br />
New functionality which is being developed right now gives these additional benefits:<br />
* '''Multiple annotation models''' (JPA, Hibernate Search, etc.) supported<br />
* '''Generic RIA/HTML5 model maintenance UI''' <br />
<br />
These developments will give additional benefits in terms of increased developer productiviy and quality.<br />
<br />
== Download & Install ==<br />
<br />
Texo is installed through the Eclipse update manager. For more details see the [[Texo/Download_and_Install|Download & Install]] page.<br />
<br />
== Quick Start ==<br />
<br />
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...<br />
<br />
== Documentation ==<br />
<br />
The following pages contain detailed information on different parts of the Texo solution. <br />
<br />
=== Blog ===<br />
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].<br />
<br />
=== Code generation topics ===<br />
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.<br />
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.<br />
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.<br />
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.<br />
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).<br />
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).<br />
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.<br />
<br />
=== ORM/JPA generation topics ===<br />
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.<br />
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.<br />
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.<br />
<br />
=== Runtime topics ===<br />
<br />
==== JPA/Persistence integration ====<br />
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.<br />
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality. <br />
* [[Texo/ObjectStore|Object Store concept]]: the object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.<br />
<br />
==== XML/JSON REST Web Service Support ====<br />
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]<br />
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]<br />
<br />
==== Framework ====<br />
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.<br />
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.<br />
<br />
==== RCP Persistence using EMF Resources and Texo ====<br />
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.<br />
<br />
==== EMF/XML/XMI ====<br />
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI. <br />
* [[Texo/Convert to EMF|EMF Conversion]]: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.<br />
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.<br />
<br />
==== Miscellaneous ====<br />
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.<br />
<br />
== Main Design Concepts ==<br />
<br />
The Texo project is based on a number of main design concepts and philosophies.<br />
* Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators. <br />
* Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api. <br />
* Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.<br />
<br />
For a more detailed description visit the [[Texo/Design%20Concepts|Design Concepts]] page.<br />
<br />
== Texo and EMF ==<br />
<br />
Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on [[Texo/Texo_and_EMF|this page]].<br />
<br />
== Support & Troubleshooting & Bugzilla ==<br />
<br />
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.<br />
<br />
To enter a new bugzilla you can use the following link:<br />
<br />
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.5<br />
<br />
Support is given on the EMFT newsgroup which you can find here:<br />
* nntp: news://news.eclipse.org/eclipse.technology.emft<br />
* forum: http://www.eclipse.org/forums/eclipse.technology.emft<br />
<br />
== Backward Compatibility ==<br />
<br />
Starting from the 0.9.0 version backward compatibility related topics will be published in this section.<br />
<br />
=== 0.9.0 - Version 28 December 2014 ===<br />
<br />
* This issue [https://bugs.eclipse.org/bugs/show_bug.cgi?id=420913 420913] is resolved. There is a property of the EPackage or EReference generation annotation which controls if [https://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29 bi-directional association] support is generated in the java code. This was not working correctly, in that to get this to be working also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved. Note bi-directional access is (and was) 'true'/enabled by default. This can mean that newly generated code (previously generated by a previous Texo version) will change as now the bi-directional property is correctly considered. To keep the old behavior, create an annotation model which sets generateBidirectionalAssociationSupport to false (see [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/tests/org.eclipse.emf.texo.modelgenerator.test/models/samples/extlibrary.annotationsmodel here] for an example, only the generateBidirectionalAssociationSupport part is relevant for this bullet).<br />
<br />
* The createModelObject method of the ModelFactory has been [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/commit/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/model/ModelFactory.java?id=31fb5c7415651646109f711634d0895053ecb0d0 changed] to return a parameterized ModelObject (ModelObject<T>) instead of earlier the ModelObject<?>. With this it is not needed anymore to cast the returned value from createModelObject.<br />
<br />
== Developing ==<br />
<br />
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.<br />
<br />
== Future Topics ==<br />
<br />
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:<br />
* Code/Artifact Generation:<br />
** Support JPA 2.1<br />
** Support Ecore/XCore generic types<br />
** Support Ecore/XCore operations<br />
** Support JAXB annotation generation<br />
** Add JPA/Texo annotation support in Xcore<br />
* Runtime Layer<br />
** Integrated with EMF Client Platform<br />
** Introduce service oriented architecture concepts, focusing on micro-service architectures<br />
** support for no-sql databases on the server side<br />
** integrate with OLAP/Mondrian solutions, back-end and front-end<br />
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box<br />
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF<br />
** use this generic model editor as a basis for a generated model editor in html5/mobile<br />
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor<br />
<br />
Feel free to react on the EMFT newsgroup with more ideas.<br />
<br />
== See also ==<br />
<br />
* [[Teneo]]<br />
* [[CDO]]<br />
<br />
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo&diff=375803Texo2014-12-29T05:51:41Z<p>Mtaal.springsite.com: /* 0.9.0 - Version 28 December 2014 */</p>
<hr />
<div>==Introduction==<br />
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and JSON web service functionality at runtime. <br />
<br />
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].<br />
<br />
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. <br />
<br />
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.<br />
<br />
<br />
[[Image:texo-client-server.png|center|600px]]<br />
<br />
== Benefits of using Texo ==<br />
<br />
Benefits of using current Texo (November 2012):<br />
* Code Generation:<br />
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore model or XSD''' without direct compile time link from generated entities to EMF, Texo or other framework types. '''Facilitates integration of EMF concepts with other frameworks''' such as Google Web Toolkit or Object Relational Mapping solutions<br />
** Supports '''manual change of generated code''' (the same approach as EMF)<br />
** '''[[Template_Overriding|Overridable and Extendable code generation]]''' with support for EMF-like merge, formatting, import-organizing<br />
<br />
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.<br />
<br />
* Supports most '''XML Schema constructs''' (as EMF)<br />
<br />
* Generic CRUD and Query web service layer: [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]<br />
<br />
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.<br />
<br />
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation<br />
<br />
New functionality which is being developed right now gives these additional benefits:<br />
* '''Multiple annotation models''' (JPA, Hibernate Search, etc.) supported<br />
* '''Generic RIA/HTML5 model maintenance UI''' <br />
<br />
These developments will give additional benefits in terms of increased developer productiviy and quality.<br />
<br />
== Download & Install ==<br />
<br />
Texo is installed through the Eclipse update manager. For more details see the [[Texo/Download_and_Install|Download & Install]] page.<br />
<br />
== Quick Start ==<br />
<br />
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...<br />
<br />
== Documentation ==<br />
<br />
The following pages contain detailed information on different parts of the Texo solution. <br />
<br />
=== Blog ===<br />
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].<br />
<br />
=== Code generation topics ===<br />
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.<br />
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.<br />
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.<br />
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.<br />
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).<br />
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).<br />
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.<br />
<br />
=== ORM/JPA generation topics ===<br />
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.<br />
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.<br />
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.<br />
<br />
=== Runtime topics ===<br />
<br />
==== JPA/Persistence integration ====<br />
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.<br />
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality. <br />
* [[Texo/ObjectStore|Object Store concept]]: the object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.<br />
<br />
==== XML/JSON REST Web Service Support ====<br />
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]<br />
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]<br />
<br />
==== Framework ====<br />
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.<br />
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.<br />
<br />
==== RCP Persistence using EMF Resources and Texo ====<br />
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.<br />
<br />
==== EMF/XML/XMI ====<br />
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI. <br />
* [[Texo/Convert to EMF|EMF Conversion]]: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.<br />
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.<br />
<br />
==== Miscellaneous ====<br />
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.<br />
<br />
== Main Design Concepts ==<br />
<br />
The Texo project is based on a number of main design concepts and philosophies.<br />
* Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators. <br />
* Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api. <br />
* Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.<br />
<br />
For a more detailed description visit the [[Texo/Design%20Concepts|Design Concepts]] page.<br />
<br />
== Texo and EMF ==<br />
<br />
Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on [[Texo/Texo_and_EMF|this page]].<br />
<br />
== Support & Troubleshooting & Bugzilla ==<br />
<br />
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.<br />
<br />
To enter a new bugzilla you can use the following link:<br />
<br />
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.5<br />
<br />
Support is given on the EMFT newsgroup which you can find here:<br />
* nntp: news://news.eclipse.org/eclipse.technology.emft<br />
* forum: http://www.eclipse.org/forums/eclipse.technology.emft<br />
<br />
== Backward Compatibility ==<br />
<br />
Starting from the 0.9.0 backward compatibility related topics will be published in this section.<br />
<br />
=== 0.9.0 - Version 28 December 2014 ===<br />
<br />
* This issue [https://bugs.eclipse.org/bugs/show_bug.cgi?id=420913 420913] is resolved. There is a property of the EPackage or EReference generation annotation which controls if [https://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29 bi-directional association] support is generated in the java code. This was not working correctly, in that to get this to be working also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved. Note bi-directional access is (and was) 'true'/enabled by default. This can mean that newly generated code (previously generated by a previous Texo version) will change as now the bi-directional property is correctly considered. To keep the old behavior, create an annotation model which sets generateBidirectionalAssociationSupport to false (see [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/tests/org.eclipse.emf.texo.modelgenerator.test/models/samples/extlibrary.annotationsmodel here] for an example, only the generateBidirectionalAssociationSupport part is relevant for this bullet).<br />
<br />
* The createModelObject method of the ModelFactory has been [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/commit/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/model/ModelFactory.java?id=31fb5c7415651646109f711634d0895053ecb0d0 changed] to return a parameterized ModelObject (ModelObject<T>) instead of earlier the ModelObject<?>. With this it is not needed anymore to cast the returned value from createModelObject.<br />
<br />
== Developing ==<br />
<br />
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.<br />
<br />
== Future Topics ==<br />
<br />
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:<br />
* Code/Artifact Generation:<br />
** Support JPA 2.1<br />
** Support Ecore/XCore generic types<br />
** Support Ecore/XCore operations<br />
** Support JAXB annotation generation<br />
** Add JPA/Texo annotation support in Xcore<br />
* Runtime Layer<br />
** Integrated with EMF Client Platform<br />
** Introduce service oriented architecture concepts, focusing on micro-service architectures<br />
** support for no-sql databases on the server side<br />
** integrate with OLAP/Mondrian solutions, back-end and front-end<br />
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box<br />
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF<br />
** use this generic model editor as a basis for a generated model editor in html5/mobile<br />
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor<br />
<br />
Feel free to react on the EMFT newsgroup with more ideas.<br />
<br />
== See also ==<br />
<br />
* [[Teneo]]<br />
* [[CDO]]<br />
<br />
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo&diff=375802Texo2014-12-29T05:50:25Z<p>Mtaal.springsite.com: /* 0.9.0 - Version 28 December 2014 */</p>
<hr />
<div>==Introduction==<br />
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and JSON web service functionality at runtime. <br />
<br />
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].<br />
<br />
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. <br />
<br />
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.<br />
<br />
<br />
[[Image:texo-client-server.png|center|600px]]<br />
<br />
== Benefits of using Texo ==<br />
<br />
Benefits of using current Texo (November 2012):<br />
* Code Generation:<br />
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore model or XSD''' without direct compile time link from generated entities to EMF, Texo or other framework types. '''Facilitates integration of EMF concepts with other frameworks''' such as Google Web Toolkit or Object Relational Mapping solutions<br />
** Supports '''manual change of generated code''' (the same approach as EMF)<br />
** '''[[Template_Overriding|Overridable and Extendable code generation]]''' with support for EMF-like merge, formatting, import-organizing<br />
<br />
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.<br />
<br />
* Supports most '''XML Schema constructs''' (as EMF)<br />
<br />
* Generic CRUD and Query web service layer: [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]<br />
<br />
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.<br />
<br />
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation<br />
<br />
New functionality which is being developed right now gives these additional benefits:<br />
* '''Multiple annotation models''' (JPA, Hibernate Search, etc.) supported<br />
* '''Generic RIA/HTML5 model maintenance UI''' <br />
<br />
These developments will give additional benefits in terms of increased developer productiviy and quality.<br />
<br />
== Download & Install ==<br />
<br />
Texo is installed through the Eclipse update manager. For more details see the [[Texo/Download_and_Install|Download & Install]] page.<br />
<br />
== Quick Start ==<br />
<br />
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...<br />
<br />
== Documentation ==<br />
<br />
The following pages contain detailed information on different parts of the Texo solution. <br />
<br />
=== Blog ===<br />
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].<br />
<br />
=== Code generation topics ===<br />
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.<br />
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.<br />
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.<br />
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.<br />
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).<br />
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).<br />
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.<br />
<br />
=== ORM/JPA generation topics ===<br />
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.<br />
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.<br />
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.<br />
<br />
=== Runtime topics ===<br />
<br />
==== JPA/Persistence integration ====<br />
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.<br />
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality. <br />
* [[Texo/ObjectStore|Object Store concept]]: the object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.<br />
<br />
==== XML/JSON REST Web Service Support ====<br />
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]<br />
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]<br />
<br />
==== Framework ====<br />
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.<br />
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.<br />
<br />
==== RCP Persistence using EMF Resources and Texo ====<br />
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.<br />
<br />
==== EMF/XML/XMI ====<br />
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI. <br />
* [[Texo/Convert to EMF|EMF Conversion]]: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.<br />
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.<br />
<br />
==== Miscellaneous ====<br />
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.<br />
<br />
== Main Design Concepts ==<br />
<br />
The Texo project is based on a number of main design concepts and philosophies.<br />
* Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators. <br />
* Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api. <br />
* Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.<br />
<br />
For a more detailed description visit the [[Texo/Design%20Concepts|Design Concepts]] page.<br />
<br />
== Texo and EMF ==<br />
<br />
Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on [[Texo/Texo_and_EMF|this page]].<br />
<br />
== Support & Troubleshooting & Bugzilla ==<br />
<br />
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.<br />
<br />
To enter a new bugzilla you can use the following link:<br />
<br />
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.5<br />
<br />
Support is given on the EMFT newsgroup which you can find here:<br />
* nntp: news://news.eclipse.org/eclipse.technology.emft<br />
* forum: http://www.eclipse.org/forums/eclipse.technology.emft<br />
<br />
== Backward Compatibility ==<br />
<br />
Starting from the 0.9.0 backward compatibility related topics will be published in this section.<br />
<br />
=== 0.9.0 - Version 28 December 2014 ===<br />
<br />
* This issue [https://bugs.eclipse.org/bugs/show_bug.cgi?id=420913 420913] is resolved. There is a property of the EPackage or EReference generation annotation which controls if [https://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29 bi-directional association] support is generated in the java code. This was not working correctly, in that to get this to be working also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved. Note bi-directional access is (and was) 'true'/enabled by default. This can mean that newly generated code (previously generated by a previous Texo version) will change as now the bi-directional property is correctly considered. To keep the old behavior, create an annotation model which sets generateBidirectionalAssociationSupport to false (see [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/tests/org.eclipse.emf.texo.modelgenerator.test/models/samples/extlibrary.annotationsmodel here] for an example.<br />
<br />
* The createModelObject method of the ModelFactory has been [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/commit/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/model/ModelFactory.java?id=31fb5c7415651646109f711634d0895053ecb0d0 changed] to return a parameterized ModelObject (ModelObject<T>) instead of earlier the ModelObject<?>. With this it is not needed anymore to cast the returned value from createModelObject.<br />
<br />
== Developing ==<br />
<br />
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.<br />
<br />
== Future Topics ==<br />
<br />
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:<br />
* Code/Artifact Generation:<br />
** Support JPA 2.1<br />
** Support Ecore/XCore generic types<br />
** Support Ecore/XCore operations<br />
** Support JAXB annotation generation<br />
** Add JPA/Texo annotation support in Xcore<br />
* Runtime Layer<br />
** Integrated with EMF Client Platform<br />
** Introduce service oriented architecture concepts, focusing on micro-service architectures<br />
** support for no-sql databases on the server side<br />
** integrate with OLAP/Mondrian solutions, back-end and front-end<br />
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box<br />
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF<br />
** use this generic model editor as a basis for a generated model editor in html5/mobile<br />
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor<br />
<br />
Feel free to react on the EMFT newsgroup with more ideas.<br />
<br />
== See also ==<br />
<br />
* [[Teneo]]<br />
* [[CDO]]<br />
<br />
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo&diff=375801Texo2014-12-29T05:49:16Z<p>Mtaal.springsite.com: /* 0.9.0 - Version 28 December 2014 */</p>
<hr />
<div>==Introduction==<br />
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and JSON web service functionality at runtime. <br />
<br />
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].<br />
<br />
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. <br />
<br />
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.<br />
<br />
<br />
[[Image:texo-client-server.png|center|600px]]<br />
<br />
== Benefits of using Texo ==<br />
<br />
Benefits of using current Texo (November 2012):<br />
* Code Generation:<br />
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore model or XSD''' without direct compile time link from generated entities to EMF, Texo or other framework types. '''Facilitates integration of EMF concepts with other frameworks''' such as Google Web Toolkit or Object Relational Mapping solutions<br />
** Supports '''manual change of generated code''' (the same approach as EMF)<br />
** '''[[Template_Overriding|Overridable and Extendable code generation]]''' with support for EMF-like merge, formatting, import-organizing<br />
<br />
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.<br />
<br />
* Supports most '''XML Schema constructs''' (as EMF)<br />
<br />
* Generic CRUD and Query web service layer: [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]<br />
<br />
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.<br />
<br />
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation<br />
<br />
New functionality which is being developed right now gives these additional benefits:<br />
* '''Multiple annotation models''' (JPA, Hibernate Search, etc.) supported<br />
* '''Generic RIA/HTML5 model maintenance UI''' <br />
<br />
These developments will give additional benefits in terms of increased developer productiviy and quality.<br />
<br />
== Download & Install ==<br />
<br />
Texo is installed through the Eclipse update manager. For more details see the [[Texo/Download_and_Install|Download & Install]] page.<br />
<br />
== Quick Start ==<br />
<br />
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...<br />
<br />
== Documentation ==<br />
<br />
The following pages contain detailed information on different parts of the Texo solution. <br />
<br />
=== Blog ===<br />
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].<br />
<br />
=== Code generation topics ===<br />
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.<br />
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.<br />
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.<br />
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.<br />
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).<br />
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).<br />
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.<br />
<br />
=== ORM/JPA generation topics ===<br />
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.<br />
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.<br />
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.<br />
<br />
=== Runtime topics ===<br />
<br />
==== JPA/Persistence integration ====<br />
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.<br />
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality. <br />
* [[Texo/ObjectStore|Object Store concept]]: the object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.<br />
<br />
==== XML/JSON REST Web Service Support ====<br />
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]<br />
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]<br />
<br />
==== Framework ====<br />
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.<br />
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.<br />
<br />
==== RCP Persistence using EMF Resources and Texo ====<br />
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.<br />
<br />
==== EMF/XML/XMI ====<br />
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI. <br />
* [[Texo/Convert to EMF|EMF Conversion]]: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.<br />
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.<br />
<br />
==== Miscellaneous ====<br />
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.<br />
<br />
== Main Design Concepts ==<br />
<br />
The Texo project is based on a number of main design concepts and philosophies.<br />
* Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators. <br />
* Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api. <br />
* Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.<br />
<br />
For a more detailed description visit the [[Texo/Design%20Concepts|Design Concepts]] page.<br />
<br />
== Texo and EMF ==<br />
<br />
Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on [[Texo/Texo_and_EMF|this page]].<br />
<br />
== Support & Troubleshooting & Bugzilla ==<br />
<br />
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.<br />
<br />
To enter a new bugzilla you can use the following link:<br />
<br />
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.5<br />
<br />
Support is given on the EMFT newsgroup which you can find here:<br />
* nntp: news://news.eclipse.org/eclipse.technology.emft<br />
* forum: http://www.eclipse.org/forums/eclipse.technology.emft<br />
<br />
== Backward Compatibility ==<br />
<br />
Starting from the 0.9.0 backward compatibility related topics will be published in this section.<br />
<br />
=== 0.9.0 - Version 28 December 2014 ===<br />
<br />
* This issue [https://bugs.eclipse.org/bugs/show_bug.cgi?id=420913 420913] is resolved. There is a property of the EPackage or EReference generation annotation which controls if [https://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29 bi-directional association] support is generated in the java code. This was not working correctly, in that to get this to be working also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved. Note bi-directional access is (and was) 'true'/enabled by default. This can mean that newly generated code (previously generated by a previous Texo version) will change as now the bi-directional property is correctly considered. To keep the old behavior, create an annotation model which sets generateBidirectionalAssociationSupport to false:<br />
<br />
<source lang="xml"><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<annotationsmodel:AnnotatedModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:annotationsmodel="http://www.eclipse.org/emf/texo/annotations/model" xmlns:modelannotations="http://www.eclipse.org/emf/texo/modelgenerator/modelannotations"><br />
<annotatedEPackages><br />
<ePackage href="extlibrary.ecore#/"/><br />
<ePackageAnnotations xsi:type="modelannotations:EPackageModelGenAnnotation" generateBidirectionalAssociationSupport="false"/><br />
</annotatedEPackages><br />
</annotationsmodel:AnnotatedModel><br />
</source><br />
<br />
<br />
* The createModelObject method of the ModelFactory has been [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/commit/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/model/ModelFactory.java?id=31fb5c7415651646109f711634d0895053ecb0d0 changed] to return a parameterized ModelObject (ModelObject<T>) instead of earlier the ModelObject<?>. With this it is not needed anymore to cast the returned value from createModelObject.<br />
<br />
== Developing ==<br />
<br />
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.<br />
<br />
== Future Topics ==<br />
<br />
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:<br />
* Code/Artifact Generation:<br />
** Support JPA 2.1<br />
** Support Ecore/XCore generic types<br />
** Support Ecore/XCore operations<br />
** Support JAXB annotation generation<br />
** Add JPA/Texo annotation support in Xcore<br />
* Runtime Layer<br />
** Integrated with EMF Client Platform<br />
** Introduce service oriented architecture concepts, focusing on micro-service architectures<br />
** support for no-sql databases on the server side<br />
** integrate with OLAP/Mondrian solutions, back-end and front-end<br />
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box<br />
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF<br />
** use this generic model editor as a basis for a generated model editor in html5/mobile<br />
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor<br />
<br />
Feel free to react on the EMFT newsgroup with more ideas.<br />
<br />
== See also ==<br />
<br />
* [[Teneo]]<br />
* [[CDO]]<br />
<br />
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo&diff=375800Texo2014-12-29T05:48:58Z<p>Mtaal.springsite.com: /* 0.9.0 - Version 28 December 2014 */</p>
<hr />
<div>==Introduction==<br />
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and JSON web service functionality at runtime. <br />
<br />
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].<br />
<br />
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. <br />
<br />
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.<br />
<br />
<br />
[[Image:texo-client-server.png|center|600px]]<br />
<br />
== Benefits of using Texo ==<br />
<br />
Benefits of using current Texo (November 2012):<br />
* Code Generation:<br />
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore model or XSD''' without direct compile time link from generated entities to EMF, Texo or other framework types. '''Facilitates integration of EMF concepts with other frameworks''' such as Google Web Toolkit or Object Relational Mapping solutions<br />
** Supports '''manual change of generated code''' (the same approach as EMF)<br />
** '''[[Template_Overriding|Overridable and Extendable code generation]]''' with support for EMF-like merge, formatting, import-organizing<br />
<br />
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.<br />
<br />
* Supports most '''XML Schema constructs''' (as EMF)<br />
<br />
* Generic CRUD and Query web service layer: [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]<br />
<br />
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.<br />
<br />
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation<br />
<br />
New functionality which is being developed right now gives these additional benefits:<br />
* '''Multiple annotation models''' (JPA, Hibernate Search, etc.) supported<br />
* '''Generic RIA/HTML5 model maintenance UI''' <br />
<br />
These developments will give additional benefits in terms of increased developer productiviy and quality.<br />
<br />
== Download & Install ==<br />
<br />
Texo is installed through the Eclipse update manager. For more details see the [[Texo/Download_and_Install|Download & Install]] page.<br />
<br />
== Quick Start ==<br />
<br />
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...<br />
<br />
== Documentation ==<br />
<br />
The following pages contain detailed information on different parts of the Texo solution. <br />
<br />
=== Blog ===<br />
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].<br />
<br />
=== Code generation topics ===<br />
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.<br />
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.<br />
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.<br />
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.<br />
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).<br />
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).<br />
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.<br />
<br />
=== ORM/JPA generation topics ===<br />
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.<br />
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.<br />
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.<br />
<br />
=== Runtime topics ===<br />
<br />
==== JPA/Persistence integration ====<br />
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.<br />
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality. <br />
* [[Texo/ObjectStore|Object Store concept]]: the object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.<br />
<br />
==== XML/JSON REST Web Service Support ====<br />
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]<br />
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]<br />
<br />
==== Framework ====<br />
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.<br />
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.<br />
<br />
==== RCP Persistence using EMF Resources and Texo ====<br />
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.<br />
<br />
==== EMF/XML/XMI ====<br />
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI. <br />
* [[Texo/Convert to EMF|EMF Conversion]]: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.<br />
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.<br />
<br />
==== Miscellaneous ====<br />
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.<br />
<br />
== Main Design Concepts ==<br />
<br />
The Texo project is based on a number of main design concepts and philosophies.<br />
* Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators. <br />
* Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api. <br />
* Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.<br />
<br />
For a more detailed description visit the [[Texo/Design%20Concepts|Design Concepts]] page.<br />
<br />
== Texo and EMF ==<br />
<br />
Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on [[Texo/Texo_and_EMF|this page]].<br />
<br />
== Support & Troubleshooting & Bugzilla ==<br />
<br />
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.<br />
<br />
To enter a new bugzilla you can use the following link:<br />
<br />
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.5<br />
<br />
Support is given on the EMFT newsgroup which you can find here:<br />
* nntp: news://news.eclipse.org/eclipse.technology.emft<br />
* forum: http://www.eclipse.org/forums/eclipse.technology.emft<br />
<br />
== Backward Compatibility ==<br />
<br />
Starting from the 0.9.0 backward compatibility related topics will be published in this section.<br />
<br />
=== 0.9.0 - Version 28 December 2014 ===<br />
<br />
* This issue [https://bugs.eclipse.org/bugs/show_bug.cgi?id=420913 420913] is resolved. There is a property of the EPackage or EReference generation annotation which controls if [https://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29 bi-directional association] support is generated in the java code. This was not working correctly, in that to get this to be working also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved. Note bi-directional access is (and was) 'true'/enabled by default. This can mean that newly generated code (previously generated by a previous Texo version) will change as now the bi-directional property is correctly considered. To keep the old behavior, create an annotation model which sets generateBidirectionalAssociationSupport to false:<br />
<source lang="xml"><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<annotationsmodel:AnnotatedModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:annotationsmodel="http://www.eclipse.org/emf/texo/annotations/model" xmlns:modelannotations="http://www.eclipse.org/emf/texo/modelgenerator/modelannotations"><br />
<annotatedEPackages><br />
<ePackage href="extlibrary.ecore#/"/><br />
<ePackageAnnotations xsi:type="modelannotations:EPackageModelGenAnnotation" generateBidirectionalAssociationSupport="false"/><br />
</annotatedEPackages><br />
</annotationsmodel:AnnotatedModel><br />
</source><br />
<br />
* The createModelObject method of the ModelFactory has been [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/commit/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/model/ModelFactory.java?id=31fb5c7415651646109f711634d0895053ecb0d0 changed] to return a parameterized ModelObject (ModelObject<T>) instead of earlier the ModelObject<?>. With this it is not needed anymore to cast the returned value from createModelObject.<br />
<br />
== Developing ==<br />
<br />
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.<br />
<br />
== Future Topics ==<br />
<br />
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:<br />
* Code/Artifact Generation:<br />
** Support JPA 2.1<br />
** Support Ecore/XCore generic types<br />
** Support Ecore/XCore operations<br />
** Support JAXB annotation generation<br />
** Add JPA/Texo annotation support in Xcore<br />
* Runtime Layer<br />
** Integrated with EMF Client Platform<br />
** Introduce service oriented architecture concepts, focusing on micro-service architectures<br />
** support for no-sql databases on the server side<br />
** integrate with OLAP/Mondrian solutions, back-end and front-end<br />
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box<br />
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF<br />
** use this generic model editor as a basis for a generated model editor in html5/mobile<br />
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor<br />
<br />
Feel free to react on the EMFT newsgroup with more ideas.<br />
<br />
== See also ==<br />
<br />
* [[Teneo]]<br />
* [[CDO]]<br />
<br />
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo&diff=375791Texo2014-12-28T21:54:52Z<p>Mtaal.springsite.com: /* 0.9.0 - Version 28 December 2014 */</p>
<hr />
<div>==Introduction==<br />
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and JSON web service functionality at runtime. <br />
<br />
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].<br />
<br />
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. <br />
<br />
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.<br />
<br />
<br />
[[Image:texo-client-server.png|center|600px]]<br />
<br />
== Benefits of using Texo ==<br />
<br />
Benefits of using current Texo (November 2012):<br />
* Code Generation:<br />
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore model or XSD''' without direct compile time link from generated entities to EMF, Texo or other framework types. '''Facilitates integration of EMF concepts with other frameworks''' such as Google Web Toolkit or Object Relational Mapping solutions<br />
** Supports '''manual change of generated code''' (the same approach as EMF)<br />
** '''[[Template_Overriding|Overridable and Extendable code generation]]''' with support for EMF-like merge, formatting, import-organizing<br />
<br />
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.<br />
<br />
* Supports most '''XML Schema constructs''' (as EMF)<br />
<br />
* Generic CRUD and Query web service layer: [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]<br />
<br />
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.<br />
<br />
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation<br />
<br />
New functionality which is being developed right now gives these additional benefits:<br />
* '''Multiple annotation models''' (JPA, Hibernate Search, etc.) supported<br />
* '''Generic RIA/HTML5 model maintenance UI''' <br />
<br />
These developments will give additional benefits in terms of increased developer productiviy and quality.<br />
<br />
== Download & Install ==<br />
<br />
Texo is installed through the Eclipse update manager. For more details see the [[Texo/Download_and_Install|Download & Install]] page.<br />
<br />
== Quick Start ==<br />
<br />
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...<br />
<br />
== Documentation ==<br />
<br />
The following pages contain detailed information on different parts of the Texo solution. <br />
<br />
=== Blog ===<br />
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].<br />
<br />
=== Code generation topics ===<br />
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.<br />
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.<br />
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.<br />
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.<br />
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).<br />
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).<br />
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.<br />
<br />
=== ORM/JPA generation topics ===<br />
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.<br />
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.<br />
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.<br />
<br />
=== Runtime topics ===<br />
<br />
==== JPA/Persistence integration ====<br />
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.<br />
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality. <br />
* [[Texo/ObjectStore|Object Store concept]]: the object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.<br />
<br />
==== XML/JSON REST Web Service Support ====<br />
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]<br />
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]<br />
<br />
==== Framework ====<br />
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.<br />
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.<br />
<br />
==== RCP Persistence using EMF Resources and Texo ====<br />
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.<br />
<br />
==== EMF/XML/XMI ====<br />
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI. <br />
* [[Texo/Convert to EMF|EMF Conversion]]: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.<br />
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.<br />
<br />
==== Miscellaneous ====<br />
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.<br />
<br />
== Main Design Concepts ==<br />
<br />
The Texo project is based on a number of main design concepts and philosophies.<br />
* Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators. <br />
* Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api. <br />
* Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.<br />
<br />
For a more detailed description visit the [[Texo/Design%20Concepts|Design Concepts]] page.<br />
<br />
== Texo and EMF ==<br />
<br />
Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on [[Texo/Texo_and_EMF|this page]].<br />
<br />
== Support & Troubleshooting & Bugzilla ==<br />
<br />
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.<br />
<br />
To enter a new bugzilla you can use the following link:<br />
<br />
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.5<br />
<br />
Support is given on the EMFT newsgroup which you can find here:<br />
* nntp: news://news.eclipse.org/eclipse.technology.emft<br />
* forum: http://www.eclipse.org/forums/eclipse.technology.emft<br />
<br />
== Backward Compatibility ==<br />
<br />
Starting from the 0.9.0 backward compatibility related topics will be published in this section.<br />
<br />
=== 0.9.0 - Version 28 December 2014 ===<br />
<br />
* This issue [https://bugs.eclipse.org/bugs/show_bug.cgi?id=420913 420913] is resolved. There is a property of the EPackage or EReference generation annotation which controls if [https://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29 bi-directional association] support is generated in the java code. This was not working correctly, in that to get this to be generated also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in itself, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved. Note bi-directional access is (and was) 'true'/enabled by default. This can mean that newly generated code (previously generated by a previous Texo version) will change as now the bi-directional property is correctly considered.<br />
<br />
* The createModelObject method of the ModelFactory has been [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/commit/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/model/ModelFactory.java?id=31fb5c7415651646109f711634d0895053ecb0d0 changed] to return a parameterized ModelObject (ModelObject<T>) instead of earlier the ModelObject<?>. With this it is not needed anymore to cast the returned value from createModelObject.<br />
<br />
== Developing ==<br />
<br />
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.<br />
<br />
== Future Topics ==<br />
<br />
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:<br />
* Code/Artifact Generation:<br />
** Support JPA 2.1<br />
** Support Ecore/XCore generic types<br />
** Support Ecore/XCore operations<br />
** Support JAXB annotation generation<br />
** Add JPA/Texo annotation support in Xcore<br />
* Runtime Layer<br />
** Integrated with EMF Client Platform<br />
** Introduce service oriented architecture concepts, focusing on micro-service architectures<br />
** support for no-sql databases on the server side<br />
** integrate with OLAP/Mondrian solutions, back-end and front-end<br />
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box<br />
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF<br />
** use this generic model editor as a basis for a generated model editor in html5/mobile<br />
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor<br />
<br />
Feel free to react on the EMFT newsgroup with more ideas.<br />
<br />
== See also ==<br />
<br />
* [[Teneo]]<br />
* [[CDO]]<br />
<br />
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo&diff=375790Texo2014-12-28T21:54:01Z<p>Mtaal.springsite.com: /* 0.9.0 - Version 28 December 2014 */</p>
<hr />
<div>==Introduction==<br />
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and JSON web service functionality at runtime. <br />
<br />
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].<br />
<br />
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. <br />
<br />
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.<br />
<br />
<br />
[[Image:texo-client-server.png|center|600px]]<br />
<br />
== Benefits of using Texo ==<br />
<br />
Benefits of using current Texo (November 2012):<br />
* Code Generation:<br />
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore model or XSD''' without direct compile time link from generated entities to EMF, Texo or other framework types. '''Facilitates integration of EMF concepts with other frameworks''' such as Google Web Toolkit or Object Relational Mapping solutions<br />
** Supports '''manual change of generated code''' (the same approach as EMF)<br />
** '''[[Template_Overriding|Overridable and Extendable code generation]]''' with support for EMF-like merge, formatting, import-organizing<br />
<br />
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.<br />
<br />
* Supports most '''XML Schema constructs''' (as EMF)<br />
<br />
* Generic CRUD and Query web service layer: [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]<br />
<br />
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.<br />
<br />
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation<br />
<br />
New functionality which is being developed right now gives these additional benefits:<br />
* '''Multiple annotation models''' (JPA, Hibernate Search, etc.) supported<br />
* '''Generic RIA/HTML5 model maintenance UI''' <br />
<br />
These developments will give additional benefits in terms of increased developer productiviy and quality.<br />
<br />
== Download & Install ==<br />
<br />
Texo is installed through the Eclipse update manager. For more details see the [[Texo/Download_and_Install|Download & Install]] page.<br />
<br />
== Quick Start ==<br />
<br />
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...<br />
<br />
== Documentation ==<br />
<br />
The following pages contain detailed information on different parts of the Texo solution. <br />
<br />
=== Blog ===<br />
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].<br />
<br />
=== Code generation topics ===<br />
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.<br />
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.<br />
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.<br />
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.<br />
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).<br />
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).<br />
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.<br />
<br />
=== ORM/JPA generation topics ===<br />
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.<br />
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.<br />
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.<br />
<br />
=== Runtime topics ===<br />
<br />
==== JPA/Persistence integration ====<br />
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.<br />
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality. <br />
* [[Texo/ObjectStore|Object Store concept]]: the object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.<br />
<br />
==== XML/JSON REST Web Service Support ====<br />
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]<br />
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]<br />
<br />
==== Framework ====<br />
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.<br />
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.<br />
<br />
==== RCP Persistence using EMF Resources and Texo ====<br />
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.<br />
<br />
==== EMF/XML/XMI ====<br />
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI. <br />
* [[Texo/Convert to EMF|EMF Conversion]]: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.<br />
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.<br />
<br />
==== Miscellaneous ====<br />
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.<br />
<br />
== Main Design Concepts ==<br />
<br />
The Texo project is based on a number of main design concepts and philosophies.<br />
* Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators. <br />
* Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api. <br />
* Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.<br />
<br />
For a more detailed description visit the [[Texo/Design%20Concepts|Design Concepts]] page.<br />
<br />
== Texo and EMF ==<br />
<br />
Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on [[Texo/Texo_and_EMF|this page]].<br />
<br />
== Support & Troubleshooting & Bugzilla ==<br />
<br />
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.<br />
<br />
To enter a new bugzilla you can use the following link:<br />
<br />
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.5<br />
<br />
Support is given on the EMFT newsgroup which you can find here:<br />
* nntp: news://news.eclipse.org/eclipse.technology.emft<br />
* forum: http://www.eclipse.org/forums/eclipse.technology.emft<br />
<br />
== Backward Compatibility ==<br />
<br />
Starting from the 0.9.0 backward compatibility related topics will be published in this section.<br />
<br />
=== 0.9.0 - Version 28 December 2014 ===<br />
<br />
* This issue [https://bugs.eclipse.org/bugs/show_bug.cgi?id=420913 420913] is resolved. There is a property of the EPackage or EReference generation annotation which controls if [https://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29 bi-directional association] support is generated in the java code. This was not working correctly, in that to get this to be generated also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in itself, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved, also the bi-directional access is 'true'/enabled by default. This can mean that newly generated code (previously generated by a previous Texo version) will change as now the bi-directional property is correctly considered.<br />
<br />
* The createModelObject method of the ModelFactory has been [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/commit/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/model/ModelFactory.java?id=31fb5c7415651646109f711634d0895053ecb0d0 changed] to return a parameterized ModelObject (ModelObject<T>) instead of earlier the ModelObject<?>. With this it is not needed anymore to cast the returned value from createModelObject.<br />
<br />
== Developing ==<br />
<br />
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.<br />
<br />
== Future Topics ==<br />
<br />
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:<br />
* Code/Artifact Generation:<br />
** Support JPA 2.1<br />
** Support Ecore/XCore generic types<br />
** Support Ecore/XCore operations<br />
** Support JAXB annotation generation<br />
** Add JPA/Texo annotation support in Xcore<br />
* Runtime Layer<br />
** Integrated with EMF Client Platform<br />
** Introduce service oriented architecture concepts, focusing on micro-service architectures<br />
** support for no-sql databases on the server side<br />
** integrate with OLAP/Mondrian solutions, back-end and front-end<br />
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box<br />
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF<br />
** use this generic model editor as a basis for a generated model editor in html5/mobile<br />
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor<br />
<br />
Feel free to react on the EMFT newsgroup with more ideas.<br />
<br />
== See also ==<br />
<br />
* [[Teneo]]<br />
* [[CDO]]<br />
<br />
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo&diff=375789Texo2014-12-28T21:48:57Z<p>Mtaal.springsite.com: </p>
<hr />
<div>==Introduction==<br />
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and JSON web service functionality at runtime. <br />
<br />
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].<br />
<br />
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. <br />
<br />
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.<br />
<br />
<br />
[[Image:texo-client-server.png|center|600px]]<br />
<br />
== Benefits of using Texo ==<br />
<br />
Benefits of using current Texo (November 2012):<br />
* Code Generation:<br />
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore model or XSD''' without direct compile time link from generated entities to EMF, Texo or other framework types. '''Facilitates integration of EMF concepts with other frameworks''' such as Google Web Toolkit or Object Relational Mapping solutions<br />
** Supports '''manual change of generated code''' (the same approach as EMF)<br />
** '''[[Template_Overriding|Overridable and Extendable code generation]]''' with support for EMF-like merge, formatting, import-organizing<br />
<br />
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.<br />
<br />
* Supports most '''XML Schema constructs''' (as EMF)<br />
<br />
* Generic CRUD and Query web service layer: [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]<br />
<br />
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.<br />
<br />
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation<br />
<br />
New functionality which is being developed right now gives these additional benefits:<br />
* '''Multiple annotation models''' (JPA, Hibernate Search, etc.) supported<br />
* '''Generic RIA/HTML5 model maintenance UI''' <br />
<br />
These developments will give additional benefits in terms of increased developer productiviy and quality.<br />
<br />
== Download & Install ==<br />
<br />
Texo is installed through the Eclipse update manager. For more details see the [[Texo/Download_and_Install|Download & Install]] page.<br />
<br />
== Quick Start ==<br />
<br />
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...<br />
<br />
== Documentation ==<br />
<br />
The following pages contain detailed information on different parts of the Texo solution. <br />
<br />
=== Blog ===<br />
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].<br />
<br />
=== Code generation topics ===<br />
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.<br />
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.<br />
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.<br />
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.<br />
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).<br />
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).<br />
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.<br />
<br />
=== ORM/JPA generation topics ===<br />
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.<br />
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.<br />
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.<br />
<br />
=== Runtime topics ===<br />
<br />
==== JPA/Persistence integration ====<br />
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.<br />
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality. <br />
* [[Texo/ObjectStore|Object Store concept]]: the object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.<br />
<br />
==== XML/JSON REST Web Service Support ====<br />
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]<br />
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]<br />
<br />
==== Framework ====<br />
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.<br />
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.<br />
<br />
==== RCP Persistence using EMF Resources and Texo ====<br />
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.<br />
<br />
==== EMF/XML/XMI ====<br />
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI. <br />
* [[Texo/Convert to EMF|EMF Conversion]]: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.<br />
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.<br />
<br />
==== Miscellaneous ====<br />
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.<br />
<br />
== Main Design Concepts ==<br />
<br />
The Texo project is based on a number of main design concepts and philosophies.<br />
* Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators. <br />
* Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api. <br />
* Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.<br />
<br />
For a more detailed description visit the [[Texo/Design%20Concepts|Design Concepts]] page.<br />
<br />
== Texo and EMF ==<br />
<br />
Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on [[Texo/Texo_and_EMF|this page]].<br />
<br />
== Support & Troubleshooting & Bugzilla ==<br />
<br />
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.<br />
<br />
To enter a new bugzilla you can use the following link:<br />
<br />
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.5<br />
<br />
Support is given on the EMFT newsgroup which you can find here:<br />
* nntp: news://news.eclipse.org/eclipse.technology.emft<br />
* forum: http://www.eclipse.org/forums/eclipse.technology.emft<br />
<br />
== Backward Compatibility ==<br />
<br />
Starting from the 0.9.0 backward compatibility related topics will be published in this section.<br />
<br />
=== 0.9.0 - Version 28 December 2014 ===<br />
<br />
* This issue [https://bugs.eclipse.org/bugs/show_bug.cgi?id=420913 420913] is resolved. There is a property of the EPackage or EReference generation annotation which controls if [https://wiki.eclipse.org/Texo/Code_Generation_Patterns#Generation_of_a_safe_bi-directional_association_API_.28or_not.29 bi-directional association] support is generated in the java code. This was not working correctly, in that to get this to be generated also the 'Generate save many access' on the EPackage gen annotation should be set to true. This was not correct in itself, also without setting this additional property, bi-directional access should be generated correctly. This is now resolved, also the bi-directional access is 'true'/enabled by default. This can mean that new generated code will change as now the bi-directional property is correctly considered.<br />
<br />
== Developing ==<br />
<br />
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.<br />
<br />
== Future Topics ==<br />
<br />
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:<br />
* Code/Artifact Generation:<br />
** Support JPA 2.1<br />
** Support Ecore/XCore generic types<br />
** Support Ecore/XCore operations<br />
** Support JAXB annotation generation<br />
** Add JPA/Texo annotation support in Xcore<br />
* Runtime Layer<br />
** Integrated with EMF Client Platform<br />
** Introduce service oriented architecture concepts, focusing on micro-service architectures<br />
** support for no-sql databases on the server side<br />
** integrate with OLAP/Mondrian solutions, back-end and front-end<br />
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box<br />
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF<br />
** use this generic model editor as a basis for a generated model editor in html5/mobile<br />
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor<br />
<br />
Feel free to react on the EMFT newsgroup with more ideas.<br />
<br />
== See also ==<br />
<br />
* [[Teneo]]<br />
* [[CDO]]<br />
<br />
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo/Xcore_Support&diff=375784Texo/Xcore Support2014-12-28T00:06:56Z<p>Mtaal.springsite.com: </p>
<hr />
<div>__TOC__<br />
<br />
== Xcore Support ==<br />
<br />
''' This functionality is available from the 0.9.0 version of Texo.'''<br />
<br />
Texo supports [[Xcore|xcore]] in the same way as an [[Texo/Generate_Artifacts|ecore]] model file. All the [[Texo#Code_generation_topics|code generation]] functionality is also supported for xcore files. You can even specify an [[Texo/Code_Generation_Details|annotations]] model on the basis of the xcore file, load the referenced xcore file as any standard resource in the annotationsmodel file.<br />
<br />
To try the different functionalities right click on the xcore file:<br />
<br />
<br />
[[Image:org.eclipse.emf.texo.xcore.png|center]]<br />
<br />
<br />
The available options are the same as for an ecore file. There is an additional option to generate an ecore file, for your convenience.<br />
<br />
== Auto-generate EMF and Texo code ==<br />
<br />
You can tell Texo to [[Texo/Automatic_Code_Generation|automatically]] generate the model code when model files change. Also Xcore can auto-generate the EMF code. <br />
<br />
The Texo autocode generation will generate in the same plugin/project as where the model files are located. The EMF code can be generated in a separate plugin/project. Combining Texo code and EMF code fits perfect in a three tier architecture [[Texo/EMFResource|supported]] by Texo: EMF on the RCP client and Texo on the server. <br />
<br />
If you are only coding for the server side you can disable the EMF XCore auto generate feature. To disable the EMF Xcore auto generation uncheck the 'Compiler is actived' option in the project properties: <br />
<br />
<br />
[[Image:org.eclipse.emf.texo.xcore.uncheck.auto.png|center]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo/Developing&diff=375780Texo/Developing2014-12-27T12:15:17Z<p>Mtaal.springsite.com: /* Setup Development environment */</p>
<hr />
<div>== Introduction ==<br />
<br />
This page outlines how to setup a development environment to develop in Texo. <br />
<br />
== GIT ==<br />
The Texo project uses git. Texo core is at git on eclipse.org, the example projects are hosted on github [https://github.com/mtaal/texo here]. <br />
<br />
To clone the eclipse.org git repository use this command:<br />
* committers:<br />
git clone ssh://committer_id@git.eclipse.org/gitroot/texo/org.eclipse.emf.texo.git<br />
* non-committers:<br />
git clone http://git.eclipse.org/gitroot/texo/org.eclipse.emf.texo.git<br />
<br />
You can browse the Texo git repository: {{Git|texo|org.eclipse.emf.texo.git}}<br />
<br />
Within the git repository you will find the projects structured as follows:<br />
* features: contains the feature projects<br />
* infra: contains both developer setup as well as the build setup projects<br />
* core: contains the core plugins used both when generating code, at runtime and during testing<br />
* runtime: the plugins for running texo on the server (in combination with the core plugins)<br />
* tests: the plugins used for testing<br />
<br />
For more information on git and eclipse see these pages:<br />
* [http://wiki.eclipse.org/Git Git at eclipse.org]<br />
* [http://eclipse.org/egit/ EGit]<br />
<br />
Texo moved to Git in November 2011, the previous cvs repository is not available anymore. See [http://archive.eclipse.org/modeling/emft/texo/texo.cvs.tgz here] for the archived cvs repository.<br />
<br />
== Commit Mailing List ==<br />
To subscribe to the commit mailing list visit this page: https://dev.eclipse.org/mailman/listinfo/texo-commit.<br />
<br />
== Setup Development environment ==<br />
<br />
Texo has the following dependencies:<br />
* Eclipse 3.7 or higher<br />
* EMF 2.7 or higher<br />
* XPand and XText<br />
<br />
Eclipse can be downloaded from [http://www.eclipse.org/downloads/ here].<br />
<br />
EMF is possibly already present as part of the Eclipse install.<br />
<br />
XPAND and EMF can be installed through the update manager (type the names mwe, xpand etc. in the search box): <br />
* http://download.eclipse.org/releases/luna<br />
* http://download.eclipse.org/releases/juno<br />
* http://download.eclipse.org/releases/kepler<br />
* http://download.eclipse.org/releases/helios<br />
* http://download.eclipse.org/releases/indigo<br />
<br />
To get all the development projects clone the git repository as outlined above and import all the projects in the repository. <br />
<br />
As a next step import the clean up and formatter profiles. These can be found in the Texo Develop project. <br />
* Goto Window > Preferences<br />
* To Java > Code Style > Formatter and click import, find the texo_formatter.xml in the Texo Develop project on your file system and import it<br />
* To Java > Code Style > Clean Up and click import, find the texo_cleanup.xml in the Texo Develop project on your file system and import it<br />
<br />
== Testing ==<br />
<br />
This is by far the most important must-do. '''Code and functionality must be supported with Junit test cases.''' Each plugin should have an equivalent *.test plugin which contains testcases which test the functionality.<br />
<br />
Although many developers like testng, Texo uses Junit because it is slightly better supported by Eclipse and Eclipse build environments. <br />
<br />
Texo currently does not use code coverage tools. There is however the wish to add this in the future.<br />
<br />
== JDK 1.5 ==<br />
<br />
Texo should be compiled for the JDK 1.5 platform. This is normally setup correctly in each plugin.<br />
<br />
== Code Formatting ==<br />
<br />
The plugin projects have been set up to format the code using the Texo profile when saving a file. The Texo profiles can be found in the develop project.<br />
<br />
== Copyright ==<br />
<br />
All files should start with a copy right section like this:<br />
<source lang="java"><br />
/**<br />
* <copyright><br />
*<br />
* Copyright (c) 2011 Springsite BV (The Netherlands) and others<br />
* All rights reserved. This program and the accompanying materials<br />
* are made available under the terms of the Eclipse Public License v1.0<br />
* which accompanies this distribution, and is available at<br />
* http://www.eclipse.org/legal/epl-v10.html<br />
*<br />
* Contributors:<br />
* Martin Taal - Initial API and implementation<br />
*<br />
* </copyright><br />
*<br />
* $Id: AbstractModelFeatureMapEntry.java,v 1.2 2010/01/30 15:59:35 mtaal Exp $<br />
*/<br />
</source><br />
(copyright holder and contributors ofcourse set to the one creating/adapting the file)<br />
<br />
== Javadoc, Documentation ==<br />
<br />
Javadoc:<br />
* All public and protected methods must have javadoc, except for getters and setters which do not do more than just set/get a value.<br />
* There must be javadoc in the class header.<br />
<br />
The following guidelines should be followed when documenting code:<br />
* comment special cases in the code or special conditions/invariants<br />
* rather use clear and describing variable and method names than comments<br />
* always add comments to empty catch blocks<br />
* use common sense<br />
<br />
== Formatting and compiling settings ==<br />
<br />
Each plugin project has to use the same settings for formatting as in the org.eclipse.emf.texo project. Specifically in the project properties:<br />
* Java Code Style > Clean Up: 'Enable project specific settings' has to be checked and use the Texo profile (which can be found in the Texo Develop project).<br />
* Java Code Style > Formatter: 'Enable project specific settings' has to be checked and use the Texo profile (which can be found in the Texo Develop project).<br />
* Java Compiler: 'Enable project specific settings' has to be checked and use the J2SE-1.5 as specified in the plugin (see below)<br />
* Java Editor > Save Action: 'Enable project specific settings' has to be checked and has to be set in the same way as in the org.eclipse.emf.texo project<br />
* Plug-in Development > Plug-in Manifest Compiler: has to be set in the same was as in the org.eclipse.emf.texo project<br />
<br />
== Plugin and Feature setup ==<br />
<br />
See also this description for standards for [[Modeling_Project_Releng/Plugin_And_Feature_Files|Features and Plugins]] of the Modeling project and these guidelines from the [[Common_Build_Infrastructure/Getting_Started/FAQ/Plugin_Health_And_Best_Practices|Common-Build-Infrastructure]].<br />
<br />
A summary: <br />
<br />
When creating a new plugin/feature for Texo then the same structure has to be followed as is visible in the org.eclipse.emf.texo plugin and feature. The following files should be present in the root:<br />
* about.html<br />
* copyright.txt<br />
* epl-v10.html<br />
* license.html<br />
* plugin.properties with pluginName and providerName externalized<br />
<br />
A feature project has the following additional files:<br />
* about.ini<br />
* about.properties<br />
* modeling32.png<br />
<br />
The version of the plugin and feature have to end with .qualifier (for example 0.1.0.qualifier). <br />
<br />
The build.properties should include all these files in the build.<br />
<br />
All plugins should use the J2SE-1.5 execution environment.<br />
<br />
All the above files can be copied from the org.eclipse.emf.texo plugin/feature project.<br />
<br />
== Eclipse Components and Projects used by Texo ==<br />
<br />
* [http://www.eclipse.org/modeling/emf/?project=emf EMF Ecore]: for runtime model support<br />
* [http://www.eclipse.org/modeling/emf/?project=emf EMF XMI/XML]: for XML Serialization<br />
* [http://www.eclipse.org/modeling/m2t/?project=xpand Xpand/Xtend]: for code generation<br />
* JMerge (part of EMF): for merging generated code with manually changed code<br />
* JDT: for postprocessing of generated classes (organize imports)<br />
<br />
The build environment has been setup using [http://www.eclipse.org/buckminster/ Buckminster] and [http://hudson-ci.org/ Hudson].<br />
<br />
== Interesting links ==<br />
<br />
Here are links related to coding practices:<br />
* http://www.slideshare.net/srikanthps/practices-for-becoming-a-better-programmer-presentation?src=related_normal&rel=1443810</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo&diff=375779Texo2014-12-27T12:13:50Z<p>Mtaal.springsite.com: /* Future Topics */</p>
<hr />
<div>==Introduction==<br />
'''Texo''' supports EMF-model concepts in (web)server environments through JPA-annotated code generation and JSON web service functionality at runtime. <br />
<br />
For the latest news on Texo visit the [http://martintaal.wordpress.com/category/texo/ Texo blog].<br />
<br />
Texo uses components currently present in the [http://www.eclipse.org/emf Eclipse Modeling Framework (EMF)] and [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] projects. <br />
<br />
Texo (incubation) is an open source component in the [http://www.eclipse.org/modeling/emft/ Eclipse Modeling Framework Technology (EMFT)] project.<br />
<br />
<br />
[[Image:texo-client-server.png|center|600px]]<br />
<br />
== Benefits of using Texo ==<br />
<br />
Benefits of using current Texo (November 2012):<br />
* Code Generation:<br />
** [[#Code_generation_topics|Generates]]''' true pojo's from an Ecore/Xcore model or XSD''' without direct compile time link from generated entities to EMF, Texo or other framework types. '''Facilitates integration of EMF concepts with other frameworks''' such as Google Web Toolkit or Object Relational Mapping solutions<br />
** Supports '''manual change of generated code''' (the same approach as EMF)<br />
** '''[[Template_Overriding|Overridable and Extendable code generation]]''' with support for EMF-like merge, formatting, import-organizing<br />
<br />
* '''[[#ORM.2FJPA_generation_topics|ORM/JPA generation]]''', Texo generates JPA annotations in the source code or can generate the orm.xml mapping from the ecore/xcore models, there are specific JPA model annotations which can be used to control JPA/ORM generation.<br />
<br />
* Supports most '''XML Schema constructs''' (as EMF)<br />
<br />
* Generic CRUD and Query web service layer: [[JSON_REST_Web_Services|JSON]] as well as [[XML_REST_Web_Services|XML]]<br />
<br />
* '''[[#Runtime_topics|Runtime support]]''': model@runtime, key to implementing generic functionality as security, archiving, query generation and generic web services.<br />
<br />
* [[Direct_Java_Annotations|Support]] for '''java annotations''' and '''annotations defined in the model''', to drive code generation and to be translated into java source code annotation<br />
<br />
New functionality which is being developed right now gives these additional benefits:<br />
* '''Multiple annotation models''' (JPA, Hibernate Search, etc.) supported<br />
* '''Generic RIA/HTML5 model maintenance UI''' <br />
<br />
These developments will give additional benefits in terms of increased developer productiviy and quality.<br />
<br />
== Download & Install ==<br />
<br />
Texo is installed through the Eclipse update manager. For more details see the [[Texo/Download_and_Install|Download & Install]] page.<br />
<br />
== Quick Start ==<br />
<br />
The [[Texo/QuickStart|quick start]] page lets you generate code in just a few steps...<br />
<br />
== Documentation ==<br />
<br />
The following pages contain detailed information on different parts of the Texo solution. <br />
<br />
=== Blog ===<br />
For general announcement and other information visit the [http://martintaal.wordpress.com/category/texo/ Texo Blog].<br />
<br />
=== Code generation topics ===<br />
* [[Texo/Generate_Artifacts|Code Generation Introduction]]: describes how to generate code from one or more xsd/ecore/xcore files.<br />
* [[Texo/Code_Generation_Details|Code Generation Details]]: describes how the code generation can be controlled in detail by annotating the model.<br />
* [[Texo/Automatic_Code_Generation|Automatic Code Generation]]: code can be generated automatically when a model file is changed.<br />
* [[Texo/Integrate code generation in a build|Generate code as part of a build]]: discusses how you can integrate Texo artifact generation within your automated build process.<br />
* [[Texo/Code_Generation_Patterns|Code Generation Patterns]]: discusses several common code generation patterns which are supported by Texo (as a default or through setting annotations).<br />
* [[Texo/Template_Overriding|Extending/Overriding Code generation]]: discusses how the Texo templates can be overridden in a development project, while still maintaining the advantages of using Texo (EMF-like-merge, organize-import, formatting).<br />
* [[Texo/Direct_Java_Annotations|Java annotations from model-to-code]]: Texo can transfer java annotations defined in the model into the generated code.<br />
<br />
=== ORM/JPA generation topics ===<br />
* [[Texo/Generate_JPA-ORM_Introduction|ORM/JPA Generation Introduction]]: introduces the ORM generation implemented by Texo.<br />
* [[Texo/ORM_JPA_Options|ORM/JPA Generation Options]]: you can set generation options at development project level.<br />
* [[Texo/ORM_JPA_Annotations_Details|ORM/JPA Annotations Model]]: for even more control on ORM/JPA generation, the model can be annotated with ORM/JPA annotations.<br />
<br />
=== Runtime topics ===<br />
<br />
==== JPA/Persistence integration ====<br />
* [[Texo/EntityManagerHandling|EntityManager]]: describes how Texo generated code and Texo framework code integrates with the EntityManagerFactory.<br />
* [[Texo/Dao|DAO support, Texo generated Dao classes]]: Texo is capable of generating Dao classes which make it easier to query and access objects in the database, in addition the generated Dao classes support cross referencing functionality. <br />
* [[Texo/ObjectStore|Object Store concept]]: the object store integrates the Texo model layer with the JPA layer. You can query the database using EClasses and do cross-reference checks.<br />
<br />
==== XML/JSON REST Web Service Support ====<br />
* [[Texo/JSON_REST_Web_Services|JSON REST Web Services]]<br />
* [[Texo/XML_REST_Web_Services|XML REST Web Services]]<br />
<br />
==== Framework ====<br />
* [[Texo/Components|Components]]: discusses how you can replace internal Texo components with your own implementation to override specific Texo behavior.<br />
* [[Texo/Runtime_Model|Runtime Model]]: describes the runtime model access to Texo generated objects.<br />
<br />
==== RCP Persistence using EMF Resources and Texo ====<br />
* [[Texo/EMFResource|Texo EMF Resource]]: describes the implementation of Texo EMF resources allowing you to persist data from your RCP in a 2- and 3-tier architecture.<br />
<br />
==== EMF/XML/XMI ====<br />
* [[Texo/XML and XMI Serialization|XML-XMI Serialization]]: covers the main api to convert Texo generated pojo's from and to XML and XMI. <br />
* [[Texo/Convert to EMF|EMF Conversion]]: discusses the Texo-EMF conversion API which make it possible to convert any Texo generated pojo from/to an EObject. This is useful for when you want to make use of other EMF components like EMF Compare.<br />
* [[Texo/Xcore Support|Xcore Support]]: Texo supports xcore in the same way as standard ecore and xsd files. You can generate JPA annotated code, orm.xml etc. directly from an xcore file.<br />
<br />
==== Miscellaneous ====<br />
* [[Texo/Test_Data_Generation|Test data generation]]: Texo is tested with about 40 models, the test-cases involve conversion from and to EMF, XML and XMI. An important foundation of the test cases is the automatic generation of test data on the basis of the model. This gives a better test coverage and makes it very easy to add new test models to the system and integrate them in the main test runs.<br />
<br />
== Main Design Concepts ==<br />
<br />
The Texo project is based on a number of main design concepts and philosophies.<br />
* Annotated Models and Model Annotations: Texo uses annotated models for artifact generation. The goal is to support multiple annotation models (JPA, model oriented, etc.), model annotations can be converted to java annotations or other output. Annotations are set manually and further created by Model Annotators. <br />
* Runtime model: Texo (just as EMF) supports working with the domain model at runtime. Texo generates Model wrappers to give generated pojo's a Model api. <br />
* Working with generated artifacts: Texo follows the same philosophy as EMF: generated code can be manually changed, manual changes will be kept/maintained when re-generating the code.<br />
<br />
For a more detailed description visit the [[Texo/Design%20Concepts|Design Concepts]] page.<br />
<br />
== Texo and EMF ==<br />
<br />
Texo is related to EMF and makes use of specific EMF components. Both Texo and EMF generate java code representing an ecore model in Java. There are however several distinctive differences between the approach chosen and code generation implemented by EMF and Texo. This is covered in detail on [[Texo/Texo_and_EMF|this page]].<br />
<br />
== Support & Troubleshooting & Bugzilla ==<br />
<br />
For troubleshooting and issues encountered by other users see the [[Texo/Troubleshooting|trouble shooting]] page.<br />
<br />
To enter a new bugzilla you can use the following link:<br />
<br />
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EMFT&component=Texo&version=0.5<br />
<br />
Support is given on the EMFT newsgroup which you can find here:<br />
* nntp: news://news.eclipse.org/eclipse.technology.emft<br />
* forum: http://www.eclipse.org/forums/eclipse.technology.emft<br />
<br />
== Developing ==<br />
<br />
Developer information (GIT, how to setup a developers environment) can be found on the [[Texo/Developing|Developers]] page.<br />
<br />
== Future Topics ==<br />
<br />
This is a list of future topics which we may (or may not) work on in the future, it is a list of ideas:<br />
* Code/Artifact Generation:<br />
** Support JPA 2.1<br />
** Support Ecore/XCore generic types<br />
** Support Ecore/XCore operations<br />
** Support JAXB annotation generation<br />
** Add JPA/Texo annotation support in Xcore<br />
* Runtime Layer<br />
** Integrated with EMF Client Platform<br />
** Introduce service oriented architecture concepts, focusing on micro-service architectures<br />
** support for no-sql databases on the server side<br />
** integrate with OLAP/Mondrian solutions, back-end and front-end<br />
** develop a generic (and extendable) mobile/html5 model editor which can/should support most models out of the box<br />
** support code generation which generates separate source files which can be manually changed, so not following the @generated pattern used in standard EMF<br />
** use this generic model editor as a basis for a generated model editor in html5/mobile<br />
** integrate with full text indexing and search for the JSON/XML web service layer, incorporate this in the generic model editor<br />
<br />
Feel free to react on the EMFT newsgroup with more ideas.<br />
<br />
== See also ==<br />
<br />
* [[Teneo]]<br />
* [[CDO]]<br />
<br />
[[Category:EMFT]] [[Category:EMF]] [[Category:Texo]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo/Hibernate/Download_and_Install&diff=370567Teneo/Hibernate/Download and Install2014-09-19T08:08:48Z<p>Mtaal.springsite.com: /* Usage in Eclipse/OSGI: download and install using the update manager */</p>
<hr />
<div>__TOC__<br />
<br />
<br />
The installation method for Teneo depends on the target environment(Eclipse/OSGI or web container). Both cases are discussed on this page. This page also describes where to find the example projects used in the tutorials in the wiki. <br />
<br />
== Dependencies ==<br />
<br />
To run Teneo you need the following software:<br />
* EMF <br />
* Hibernate<br />
* JDBC driver<br />
<br />
Some dependencies can not be downloaded from eclipse.org because of licensing differences. Teneo provide update sites with the required dependencies (see below for the correct update site depending on your version).<br />
<br />
== Usage in Eclipse/OSGI: download and install using the update manager ==<br />
<br />
=== Plugins and dependencies, update site locations ===<br />
<br />
Teneo is delivered in the following versions:<br />
<br />
* '''2.0.0: EMF 2.7-2.8-2.9/Eclipse 3.7-3.8-4.2-4.3/Hibernate 4.1/JPA 2.0:'''<br />
** Teneo: http://download.eclipse.org/modeling/emf/teneo/updates/2.0.0/interim/<br />
** EMF: http://download.eclipse.org/releases/kepler<br />
** Hibernate and other dependencies: http://www.elver.org/eclipse/2.0.0/update<br />
<br />
* '''2.1.0: EMF 2.10/Eclipse 4.4/Hibernate 4.3.*/JPA 2.0:''' '''UNDER DEVELOPMENT - Winter 2014'''<br />
** Teneo: http://download.eclipse.org/modeling/emf/teneo/updates/2.1.0/interim/<br />
** EMF: http://download.eclipse.org/releases/luna<br />
** Hibernate and other dependencies: http://www.elver.org/eclipse/2.1.0/update<br />
<br />
'''The following update sites are no longer available''':<br />
** http://www.elver.org/eclipse/1.2.0/update<br />
** http://www.elver.org/eclipse/1.1.2/update<br />
<br />
'''Note: update site urls in the screenshots below maybe outdated, use the update site urls listed above.'''<br />
<br />
The EMF update site, select the EMF/XSD SDK:<br />
<br />
[[Image:org.eclipse.emf.teneo.install_emf.png|center|600px]]<br />
<br />
<br />
The Teneo update site will look similar to this image. Select the Teneo Hibernate SDK:<br />
<br />
<br />
[[Image:org.eclipse.emf.teneo.update.site.png|center|700px]]<br />
<br />
<br />
The elver update site lists the Hibernate, dom4j and a number of JDBC plugins. Select the followings, plus some connectors, depending on your needs :<br />
<br />
<br />
[[Image:org.eclipse.emf.teneo.install_dependency.png|center]]<br />
<br />
=== Creating your own Hibernate plugin ===<br />
<br />
If you want to make your own Hibernate/library plugin there is one specific setting which needs to be set in your plugin: make sure to add the following line to the MANIFEST.MF of the Hibernate/libraries plugin you create:<br />
<br />
'''Eclipse-BuddyPolicy: dependent'''<br />
<br />
This is required otherwise the Hibernate libraries can not find your model classes when performing runtime class enhancement. See [http://manuelselva.wordpress.com/2008/04/03/eclipse-and-hibernate-and-class-loaders/ here] for more information. Note that also other Eclipse-BuddyPolicy settings can be used (and can make sense in production environments) but the 'dependent' setting is the safest one.<br />
<br />
=== Teneo, import-packages and ClassNotFoundException when running junit testcases ===<br />
<br />
The Teneo and Hibernate plugins declare dependencies using import-packages. When running junit testcases as normal Java applications or standard junit tests then there is no OSGI environment which takes care of resolving these import-packages. This means that the import-package dependencies are not resolved and ClassNotFoundExceptions are thrown. <br />
<br />
This can be solved by explicitly declaring the dependency in the MANIFEST.MF of your test or model project. As an example: these are the dependendencies set in the examples project:<br />
<source lang="javascript"><br />
Require-Bundle: org.eclipse.core.runtime,<br />
org.eclipse.emf.ecore;visibility:=reexport,<br />
org.eclipse.emf.ecore.xmi;visibility:=reexport,<br />
org.eclipse.emf.teneo.hibernate;bundle-version="1.1.2",<br />
org.hibernate;bundle-version="3.3.2",<br />
org.eclipse.emf.ecore.change,<br />
org.apache.commons.logging,<br />
org.dom4j,<br />
org.hsqldb,<br />
com.mysql.jdbc<br />
</source><br />
<br />
== Usage in a Web Container - Maven ==<br />
<br />
For usage within a web container the following jar files are required. You can download these files from the plugins section on the [http://download.eclipse.org/modeling/emf/teneo/updates/1.2.0/interim/ update site] using your web browser, or you can use Maven (see below):<br />
<br />
=== Jars and Dependencies ===<br />
<br />
* '''Teneo jar files''':<br />
** org.eclipse.emf.teneo<br />
** org.eclipse.emf.teneo.annotations<br />
** org.eclipse.emf.teneo.hibernate<br />
** org.eclipse.emf.teneo.hibernate.mapper<br />
<br />
* '''EMF jar files''':<br />
** org.eclipse.emf.ecore<br />
** org.eclipse.emf.common<br />
** org.eclipse.emf.ecore.xmi<br />
<br />
* '''Dependencies''': Teneo depends on the [http://www.hibernate.org hibernate] and [http://commons.apache.org/logging/ commons-logging] jars (and a jdbc jar). You can find them in maven central or you can download directly from their respective websites.<br />
<br />
=== Maven ===<br />
<br />
Teneo and related EMF jar files are published in [http://search.maven.org/#search%7Cga%7C1%7Corg.eclipse.emf.teneo central maven] and in the [https://oss.sonatype.org/content/repositories/releases/org/eclipse/emf/ sonatype-snapshot] repository. All of them are published in the [http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.eclipse.emf%22 org.eclipse.emf] group.<br />
<br />
'''The Teneo pom files do not define explicit dependencies. This means that your pom files should list the EMF, commons-logging and hibernate jar file as dependencies.'''<br />
<br />
== Download Example Project for Tutorials ==<br />
<br />
The example project (org.eclipse.emf.teneo.hibernate.examples) can be found in git [http://git.eclipse.org/c/teneo/org.eclipse.emf.teneo.git/tree/hibernate/org.eclipse.emf.teneo.hibernate.examples here]. To clone the Teneo git repository execute this action:<br />
<br />
git clone git://git.eclipse.org/gitroot/teneo/org.eclipse.emf.teneo.git<br />
<br />
See [[Git|this page]] on how to work with Eclipse GIT repositories.<br />
<br />
The main examples project used in the tutorials is the: '''org.eclipse.emf.teneo.hibernate.examples''' project.<br />
<br />
This example project uses an extended version of the well-known EMF library example. The example project contains the generated model code and a number of tutorial classes showing how to work with EMF, Teneo and Hibernate.<br />
<br />
Some more details regarding the example project. The example project consists of the following:<br />
* an ecore model and genmodel (in the model subfolder)<br />
* generated model code (no manual changes done, so you can change the ecore model and regenerate the code)<br />
* a number of tutorial java classes in the org.eclipse.emf.teneo.hibernate.examples package<br />
<br />
The MANIFEST.MF of the examples project lists dependencies on several plugins, see the next section for more information on this.</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo&diff=370566Teneo2014-09-19T08:04:28Z<p>Mtaal.springsite.com: /* Documentation */</p>
<hr />
<div>__TOC__<br />
<br />
'''EMF & ORM''': Teneo is a Model-Relational mapping and runtime database persistence solution for the [http://www.eclipse.org/emf Eclipse Modeling Framework] (EMF). Teneo integrates EMF with both [http://www.hibernate.org Hibernate] and [http://www.eclipse.org/eclipselink EclipseLink].<br />
<br />
'''Web-service/Web-application''': If you want to work with EMF in a web environment or connect your RCP to a standard JPA web-server, consider using the '''EMFT Texo''' project, for more information see the [[Texo|Texo wiki]]. <br />
<br />
'''RCP''': if you want to develop a RCP with less emphasys on custom server side logic consider using [[CDO|CDO]]. Teneo is used for Model Relational mapping within the [[CDO_Hibernate_Store|CDO Hibernate Store]].<br />
<br />
'''RCP connected to a JPA compliant server''': if you want to connect your RCP to a standards compliant JPA (web-)server consider using the '''EMFT Texo''' project, for more information see the [[Texo|Texo wiki]]. <br />
<br />
==Features==<br />
* '''Powerful Tool Combination''': Teneo integrates EMF with existing persistency solutions, combining strong model-driven code generation functionality with the power of storage, caching and querying of sophisticated object-relational mapping and persistency software.<br />
* '''Flexible Approach''': Teneo automatically maps models to relational database schema. The mapping can be fully controlled, overridden and extended with JPA annotations in the model itself or in a separate xml file.<br />
* '''Extensive Coverage''': Teneo supports persistence of virtually every ecore model out-of-the-box without additional manual mapping work.<br />
* '''Server-Side-Solutions''': Teneo is primarily for server-oriented environments with business logic running on the server. Especially web-service solutions can benefit from the EMF XML (de-) serialization support combined with automatic Model-Relational mapping and runtime database persistence.<br />
<br />
==Documentation==<br />
For detailed information, manuals and tutorials for each solution visit the ORM specific part of the site:<br />
* '''[[Teneo/Hibernate|Hibernate]]''': The EMF - Hibernate integration supports persisting of basic EObjects, ELists with 1:n, n:m, one-way, two-way and contained relations. EMF Objects can be retrieved using HQL queries. For more information see [[Teneo/Hibernate|here]]<br />
* '''[[Teneo/EclipseLink|EclipseLink]]''': The EMF - EclipseLink integration is a fully JPA compliant solution using the EclipseLink orm tool. For more information see [[Teneo/EclipseLink|here]]<br />
<br />
==Versions==<br />
Teneo supports the three current EMF versions:<br />
* EMF 2.7 (Eclipse 3.7): supported by Teneo version 2.0.0.<br />
* EMF 2.8 (Eclipse 3.8): supported by Teneo version 2.0.0.<br />
* EMF 2.9 (Eclipse 4.0-4.4): supported by Teneo versions 2.0.0 and 2.1.0 (under development for supporting Hibernate 4.3 and further).<br />
<br />
Currently (winter of 2014) Teneo is being upgraded to support Hibernate 4.3.5 and the build is updated to run on Eclipse Luna 4.4.<br />
<br />
== GIT, Support, Commit Mailing List and FAQ ==<br />
<br />
The Teneo source code is stored in git in this location:<br />
<br />
{{Git|teneo|org.eclipse.emf.teneo.git}}<br />
If you encounter issues, check the [[Teneo/Hibernate/FAQ|FAQ]] page. <br />
<br />
Support for Teneo is given on the [http://www.eclipse.org/modeling/emf/newsgroup-mailing-list.php EMF newsgroup]. For accessing the news group through a browser visit this [http://www.eclipse.org/forums/eclipse.tools.emf page]. To read newsgroups using a client application, install [http://pan.rebelbase.com/ Pan Newsreader] (<tt>pan</tt> Debian/Ubuntu package) or [http://knode.sourceforge.net/ KNode] (<tt>knode</tt> Debian/Ubuntu package).<br />
<br />
To subscribe to the commit mailing list, visit this page: https://dev.eclipse.org/mailman/listinfo/teneo-commit<br />
<br />
Before November 2011, source code was stored in cvs, the cvs repository has been converted to git, for your reference you can find the archived cvs repository [http://archive.eclipse.org/modeling/emf/teneo/teneo_cvs.tgz here].<br />
<br />
== Continuous Build == <br />
<br />
Teneo is build using [[Buckminster|Buckminster]] and [[Hudson|Hudson]] in a continuous build system.<br />
<br />
* [https://hudson.eclipse.org/hudson/job/emf-teneo-nightly/ Teneo nightly build job]<br />
* Detailed description on [[Teneo/Teneo_Build_Setup|Teneo's build setup]]<br />
<br />
Update site containing the latest successful nightly builds:<br />
https://hudson.eclipse.org/hudson/job/emf-teneo-nightly/lastSuccessfulBuild/artifact/build/result/p2site/<br />
<br />
[[Category:Teneo]][[Category:EMF]][[Category:Hibernate]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo&diff=370565Teneo2014-09-19T08:04:03Z<p>Mtaal.springsite.com: /* Documentation */</p>
<hr />
<div>__TOC__<br />
<br />
'''EMF & ORM''': Teneo is a Model-Relational mapping and runtime database persistence solution for the [http://www.eclipse.org/emf Eclipse Modeling Framework] (EMF). Teneo integrates EMF with both [http://www.hibernate.org Hibernate] and [http://www.eclipse.org/eclipselink EclipseLink].<br />
<br />
'''Web-service/Web-application''': If you want to work with EMF in a web environment or connect your RCP to a standard JPA web-server, consider using the '''EMFT Texo''' project, for more information see the [[Texo|Texo wiki]]. <br />
<br />
'''RCP''': if you want to develop a RCP with less emphasys on custom server side logic consider using [[CDO|CDO]]. Teneo is used for Model Relational mapping within the [[CDO_Hibernate_Store|CDO Hibernate Store]].<br />
<br />
'''RCP connected to a JPA compliant server''': if you want to connect your RCP to a standards compliant JPA (web-)server consider using the '''EMFT Texo''' project, for more information see the [[Texo|Texo wiki]]. <br />
<br />
==Features==<br />
* '''Powerful Tool Combination''': Teneo integrates EMF with existing persistency solutions, combining strong model-driven code generation functionality with the power of storage, caching and querying of sophisticated object-relational mapping and persistency software.<br />
* '''Flexible Approach''': Teneo automatically maps models to relational database schema. The mapping can be fully controlled, overridden and extended with JPA annotations in the model itself or in a separate xml file.<br />
* '''Extensive Coverage''': Teneo supports persistence of virtually every ecore model out-of-the-box without additional manual mapping work.<br />
* '''Server-Side-Solutions''': Teneo is primarily for server-oriented environments with business logic running on the server. Especially web-service solutions can benefit from the EMF XML (de-) serialization support combined with automatic Model-Relational mapping and runtime database persistence.<br />
<br />
==Documentation==<br />
For detailed information, manuals and tutorials for each solution visit the ORM specific part of the site:<br />
* '''[[Teneo/Hibernate|Hibernate]]''': The EMF - Hibernate integration supports persisting of basic EObjects, ELists with 1:n, n:m, one-way, two-way and contained relations. EMF Objects can be retrieved using HQL queries. For more information see [[Teneo/Hibernate|here]]<br />
* '''[[Teneo/EclipseLink|EclipseLink]]''': The EMF - EclipseLink integration is a fully JPA compliant solution using the EclipseLink orm tool. For more information see [[Teneo/EclipseLink|here]], NOTE: '''Not supported anymore'''<br />
<br />
==Versions==<br />
Teneo supports the three current EMF versions:<br />
* EMF 2.7 (Eclipse 3.7): supported by Teneo version 2.0.0.<br />
* EMF 2.8 (Eclipse 3.8): supported by Teneo version 2.0.0.<br />
* EMF 2.9 (Eclipse 4.0-4.4): supported by Teneo versions 2.0.0 and 2.1.0 (under development for supporting Hibernate 4.3 and further).<br />
<br />
Currently (winter of 2014) Teneo is being upgraded to support Hibernate 4.3.5 and the build is updated to run on Eclipse Luna 4.4.<br />
<br />
== GIT, Support, Commit Mailing List and FAQ ==<br />
<br />
The Teneo source code is stored in git in this location:<br />
<br />
{{Git|teneo|org.eclipse.emf.teneo.git}}<br />
If you encounter issues, check the [[Teneo/Hibernate/FAQ|FAQ]] page. <br />
<br />
Support for Teneo is given on the [http://www.eclipse.org/modeling/emf/newsgroup-mailing-list.php EMF newsgroup]. For accessing the news group through a browser visit this [http://www.eclipse.org/forums/eclipse.tools.emf page]. To read newsgroups using a client application, install [http://pan.rebelbase.com/ Pan Newsreader] (<tt>pan</tt> Debian/Ubuntu package) or [http://knode.sourceforge.net/ KNode] (<tt>knode</tt> Debian/Ubuntu package).<br />
<br />
To subscribe to the commit mailing list, visit this page: https://dev.eclipse.org/mailman/listinfo/teneo-commit<br />
<br />
Before November 2011, source code was stored in cvs, the cvs repository has been converted to git, for your reference you can find the archived cvs repository [http://archive.eclipse.org/modeling/emf/teneo/teneo_cvs.tgz here].<br />
<br />
== Continuous Build == <br />
<br />
Teneo is build using [[Buckminster|Buckminster]] and [[Hudson|Hudson]] in a continuous build system.<br />
<br />
* [https://hudson.eclipse.org/hudson/job/emf-teneo-nightly/ Teneo nightly build job]<br />
* Detailed description on [[Teneo/Teneo_Build_Setup|Teneo's build setup]]<br />
<br />
Update site containing the latest successful nightly builds:<br />
https://hudson.eclipse.org/hudson/job/emf-teneo-nightly/lastSuccessfulBuild/artifact/build/result/p2site/<br />
<br />
[[Category:Teneo]][[Category:EMF]][[Category:Hibernate]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo&diff=370564Teneo2014-09-19T08:03:30Z<p>Mtaal.springsite.com: /* Versions */</p>
<hr />
<div>__TOC__<br />
<br />
'''EMF & ORM''': Teneo is a Model-Relational mapping and runtime database persistence solution for the [http://www.eclipse.org/emf Eclipse Modeling Framework] (EMF). Teneo integrates EMF with both [http://www.hibernate.org Hibernate] and [http://www.eclipse.org/eclipselink EclipseLink].<br />
<br />
'''Web-service/Web-application''': If you want to work with EMF in a web environment or connect your RCP to a standard JPA web-server, consider using the '''EMFT Texo''' project, for more information see the [[Texo|Texo wiki]]. <br />
<br />
'''RCP''': if you want to develop a RCP with less emphasys on custom server side logic consider using [[CDO|CDO]]. Teneo is used for Model Relational mapping within the [[CDO_Hibernate_Store|CDO Hibernate Store]].<br />
<br />
'''RCP connected to a JPA compliant server''': if you want to connect your RCP to a standards compliant JPA (web-)server consider using the '''EMFT Texo''' project, for more information see the [[Texo|Texo wiki]]. <br />
<br />
==Features==<br />
* '''Powerful Tool Combination''': Teneo integrates EMF with existing persistency solutions, combining strong model-driven code generation functionality with the power of storage, caching and querying of sophisticated object-relational mapping and persistency software.<br />
* '''Flexible Approach''': Teneo automatically maps models to relational database schema. The mapping can be fully controlled, overridden and extended with JPA annotations in the model itself or in a separate xml file.<br />
* '''Extensive Coverage''': Teneo supports persistence of virtually every ecore model out-of-the-box without additional manual mapping work.<br />
* '''Server-Side-Solutions''': Teneo is primarily for server-oriented environments with business logic running on the server. Especially web-service solutions can benefit from the EMF XML (de-) serialization support combined with automatic Model-Relational mapping and runtime database persistence.<br />
<br />
==Documentation==<br />
For detailed information, manuals and tutorials for each solution visit the ORM specific part of the site:<br />
* '''[[Teneo/Hibernate|Hibernate]]''': The EMF - Hibernate integration supports persisting of basic EObjects, ELists with 1:n, n:m, one-way, two-way and contained relations. EMF Objects can be retrieved using HQL queries. For more information see [[Teneo/Hibernate|here]]<br />
* '''[[Teneo/EclipseLink|EclipseLink]]''': The EMF - EclipseLink integration is a fully JPA compliant solution using the EclipseLink orm tool. For more information see [[Teneo/EclipseLink|here]]<br />
<br />
==Versions==<br />
Teneo supports the three current EMF versions:<br />
* EMF 2.7 (Eclipse 3.7): supported by Teneo version 2.0.0.<br />
* EMF 2.8 (Eclipse 3.8): supported by Teneo version 2.0.0.<br />
* EMF 2.9 (Eclipse 4.0-4.4): supported by Teneo versions 2.0.0 and 2.1.0 (under development for supporting Hibernate 4.3 and further).<br />
<br />
Currently (winter of 2014) Teneo is being upgraded to support Hibernate 4.3.5 and the build is updated to run on Eclipse Luna 4.4.<br />
<br />
== GIT, Support, Commit Mailing List and FAQ ==<br />
<br />
The Teneo source code is stored in git in this location:<br />
<br />
{{Git|teneo|org.eclipse.emf.teneo.git}}<br />
If you encounter issues, check the [[Teneo/Hibernate/FAQ|FAQ]] page. <br />
<br />
Support for Teneo is given on the [http://www.eclipse.org/modeling/emf/newsgroup-mailing-list.php EMF newsgroup]. For accessing the news group through a browser visit this [http://www.eclipse.org/forums/eclipse.tools.emf page]. To read newsgroups using a client application, install [http://pan.rebelbase.com/ Pan Newsreader] (<tt>pan</tt> Debian/Ubuntu package) or [http://knode.sourceforge.net/ KNode] (<tt>knode</tt> Debian/Ubuntu package).<br />
<br />
To subscribe to the commit mailing list, visit this page: https://dev.eclipse.org/mailman/listinfo/teneo-commit<br />
<br />
Before November 2011, source code was stored in cvs, the cvs repository has been converted to git, for your reference you can find the archived cvs repository [http://archive.eclipse.org/modeling/emf/teneo/teneo_cvs.tgz here].<br />
<br />
== Continuous Build == <br />
<br />
Teneo is build using [[Buckminster|Buckminster]] and [[Hudson|Hudson]] in a continuous build system.<br />
<br />
* [https://hudson.eclipse.org/hudson/job/emf-teneo-nightly/ Teneo nightly build job]<br />
* Detailed description on [[Teneo/Teneo_Build_Setup|Teneo's build setup]]<br />
<br />
Update site containing the latest successful nightly builds:<br />
https://hudson.eclipse.org/hudson/job/emf-teneo-nightly/lastSuccessfulBuild/artifact/build/result/p2site/<br />
<br />
[[Category:Teneo]][[Category:EMF]][[Category:Hibernate]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo/Hibernate/Download_and_Install&diff=370563Teneo/Hibernate/Download and Install2014-09-19T08:00:00Z<p>Mtaal.springsite.com: /* Usage in Eclipse/OSGI: download and install using the update manager */</p>
<hr />
<div>__TOC__<br />
<br />
<br />
The installation method for Teneo depends on the target environment(Eclipse/OSGI or web container). Both cases are discussed on this page. This page also describes where to find the example projects used in the tutorials in the wiki. <br />
<br />
== Dependencies ==<br />
<br />
To run Teneo you need the following software:<br />
* EMF <br />
* Hibernate<br />
* JDBC driver<br />
<br />
Some dependencies can not be downloaded from eclipse.org because of licensing differences. Teneo provide update sites with the required dependencies (see below for the correct update site depending on your version).<br />
<br />
== Usage in Eclipse/OSGI: download and install using the update manager ==<br />
<br />
=== Plugins and dependencies, update site locations ===<br />
<br />
Teneo is delivered in the following versions:<br />
<br />
* '''2.0.0: EMF 2.7-2.8-2.9/Eclipse 3.7-3.8-4.2-4.3/Hibernate 4.*/JPA 2.0:'''<br />
** Teneo: http://download.eclipse.org/modeling/emf/teneo/updates/2.0.0/interim/<br />
** EMF: http://download.eclipse.org/modeling/emf/emf/updates<br />
** Hibernate and other dependencies: http://www.elver.org/eclipse/2.0.0/update<br />
<br />
'''The following update sites are no longer available''':<br />
** http://www.elver.org/eclipse/1.2.0/update<br />
** http://www.elver.org/eclipse/1.1.2/update<br />
<br />
'''Note: update site urls in the screenshots below maybe outdated, use the update site urls listed above.'''<br />
<br />
The EMF update site, select the EMF/XSD SDK:<br />
<br />
[[Image:org.eclipse.emf.teneo.install_emf.png|center|600px]]<br />
<br />
<br />
The Teneo update site will look similar to this image. Select the Teneo Hibernate SDK:<br />
<br />
<br />
[[Image:org.eclipse.emf.teneo.update.site.png|center|700px]]<br />
<br />
<br />
The elver update site lists the Hibernate, dom4j and a number of JDBC plugins. Select the followings, plus some connectors, depending on your needs :<br />
<br />
<br />
[[Image:org.eclipse.emf.teneo.install_dependency.png|center]]<br />
<br />
=== Creating your own Hibernate plugin ===<br />
<br />
If you want to make your own Hibernate/library plugin there is one specific setting which needs to be set in your plugin: make sure to add the following line to the MANIFEST.MF of the Hibernate/libraries plugin you create:<br />
<br />
'''Eclipse-BuddyPolicy: dependent'''<br />
<br />
This is required otherwise the Hibernate libraries can not find your model classes when performing runtime class enhancement. See [http://manuelselva.wordpress.com/2008/04/03/eclipse-and-hibernate-and-class-loaders/ here] for more information. Note that also other Eclipse-BuddyPolicy settings can be used (and can make sense in production environments) but the 'dependent' setting is the safest one.<br />
<br />
=== Teneo, import-packages and ClassNotFoundException when running junit testcases ===<br />
<br />
The Teneo and Hibernate plugins declare dependencies using import-packages. When running junit testcases as normal Java applications or standard junit tests then there is no OSGI environment which takes care of resolving these import-packages. This means that the import-package dependencies are not resolved and ClassNotFoundExceptions are thrown. <br />
<br />
This can be solved by explicitly declaring the dependency in the MANIFEST.MF of your test or model project. As an example: these are the dependendencies set in the examples project:<br />
<source lang="javascript"><br />
Require-Bundle: org.eclipse.core.runtime,<br />
org.eclipse.emf.ecore;visibility:=reexport,<br />
org.eclipse.emf.ecore.xmi;visibility:=reexport,<br />
org.eclipse.emf.teneo.hibernate;bundle-version="1.1.2",<br />
org.hibernate;bundle-version="3.3.2",<br />
org.eclipse.emf.ecore.change,<br />
org.apache.commons.logging,<br />
org.dom4j,<br />
org.hsqldb,<br />
com.mysql.jdbc<br />
</source><br />
<br />
== Usage in a Web Container - Maven ==<br />
<br />
For usage within a web container the following jar files are required. You can download these files from the plugins section on the [http://download.eclipse.org/modeling/emf/teneo/updates/1.2.0/interim/ update site] using your web browser, or you can use Maven (see below):<br />
<br />
=== Jars and Dependencies ===<br />
<br />
* '''Teneo jar files''':<br />
** org.eclipse.emf.teneo<br />
** org.eclipse.emf.teneo.annotations<br />
** org.eclipse.emf.teneo.hibernate<br />
** org.eclipse.emf.teneo.hibernate.mapper<br />
<br />
* '''EMF jar files''':<br />
** org.eclipse.emf.ecore<br />
** org.eclipse.emf.common<br />
** org.eclipse.emf.ecore.xmi<br />
<br />
* '''Dependencies''': Teneo depends on the [http://www.hibernate.org hibernate] and [http://commons.apache.org/logging/ commons-logging] jars (and a jdbc jar). You can find them in maven central or you can download directly from their respective websites.<br />
<br />
=== Maven ===<br />
<br />
Teneo and related EMF jar files are published in [http://search.maven.org/#search%7Cga%7C1%7Corg.eclipse.emf.teneo central maven] and in the [https://oss.sonatype.org/content/repositories/releases/org/eclipse/emf/ sonatype-snapshot] repository. All of them are published in the [http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.eclipse.emf%22 org.eclipse.emf] group.<br />
<br />
'''The Teneo pom files do not define explicit dependencies. This means that your pom files should list the EMF, commons-logging and hibernate jar file as dependencies.'''<br />
<br />
== Download Example Project for Tutorials ==<br />
<br />
The example project (org.eclipse.emf.teneo.hibernate.examples) can be found in git [http://git.eclipse.org/c/teneo/org.eclipse.emf.teneo.git/tree/hibernate/org.eclipse.emf.teneo.hibernate.examples here]. To clone the Teneo git repository execute this action:<br />
<br />
git clone git://git.eclipse.org/gitroot/teneo/org.eclipse.emf.teneo.git<br />
<br />
See [[Git|this page]] on how to work with Eclipse GIT repositories.<br />
<br />
The main examples project used in the tutorials is the: '''org.eclipse.emf.teneo.hibernate.examples''' project.<br />
<br />
This example project uses an extended version of the well-known EMF library example. The example project contains the generated model code and a number of tutorial classes showing how to work with EMF, Teneo and Hibernate.<br />
<br />
Some more details regarding the example project. The example project consists of the following:<br />
* an ecore model and genmodel (in the model subfolder)<br />
* generated model code (no manual changes done, so you can change the ecore model and regenerate the code)<br />
* a number of tutorial java classes in the org.eclipse.emf.teneo.hibernate.examples package<br />
<br />
The MANIFEST.MF of the examples project lists dependencies on several plugins, see the next section for more information on this.</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo/Hibernate/FAQ&diff=370315Teneo/Hibernate/FAQ2014-09-15T11:43:01Z<p>Mtaal.springsite.com: /* Troubleshooting the OR Mapper Menu Option */</p>
<hr />
<div>__TOC__<br />
<br />
===Lazy loading (Hibernate Proxying) of many-to-one does not work===<br />
To get lazy loading of many-to-one associations working you have to set the option: [[Teneo/Hibernate/Configuration_Options|SET_PROXY]] to "true". <br />
<br />
Also you need to have 'resolve proxies' to false in your model for the association, otherwise EMF will force a load by calling several methods on the proxied object.<br />
<br />
===Mapping Exception Unknown Entity===<br />
This exception is thrown when building the EntityManagerFactory. The entityPersistors in the Hibernate session are all keyed by the mapping's entity-name. In Teneo/EMF's case, the eClass name is the key, but Hibernate tries to use the impl class name as the key. <br />
<br />
See [http://www.eclipse.org/forums/index.php?t=tree&th=168644&#page_top this post] on the forum. <br />
<br />
See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=241537 this bugzilla] for a workaround. Or try setting the following hibernate property:<br />
hibernate.ejb.metamodel.generation=disabled<br />
<br />
===Derby and Hibernate IDBag===<br />
Apparently the Hibernate Derby driver does not handle Hibernate idbags correctly. See this link [http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg37757.html here] for more information.<br />
<br />
===DB Schema constraint error using MS Sql===<br />
Teneo generates the names of foreign key constraints. MS Sql reports errors if the FK constraint name are the same as table names. See this post on the EMF newsgroup. The solution is to set the option: PersistenceOptions.SET_FOREIGN_KEY_NAME to "false".<br />
<br />
===Duplicate method exception with javaassist===<br />
This exception occurs when using the same EStructuralFeature name in different EClasses related through the same super EClass. There can also be other cases where this occurs.<br />
<br />
This seems to be a javaassist issue.<br />
<br />
At this point the solution is to use cglib instead of javassist. See this 292151 bugzilla for more information.<br />
<br />
===File Not Found Exception for a file called: document-v13.dtd===<br />
This exception occurs when initializing a datastore.<br />
<br />
It can happen when you have a xml file for annotations which contains illegal entities or entities which can not be resolved. For example . Check your annotations.xml and try again.<br />
<br />
Another reason why it can happen is that you have a DOCTYPE tag in the top of the xml:<br />
<br />
<source lang="xml"><br />
<!DOCTYPE persistence-mapping PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "document-v13.dtd"><br />
</source><br />
<br />
===Issue: too many tables in join sql statement===<br />
When there are many associations in a model then it is possible that you encounter a 'too many tables' exception when executing a query in hibernate. A possible workaround is to control the default fetch behavior of hibernate. For example the hibernate.max_fetch_depth option can be set to a lower value (its default is 3). See also the section: 19.1. Fetching strategies, in the hibernate manual.<br />
<br />
===Unknown Entity===<br />
This exception can occur when you try to use the getReference or get methods on the EntityManager/Session objects and you call these methods using the Interface class name or the Implementation clas name. To solve this Teneo has a special entity naming strategy: EntityInterfaceNameStrategy. This entity naming strategy will use the interface name as the entity-name. You can set this naming strategy through this call: yourDataStore.getExtensionManager().registerExtension(EntityNameStrategy.class.getName(), EntityInterfaceNameStrategy.class.getName()). This call should be done after the datastore was created but before it is initialized.<br />
<br />
<source lang="java"><br />
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1<br />
</source><br />
<br />
This exception can occur when using synthetic id's in combination with the creation of multiple session factories. For example when doing test runs with a database clean up between the test run. The exception occurs because the Idenfifier Cache, which is used by Teneo to handle synthetic id's, is not in-sync with the database.<br />
<br />
To solve this you have to clear the Identifier cache by calling: IdentifierCacheHandler.clear();<br />
<br />
===Troubleshooting the Mapping and Runtime layer/Hibernate===<br />
The runtime layer uses commons-logging for logging. Here you can find an example [[media:Teneo.log4j.properties.zip|log4j.properties]] file. This file should be placed directly in the src directory of your EMF Model project. Note: also check if Eclipse copies the file to your bin/build directory. For a plugin project this can be specified in the build.properties.<br />
<br />
The example log4j.properties also contains log4j settings for Hibernate.<br />
<br />
If you use the runtime layer within a plugin then log messages will not appear in the console. In this case check the error log view (Window > Show View > Error Log) or let the log messages be written to a file.<br />
<br />
===Troubleshooting the automatic in-memory mapping===<br />
The mapping is generated in memory. To view the mapping created by Teneo please call the method getMappingXML on the HbDataStore. The returned String contains the Hibernate mapping.<br />
<br />
===Troubleshooting the OR Mapper Menu Option===<br />
If an error popup is shown or no popup box appears after the OR Mapper plugin is finished then an application error has occured within the OR Mapper.<br />
<br />
When the console shows this exception: Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/emf/teneo/hibernate/mapper/GenerateHBM then you have not added the org.eclipse.emf.teneo.hibernate plugin to the dependencies of the model plugin.<br />
<br />
See also this forum post: https://www.eclipse.org/forums/index.php/t/315151/<br />
<br />
To analyze what the problem is first view the error log. The error log can be opened through: Window > Show View > Error Log. By doubleclicking on the lines in the error log you can get more information.<br />
<br />
===More debug information from Eclipse===<br />
As an extra debug enabling you can add the following line in the EMF editor plugin:<br />
<br />
org.eclipse.osgi.framework.debug.Debug.DEBUG_GENERAL = true;<br />
<br />
This will result in much more debugging information in the console.<br />
<br />
===Cut and Paste does not work in the Editor===<br />
Please look [[Teneo/Hibernate/EMF_Hibernate_Integration_Details#Move_an_EObject_between_EContainers_or_support_cut_and_paste_in_the_EMF_editor|here]].<br />
<br />
===Client-server scenario: when saving on the server always new objects are created or I get a duplicate key exception===<br />
What can be the case is that you did not explicitly model an id and/or version attribute in each type. Both are required to be modeled explicitly, see [[Teneo/Hibernate/Configuration_Options|here]].<br />
<br />
===Column name e_version not supported by database===<br />
Teneo will automatically add a version column to the database for each object. The default version column name is e_version. However not all databases support an _ in the column name. To set the version column name you can set an option as explained [[Teneo/Hibernate/Configuration_Options|here]].<br />
<br />
===Column names too long===<br />
Teneo creates foreign key column names by concatenating the name of the (e)class and the property name. The result can be a column name which is too long for certain databases. You can control the maximum column name length by setting the relevant runtime option, see [[Teneo/Hibernate/Configuration_Options|here]].<br />
<br />
===org.hibernate.DuplicateMappingException: Duplicate class/entitymapping===<br />
This exception occurs when two EClasses (of different EPackages) have the same name. To solve this you need to direct Teneo to use qualified EClass names, see here. Note that when using qualified EClass names that also HQL needs to use the qualified EClass names. The EClass names are qualified by prepending the nsprefix of the EPackage with a dot (.) as a separator.<br />
<br />
===Created new model through new model wizard: diagnostic error===<br />
The generated EMF model wizard allows invalid documents. When going through the wizard you need to select a type to create as the first document in the resource. The EMF model wizard creates an empty (all members are null) instance of this type and adds it to the Hibernate resource. Before the Hibernate resource is saved it checks if the content of the resource is valid. When nullable-constraints are violated a StoreValidationException (with Diagnostics) is thrown.<br />
<br />
To solve this you should make your model more relaxed (make elements nullable) or add a small amount of code, which sets the non-nullable fields, to the model wizard. An example of this last solution is illustrated in the [[Teneo/Hibernate/Library_Tutorial|Tutorial]].<br />
<br />
===java.lang.NoClassDefFoundError when starting/initializing runtime layer===<br />
When your model is divided over different projects/plugins then the dependency on org.eclipse.emf.teneo.hibernate has to be set in the project with the 'widest' classpath (the project with a classpath containing the other plugins). For example if you have the following two emf projects:<br />
* Core<br />
* Specific (which uses/imports Core)<br />
<br />
Then the dependency should preferably be in the META-INF of the 'Specific' project. This is required otherwise Hibernate will not see the 'Specific' project.<br />
<br />
===No class def found: org.hibernate.proxy.ProxyFactory===<br />
This exception can occur when your classes have been enhanced by JPOX and you try to persist them via hibernate. Another reason can be that the name you used to register the SessionFactory does not correspond to the expected extension (e.g. library).<br />
<br />
===Could not determine type for: org.eclipse.emf.common.util.AbstractEnumerator, for columns: [org.hibernate.mapping.Column(enu)]===<br />
This exception can occur when you have a enumerate object type in your model. An enumerate object type differs from a standard enumerate because it has a nillable="true" attribute on the element, for example:<br />
<br />
<source lang="xml"><br />
<element name="enu" type="this:SimpleEnum" nillable="true"/><br />
<br />
<simpleType name="SimpleEnum"><br />
<restriction base="xsd:NCName"><br />
<enumeration value="Enum1"/><br />
<enumeration value="Enum2"/><br />
</restriction><br />
</simpleType><br />
</source><br />
<br />
As a workaround add an Enumerated annotation (see ejb3 annotations on this site) to the element.<br />
<br />
===The resource is empty in the generated editor===<br />
The standard behavior of a Hibernate resource is to only read types which have no container in the model. All other EObjects can be reached from these top-entities. However, this means that even if an EObject instance does not have a container but can be contained according to the model then it will still not be loaded in the resource. A common model is a an object which contains itself, for example a folder-like model. Workaround: to workaround this issue you should load the resource using specific queries, see [[Teneo/Hibernate/EMF_Resource|customizing load behavior]].<br />
<br />
===Update manager does not find the upgrade of the EMF Hibernate plugin===<br />
As a workaround use find new features to install a new version of the EMF Hibernate plugin.<br />
<br />
===Editor does not start, the error log gives a sql error 'Missing column....'===<br />
This can occur if your model has changed or you just upgraded the OR Mapper plugin and have generated a new hibernate.hbm.xml file. Before upgrading it is best to export the current database (see the relevant methods in the data store). After exporting start with a new database and re-import the data (through the relevant methods in the datastore).<br />
<br />
===Editor does not start, ClassNotFoundException on the Editor Plugin===<br />
This can happen when the Hibernate libraries can not find the model classes. You can check if you have set the BuddyPolicy in the Manifest.MF of the plugin containing the Hibernate jar files. If not add the following to the Manifest.MF of the plugin containing the Hibernate jar files: <br />
Eclipse-BuddyPolicy: dependent<br />
<br />
===Editor does not start, AssertionFailedException===<br />
When you start the editor you get the following exteption (stacktrace truncated):<br />
<br />
<source lang="java"><br />
org.eclipse.core.runtime.AssertionFailedException: assertion failed: <br />
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:109)<br />
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:95)<br />
at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:688)<br />
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:280) <br />
</source><br />
<br />
You probably started the editor with an empty database, the editor does not support this. You should have at least one root object in the database (for example a Library object in the Library tutorial).<br />
<br />
===Properties are not editable with EMF generated property editor===<br />
If you store the .ehb file within the plugin and open the EMF editor using different urls there are situations that the editor opens in read-only mode.<br />
<br />
If the url is opened as follows: FileLocator.find(Activator.getDefault().getBundle(), new Path("myfile.ehb"), null). Then the property editor does not allow any modifications.<br />
<br />
If however, the editor is opened using a 'file:/' based URL (file://myfile.ehb), then the EMF property editor works as expected.<br />
<br />
The first situation can be solved by creating a class similar to this one:<br />
<br />
<source lang="java"><br />
public class CustomAdapterFactoryEditingDomain extends<br />
AdapterFactoryEditingDomain {<br />
public CustomAdapterFactoryEditingDomain(AdapterFactory adapterFactory,<br />
CommandStack commandStack,<br />
Map<Resource, Boolean> resourceToReadOnlyMap) {<br />
super(adapterFactory, commandStack, resourceToReadOnlyMap);<br />
}<br />
<br />
@Override<br />
protected boolean isReadOnlyURI(URI uri) {<br />
return super.isReadOnlyURI(uri)<br />
&& !uri.fileExtension().equals("ehb");<br />
}<br />
}<br />
</source><br />
<br />
And using an instance of this class as the editingDomain in the initializeEditingDomain() method of the EMF generated XXXEditor class:<br />
<br />
<source lang="java"><br />
protected void initializeEditingDomain() {<br />
.........<br />
.........<br />
editingDomain = new CustomAdapterFactoryEditingDomain(adapterFactory,<br />
commandStack, new HashMap<Resource, Boolean>());<br />
}<br />
</source><br />
<br />
Reported and solution by Florian Hackenberger.<br />
<br />
===Validation exception on enumerate properties when saving the editor content===<br />
Symptom: a validation error is thrown (see the console) that certain enumerate fields have not been set.<br />
<br />
Cause: the EMF validator incorrectly enforces that the value of an enumerate field should not be the same as the default value.<br />
<br />
Solution: is an EMF issue which has been solved (see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=104723 here]). Upgrading EMF to a 2.2 or a later 2.1 release solves this.<br />
<br />
===Stacktraces when starting Eclipse with already open EMF editor===<br />
Symptom: This occurs when keeping an EMF generated editor open when closing eclipse and then starting eclipse again. When starting Eclipse again you see many stack traces in the console with messages like: class not found exception: org/hibernate/proxy/proxy.<br />
<br />
Consequence: The editor will open correctly and can be used. The only 'consequence' is that the data is not lazily loaded.<br />
<br />
Solution: A solution has been implemented in release 0.2.0.1.<br />
<br />
===Teneo does not see my changes in the ecore model===<br />
Teneo uses the runtime version of the ecore model. The runtime version is present as java code in the generated EPackage implementation class. This runtime ecore can differ from the ecore file when the model code is not regenerated after a change in the ecore file. To let Teneo use the changes in the ecore file the model code needs to be regenerated.<br />
<br />
===JoinTable name clash===<br />
If you have two EReferences between two EClasses then it is possible that you will get a jointable name clash. To prevent this set the PersistenceOptions.JOIN_TABLE_NAMING_STRATEGY to unique (see [[Teneo/Hibernate/Configuration_Options|here]]).</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo/Hibernate/Download_and_Install&diff=365102Teneo/Hibernate/Download and Install2014-06-15T20:59:36Z<p>Mtaal.springsite.com: </p>
<hr />
<div>__TOC__<br />
<br />
<br />
The installation method for Teneo depends on the target environment(Eclipse/OSGI or web container). Both cases are discussed on this page. This page also describes where to find the example projects used in the tutorials in the wiki. <br />
<br />
== Dependencies ==<br />
<br />
To run Teneo you need the following software:<br />
* EMF <br />
* Hibernate<br />
* JDBC driver<br />
<br />
Some dependencies can not be downloaded from eclipse.org because of licensing differences. Teneo provide update sites with the required dependencies (see below for the correct update site depending on your version).<br />
<br />
== Usage in Eclipse/OSGI: download and install using the update manager ==<br />
<br />
=== Plugins and dependencies, update site locations ===<br />
<br />
Teneo is delivered in the following versions:<br />
<br />
* '''2.0.0: EMF 2.7-2.8-2.9/Eclipse 3.7-3.8-4.2-4.3/Hibernate 4.*/JPA 2.0:'''<br />
** Teneo: http://download.eclipse.org/modeling/emf/teneo/updates/2.0.0/interim/<br />
** EMF: http://download.eclipse.org/modeling/emf/emf/updates<br />
** Hibernate and other dependencies: http://www.elver.org/eclipse/2.0.0/update<br />
<br />
* '''1.2.0: EMF 2.5-2.6-2.7/Eclipse 3.5-3.6-3.7/Hibernate 3.6/JPA 2.0:'''<br />
** Teneo: http://download.eclipse.org/modeling/emf/teneo/updates/1.2.0/interim/<br />
** EMF: http://download.eclipse.org/modeling/emf/updates/interim/<br />
** Hibernate and other dependencies: http://www.elver.org/eclipse/1.2.0/update<br />
<br />
For an older release of Teneo supporting Hibernate versions 3.3.2 to 3.5.x:<br />
* Teneo: http://download.eclipse.org/modeling/emf/teneo/updates/1.1.2/interim/<br />
* Hibernate and other dependencies: http://www.elver.org/eclipse/1.1.2/update<br />
<br />
'''Note: update site urls in the screenshots below maybe outdated, use the update site urls listed above.'''<br />
<br />
The EMF update site, select the EMF/XSD SDK:<br />
<br />
[[Image:org.eclipse.emf.teneo.install_emf.png|center|600px]]<br />
<br />
<br />
The Teneo update site will look similar to this image. Select the Teneo Hibernate SDK:<br />
<br />
<br />
[[Image:org.eclipse.emf.teneo.update.site.png|center|700px]]<br />
<br />
<br />
The elver update site lists the Hibernate, dom4j and a number of JDBC plugins. Select the followings, plus some connectors, depending on your needs :<br />
<br />
<br />
[[Image:org.eclipse.emf.teneo.install_dependency.png|center]]<br />
<br />
=== Creating your own Hibernate plugin ===<br />
<br />
If you want to make your own Hibernate/library plugin there is one specific setting which needs to be set in your plugin: make sure to add the following line to the MANIFEST.MF of the Hibernate/libraries plugin you create:<br />
<br />
'''Eclipse-BuddyPolicy: dependent'''<br />
<br />
This is required otherwise the Hibernate libraries can not find your model classes when performing runtime class enhancement. See [http://manuelselva.wordpress.com/2008/04/03/eclipse-and-hibernate-and-class-loaders/ here] for more information. Note that also other Eclipse-BuddyPolicy settings can be used (and can make sense in production environments) but the 'dependent' setting is the safest one.<br />
<br />
=== Teneo, import-packages and ClassNotFoundException when running junit testcases ===<br />
<br />
The Teneo and Hibernate plugins declare dependencies using import-packages. When running junit testcases as normal Java applications or standard junit tests then there is no OSGI environment which takes care of resolving these import-packages. This means that the import-package dependencies are not resolved and ClassNotFoundExceptions are thrown. <br />
<br />
This can be solved by explicitly declaring the dependency in the MANIFEST.MF of your test or model project. As an example: these are the dependendencies set in the examples project:<br />
<source lang="javascript"><br />
Require-Bundle: org.eclipse.core.runtime,<br />
org.eclipse.emf.ecore;visibility:=reexport,<br />
org.eclipse.emf.ecore.xmi;visibility:=reexport,<br />
org.eclipse.emf.teneo.hibernate;bundle-version="1.1.2",<br />
org.hibernate;bundle-version="3.3.2",<br />
org.eclipse.emf.ecore.change,<br />
org.apache.commons.logging,<br />
org.dom4j,<br />
org.hsqldb,<br />
com.mysql.jdbc<br />
</source><br />
<br />
== Usage in a Web Container - Maven ==<br />
<br />
For usage within a web container the following jar files are required. You can download these files from the plugins section on the [http://download.eclipse.org/modeling/emf/teneo/updates/1.2.0/interim/ update site] using your web browser, or you can use Maven (see below):<br />
<br />
=== Jars and Dependencies ===<br />
<br />
* '''Teneo jar files''':<br />
** org.eclipse.emf.teneo<br />
** org.eclipse.emf.teneo.annotations<br />
** org.eclipse.emf.teneo.hibernate<br />
** org.eclipse.emf.teneo.hibernate.mapper<br />
<br />
* '''EMF jar files''':<br />
** org.eclipse.emf.ecore<br />
** org.eclipse.emf.common<br />
** org.eclipse.emf.ecore.xmi<br />
<br />
* '''Dependencies''': Teneo depends on the [http://www.hibernate.org hibernate] and [http://commons.apache.org/logging/ commons-logging] jars (and a jdbc jar). You can find them in maven central or you can download directly from their respective websites.<br />
<br />
=== Maven ===<br />
<br />
Teneo and related EMF jar files are published in [http://search.maven.org/#search%7Cga%7C1%7Corg.eclipse.emf.teneo central maven] and in the [https://oss.sonatype.org/content/repositories/releases/org/eclipse/emf/ sonatype-snapshot] repository. All of them are published in the [http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.eclipse.emf%22 org.eclipse.emf] group.<br />
<br />
'''The Teneo pom files do not define explicit dependencies. This means that your pom files should list the EMF, commons-logging and hibernate jar file as dependencies.'''<br />
<br />
== Download Example Project for Tutorials ==<br />
<br />
The example project (org.eclipse.emf.teneo.hibernate.examples) can be found in git [http://git.eclipse.org/c/teneo/org.eclipse.emf.teneo.git/tree/hibernate/org.eclipse.emf.teneo.hibernate.examples here]. To clone the Teneo git repository execute this action:<br />
<br />
git clone git://git.eclipse.org/gitroot/teneo/org.eclipse.emf.teneo.git<br />
<br />
See [[Git|this page]] on how to work with Eclipse GIT repositories.<br />
<br />
The main examples project used in the tutorials is the: '''org.eclipse.emf.teneo.hibernate.examples''' project.<br />
<br />
This example project uses an extended version of the well-known EMF library example. The example project contains the generated model code and a number of tutorial classes showing how to work with EMF, Teneo and Hibernate.<br />
<br />
Some more details regarding the example project. The example project consists of the following:<br />
* an ecore model and genmodel (in the model subfolder)<br />
* generated model code (no manual changes done, so you can change the ecore model and regenerate the code)<br />
* a number of tutorial java classes in the org.eclipse.emf.teneo.hibernate.examples package<br />
<br />
The MANIFEST.MF of the examples project lists dependencies on several plugins, see the next section for more information on this.</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo/Xcore_Support&diff=360618Texo/Xcore Support2014-04-19T10:42:37Z<p>Mtaal.springsite.com: /* Xcore Support */</p>
<hr />
<div>__TOC__<br />
<br />
== Xcore Support ==<br />
<br />
''' The development of this functionality has been done, but it is not yet available in a published build, the planned ETA is May 2014.'''<br />
<br />
Texo supports [[Xcore|xcore]] in the same way as an [[Texo/Generate_Artifacts|ecore]] model file. All the [[Texo#Code_generation_topics|code generation]] functionality is also supported for xcore files. You can even specify an [[Texo/Code_Generation_Details|annotations]] model on the basis of the xcore file, load the referenced xcore file as any standard resource in the annotationsmodel file.<br />
<br />
To try the different functionalities right click on the xcore file:<br />
<br />
<br />
[[Image:org.eclipse.emf.texo.xcore.png|center]]<br />
<br />
<br />
The available options are the same as for an ecore file. There is an additional option to generate an ecore file, for your convenience.<br />
<br />
== Auto-generate EMF and Texo code ==<br />
<br />
You can tell Texo to [[Texo/Automatic_Code_Generation|automatically]] generate the model code when model files change. Also Xcore can auto-generate the EMF code. <br />
<br />
The Texo autocode generation will generate in the same plugin/project as where the model files are located. The EMF code can be generated in a separate plugin/project. Combining Texo code and EMF code fits perfect in a three tier architecture [[Texo/EMFResource|supported]] by Texo: EMF on the RCP client and Texo on the server. <br />
<br />
If you are only coding for the server side you can disable the EMF XCore auto generate feature. To disable the EMF Xcore auto generation uncheck the 'Compiler is actived' option in the project properties: <br />
<br />
<br />
[[Image:org.eclipse.emf.texo.xcore.uncheck.auto.png|center]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo/Xcore_Support&diff=354169Texo/Xcore Support2014-01-07T13:06:42Z<p>Mtaal.springsite.com: /* Xcore Support */</p>
<hr />
<div>__TOC__<br />
<br />
== Xcore Support ==<br />
<br />
''' The development of this functionality has been done, but it is not yet available in a published build, the planned ETA is mid-january 2014.'''<br />
<br />
Texo supports [[Xcore|xcore]] in the same way as an [[Texo/Generate_Artifacts|ecore]] model file. All the [[Texo#Code_generation_topics|code generation]] functionality is also supported for xcore files. You can even specify an [[Texo/Code_Generation_Details|annotations]] model on the basis of the xcore file, load the referenced xcore file as any standard resource in the annotationsmodel file.<br />
<br />
To try the different functionalities right click on the xcore file:<br />
<br />
<br />
[[Image:org.eclipse.emf.texo.xcore.png|center]]<br />
<br />
<br />
The available options are the same as for an ecore file. There is an additional option to generate an ecore file, for your convenience.<br />
<br />
== Auto-generate EMF and Texo code ==<br />
<br />
You can tell Texo to [[Texo/Automatic_Code_Generation|automatically]] generate the model code when model files change. Also Xcore can auto-generate the EMF code. <br />
<br />
The Texo autocode generation will generate in the same plugin/project as where the model files are located. The EMF code can be generated in a separate plugin/project. Combining Texo code and EMF code fits perfect in a three tier architecture [[Texo/EMFResource|supported]] by Texo: EMF on the RCP client and Texo on the server. <br />
<br />
If you are only coding for the server side you can disable the EMF XCore auto generate feature. To disable the EMF Xcore auto generation uncheck the 'Compiler is actived' option in the project properties: <br />
<br />
<br />
[[Image:org.eclipse.emf.texo.xcore.uncheck.auto.png|center]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo/Xcore_Support&diff=354168Texo/Xcore Support2014-01-07T13:06:24Z<p>Mtaal.springsite.com: </p>
<hr />
<div>__TOC__<br />
<br />
== Xcore Support ==<br />
<br />
''' The development of this functionality has been done but it is not yet available in a published build, the planned ETA is mid-january.'''<br />
<br />
Texo supports [[Xcore|xcore]] in the same way as an [[Texo/Generate_Artifacts|ecore]] model file. All the [[Texo#Code_generation_topics|code generation]] functionality is also supported for xcore files. You can even specify an [[Texo/Code_Generation_Details|annotations]] model on the basis of the xcore file, load the referenced xcore file as any standard resource in the annotationsmodel file.<br />
<br />
To try the different functionalities right click on the xcore file:<br />
<br />
<br />
[[Image:org.eclipse.emf.texo.xcore.png|center]]<br />
<br />
<br />
The available options are the same as for an ecore file. There is an additional option to generate an ecore file, for your convenience.<br />
<br />
== Auto-generate EMF and Texo code ==<br />
<br />
You can tell Texo to [[Texo/Automatic_Code_Generation|automatically]] generate the model code when model files change. Also Xcore can auto-generate the EMF code. <br />
<br />
The Texo autocode generation will generate in the same plugin/project as where the model files are located. The EMF code can be generated in a separate plugin/project. Combining Texo code and EMF code fits perfect in a three tier architecture [[Texo/EMFResource|supported]] by Texo: EMF on the RCP client and Texo on the server. <br />
<br />
If you are only coding for the server side you can disable the EMF XCore auto generate feature. To disable the EMF Xcore auto generation uncheck the 'Compiler is actived' option in the project properties: <br />
<br />
<br />
[[Image:org.eclipse.emf.texo.xcore.uncheck.auto.png|center]]</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo/Hibernate/ModelRelational/Annotations_Format&diff=353758Teneo/Hibernate/ModelRelational/Annotations Format2013-12-17T07:02:49Z<p>Mtaal.springsite.com: /* JPA Annotations in XML */</p>
<hr />
<div>__TOC__ <br />
<br />
<br />
Teneo makes it possible to override the default mapping with JPA annotations in the model. Teneo allows two ways to specify EJB3/JPA-like annotations:<br />
<br />
# using the java annotations syntax in EAnnotations (ecore and xsd) ([[CDO_Hibernate_Store_Annotation_Examples#Examples_of_annotations_defined_in_Ecore_or_in_a_XML_Schema_model|examples]])<br />
# a separate xml document ([[CDO_Hibernate_Store_Annotation_Examples#Examples_of_annotations_in_XML|examples]]).<br />
<br />
This page shows examples of both approaches.<br />
<br />
<br />
A JPA Annotation can have different targets: TYPE, METHOD and FIELD (see the EJB3/JPA spec). Annotations with a TYPE target can be used for EMF EClasses, annotations with METHOD and FIELD targets can be used for EStructuralFeatures. Note: JPA annotations relevant for a non-reference type java member can also be set on an EDataType (see [[Teneo/Hibernate/ModelRelational/Annotations_Support#Annotations_on_EDataType|here]] for more information).<br />
<br />
<br />
Note: when specifying enumerated values then the constant value of the enumeration should be used without the annotation class name. For example the annotation: @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) should (in Teneo) be written as: @Cache(usage = NONSTRICT_READ_WRITE) (without quotes)<br />
<br />
== JPA Annotations in EAnnotations using the java annotation syntax ==<br />
The EAnnotations should adhere to the following format:<br />
* The source must be: '''teneo.jpa'''. Note, Teneo will always consider all annotations starting with teneo.jpa and teneo.mapping (deprecated). You can also configure your own annotation source, see the PersistenceOptions.EXTRA_ANNOTATION_SOURCES and the section on annotation sets below.<br />
* The key must be: '''appinfo''' or '''value'''<br />
<br />
See [[Teneo/Hibernate/ModelRelational/Teneo_Annotation_Examples#Examples_of_annotations_defined_in_Ecore_or_in_a_XML_Schema_model|here]] for examples of how to define eannotations in Ecore or in a XML Schema file.<br />
<br />
==JPA Annotations in XML==<br />
JPA annotations can also be specified in a separate xml file. The advantage of this approach is that you can annotate models which are not in your control. The separate annotated xml means that the original model file does not need to be changed. You can even annotate the Ecore model itself! <br />
<br />
You can tell Teneo where to find the xml file by setting the resource path (to the xml file) in this persistence option: PersistenceOptions.PERSISTENCE_XML (teneo.mapping.persistence_xml), see this [[Teneo/Hibernate/Configuration_Options|options]] page for this and the other Teneo options.<br />
<br />
The xsd for the XML annotations can be downloaded [http://www.elver.org/xsd/teneo/persistence-mapping-hibernate.xsd here]. The xsd shows that it is possible to specify annotations on EPackage, EClass, EAttribute, EReference and EDataType level. In addition there is a special property element which combines the annotations for EAttribute and EReference. The property tag is a convenience tag which can be used to in place of both an EAttribute and an EReference tag.<br />
<br />
A number of examples of annotations in xml can be found [[Teneo/Hibernate/ModelRelational/Teneo_Annotation_Examples#Examples_of_annotations_in_XML|here]].<br />
<br />
When using Teneo within CDO then the location of the annotations xml (a class path location) should be set in the cdo-server.xml using the option: PersistenceOptions.PERSISTENCE_XML. The location should be a resource/class path. <br />
When using Teneo stand alone this same option should be used, but then it should be passed to the HbDataStore.setProperties(..) method.<br />
<br />
To '''make the annotations xml file available to the CDO server at runtime''' you have to place the annotations xml in a separate plugin, see [[CDO_Hibernate_Store_Configuration_and_Setup#Additional_Hibernate_or_other_Config_files|here]] for more information.<br />
<br />
The example project (org.eclipse.emf.cdo.examples.hibernate.server) makes use of an annotations xml file. See the config/cdo-server.xml and the annotations xml file in the META-INF directory.<br />
<br />
==Simple Annotation Example==<br />
An example of an JPA annotation without a key-value pair is the Embedded annotation.<br />
<br />
In a XML Schema model the Embedded annotation is specified as follows:<br />
<source lang="xml"><br />
<xsd:element name="secondEmbedded" type="this:Embeddable"><br />
<xsd:annotation><br />
<xsd:appinfo source="teneo.jpa">@Embedded</xsd:appinfo><br />
</xsd:annotation><br />
</xsd:element><br />
</source><br />
<br />
An example of a (different) simple annotation in xml:<br />
<source lang="xml"> <br />
<eclass name="Name"><br />
<embeddable /><br />
</eclass><br />
</source><br />
<br />
==Annotation with key-value==<br />
An example of an EJB3 annotation with a key-value pair is the Basic annotation.<br />
<br />
In a XML Schema model the Basic annotation is specified as follows:<br />
<br />
<source lang="xml"><br />
<xsd:element name="myOptionalBasic" type="xsd:string"><br />
<xsd:annotation><br />
<xsd:appinfo source="teneo.jpa">@Basic(optional=true fetch=EAGER)</xsd:appinfo><br />
</xsd:annotation><br />
</xsd:element><br />
</source><br />
<br />
An example of a (different) key-value annotation in xml:<br />
<br />
<source lang="xml"><br />
<property name="head"><br />
<one-to-one fetch="EAGER" target-entity="Head" optional="true" cascade="ALL" /><br />
</property><br />
</source><br />
<br />
As you can see this example uses the property tag. The property tag is a convenience tag which can be used to in place of both an EAttribute and an EReference tag.<br />
<br />
==Complex Annotation with multi-level structure==<br />
An example of a more complex annotation is the SecondaryTable annotation which can contain a pkJoinColumns annotation:<br />
<br />
<source lang="xml"><br />
<xsd:annotation><br />
<xsd:appinfo source="teneo.jpa"><br />
@SecondaryTable(name="THETONER" pkJoinColumns={@PrimaryKeyJoinColumn(name="PRINTER_ID")})<br />
</xsd:appinfo><br />
</xsd:annotation><br />
</source><br />
<br />
An example of a (different) more complex annotation in xml:<br />
<br />
<source lang="xml"> <br />
<eclass name="Employee"><br />
<association-override name="address"><br />
<join-column name="employee_address_id"/><br />
</association-override><br />
</eclass><br />
</source><br />
<br />
==Multiple sets of annotations in one model==<br />
It can make sense to have multiple sets of annotations in your model and disable or enable them when needed. For example to have different mappings for different databases.<br />
<br />
Teneo will always map all annotations with a source starting with teneo.jpa and teneo.mapping (deprecated).<br />
<br />
You can configure additional annotation sources to be considered using the PersistenceOptions.EXTRA_ANNOTATION_SOURCES option. The value of this option is a comma delimited list of sources. Teneo will then also consider all annotations which have a source equal to one of the sources defined in the PersistenceOptions.EXTRA_ANNOTATION_SOURCES option. <br />
<br />
There is another option which plays a role here: PersistenceOptions.EXTRA_ANNOTATIONS_OVERRIDES_DEFAULT. If set to true then the extra annotations are considered to override the default annotations, so if there is an extra-source-annotation then the default annotation is not used.<br />
<br />
For standard Teneo these options can be passed when creating the datatore (dataStore.setProperties(...)).<br />
<br />
For usage of Teneo within CDO (see the [[CDO_Hibernate_Store|CDO Hibernate Store]]), these options can be set in the cdo-server.xml file which configures the hibernate store.</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Teneo/Hibernate/ModelRelational/Annotations_Format&diff=353757Teneo/Hibernate/ModelRelational/Annotations Format2013-12-17T07:02:04Z<p>Mtaal.springsite.com: </p>
<hr />
<div>__TOC__ <br />
<br />
<br />
Teneo makes it possible to override the default mapping with JPA annotations in the model. Teneo allows two ways to specify EJB3/JPA-like annotations:<br />
<br />
# using the java annotations syntax in EAnnotations (ecore and xsd) ([[CDO_Hibernate_Store_Annotation_Examples#Examples_of_annotations_defined_in_Ecore_or_in_a_XML_Schema_model|examples]])<br />
# a separate xml document ([[CDO_Hibernate_Store_Annotation_Examples#Examples_of_annotations_in_XML|examples]]).<br />
<br />
This page shows examples of both approaches.<br />
<br />
<br />
A JPA Annotation can have different targets: TYPE, METHOD and FIELD (see the EJB3/JPA spec). Annotations with a TYPE target can be used for EMF EClasses, annotations with METHOD and FIELD targets can be used for EStructuralFeatures. Note: JPA annotations relevant for a non-reference type java member can also be set on an EDataType (see [[Teneo/Hibernate/ModelRelational/Annotations_Support#Annotations_on_EDataType|here]] for more information).<br />
<br />
<br />
Note: when specifying enumerated values then the constant value of the enumeration should be used without the annotation class name. For example the annotation: @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) should (in Teneo) be written as: @Cache(usage = NONSTRICT_READ_WRITE) (without quotes)<br />
<br />
== JPA Annotations in EAnnotations using the java annotation syntax ==<br />
The EAnnotations should adhere to the following format:<br />
* The source must be: '''teneo.jpa'''. Note, Teneo will always consider all annotations starting with teneo.jpa and teneo.mapping (deprecated). You can also configure your own annotation source, see the PersistenceOptions.EXTRA_ANNOTATION_SOURCES and the section on annotation sets below.<br />
* The key must be: '''appinfo''' or '''value'''<br />
<br />
See [[Teneo/Hibernate/ModelRelational/Teneo_Annotation_Examples#Examples_of_annotations_defined_in_Ecore_or_in_a_XML_Schema_model|here]] for examples of how to define eannotations in Ecore or in a XML Schema file.<br />
<br />
==JPA Annotations in XML==<br />
JPA annotations can also be specified in a separate xml file. The advantage of this approach is that you can annotate models which are not in your control. The separate annotated xml means that the original model file does not need to be changed. You can even annotate the Ecore model itself! <br />
<br />
You tell Teneo where to find the xml file by setting the resource path (to the xml file) in this persistence option: PersistenceOptions.PERSISTENCE_XML (teneo.mapping.persistence_xml), see this [[Teneo/Hibernate/Configuration_Options|options]] page for this and the other Teneo options.<br />
<br />
The xsd for the XML annotations can be downloaded [http://www.elver.org/xsd/teneo/persistence-mapping-hibernate.xsd here]. The xsd shows that it is possible to specify annotations on EPackage, EClass, EAttribute, EReference and EDataType level. In addition there is a special property element which combines the annotations for EAttribute and EReference. The property tag is a convenience tag which can be used to in place of both an EAttribute and an EReference tag.<br />
<br />
A number of examples of annotations in xml can be found [[Teneo/Hibernate/ModelRelational/Teneo_Annotation_Examples#Examples_of_annotations_in_XML|here]].<br />
<br />
When using Teneo within CDO then the location of the annotations xml (a class path location) should be set in the cdo-server.xml using the option: PersistenceOptions.PERSISTENCE_XML. The location should be a resource/class path. <br />
When using Teneo stand alone this same option should be used, but then it should be passed to the HbDataStore.setProperties(..) method.<br />
<br />
To '''make the annotations xml file available to the CDO server at runtime''' you have to place the annotations xml in a separate plugin, see [[CDO_Hibernate_Store_Configuration_and_Setup#Additional_Hibernate_or_other_Config_files|here]] for more information.<br />
<br />
The example project (org.eclipse.emf.cdo.examples.hibernate.server) makes use of an annotations xml file. See the config/cdo-server.xml and the annotations xml file in the META-INF directory.<br />
<br />
==Simple Annotation Example==<br />
An example of an JPA annotation without a key-value pair is the Embedded annotation.<br />
<br />
In a XML Schema model the Embedded annotation is specified as follows:<br />
<source lang="xml"><br />
<xsd:element name="secondEmbedded" type="this:Embeddable"><br />
<xsd:annotation><br />
<xsd:appinfo source="teneo.jpa">@Embedded</xsd:appinfo><br />
</xsd:annotation><br />
</xsd:element><br />
</source><br />
<br />
An example of a (different) simple annotation in xml:<br />
<source lang="xml"> <br />
<eclass name="Name"><br />
<embeddable /><br />
</eclass><br />
</source><br />
<br />
==Annotation with key-value==<br />
An example of an EJB3 annotation with a key-value pair is the Basic annotation.<br />
<br />
In a XML Schema model the Basic annotation is specified as follows:<br />
<br />
<source lang="xml"><br />
<xsd:element name="myOptionalBasic" type="xsd:string"><br />
<xsd:annotation><br />
<xsd:appinfo source="teneo.jpa">@Basic(optional=true fetch=EAGER)</xsd:appinfo><br />
</xsd:annotation><br />
</xsd:element><br />
</source><br />
<br />
An example of a (different) key-value annotation in xml:<br />
<br />
<source lang="xml"><br />
<property name="head"><br />
<one-to-one fetch="EAGER" target-entity="Head" optional="true" cascade="ALL" /><br />
</property><br />
</source><br />
<br />
As you can see this example uses the property tag. The property tag is a convenience tag which can be used to in place of both an EAttribute and an EReference tag.<br />
<br />
==Complex Annotation with multi-level structure==<br />
An example of a more complex annotation is the SecondaryTable annotation which can contain a pkJoinColumns annotation:<br />
<br />
<source lang="xml"><br />
<xsd:annotation><br />
<xsd:appinfo source="teneo.jpa"><br />
@SecondaryTable(name="THETONER" pkJoinColumns={@PrimaryKeyJoinColumn(name="PRINTER_ID")})<br />
</xsd:appinfo><br />
</xsd:annotation><br />
</source><br />
<br />
An example of a (different) more complex annotation in xml:<br />
<br />
<source lang="xml"> <br />
<eclass name="Employee"><br />
<association-override name="address"><br />
<join-column name="employee_address_id"/><br />
</association-override><br />
</eclass><br />
</source><br />
<br />
==Multiple sets of annotations in one model==<br />
It can make sense to have multiple sets of annotations in your model and disable or enable them when needed. For example to have different mappings for different databases.<br />
<br />
Teneo will always map all annotations with a source starting with teneo.jpa and teneo.mapping (deprecated).<br />
<br />
You can configure additional annotation sources to be considered using the PersistenceOptions.EXTRA_ANNOTATION_SOURCES option. The value of this option is a comma delimited list of sources. Teneo will then also consider all annotations which have a source equal to one of the sources defined in the PersistenceOptions.EXTRA_ANNOTATION_SOURCES option. <br />
<br />
There is another option which plays a role here: PersistenceOptions.EXTRA_ANNOTATIONS_OVERRIDES_DEFAULT. If set to true then the extra annotations are considered to override the default annotations, so if there is an extra-source-annotation then the default annotation is not used.<br />
<br />
For standard Teneo these options can be passed when creating the datatore (dataStore.setProperties(...)).<br />
<br />
For usage of Teneo within CDO (see the [[CDO_Hibernate_Store|CDO Hibernate Store]]), these options can be set in the cdo-server.xml file which configures the hibernate store.</div>Mtaal.springsite.comhttps://wiki.eclipse.org/index.php?title=Texo/EMFResource&diff=353694Texo/EMFResource2013-12-14T09:58:44Z<p>Mtaal.springsite.com: </p>
<hr />
<div>__TOC__<br />
<br />
== Introduction ==<br />
<br />
Texo is also very usefull when developing a RCP solution. The solution architecture has 2 parts:<br />
* an EMF generated user interface which uses EObjects<br />
* a Texo generated persistence layer on the server, using standard JPA/ORM<br />
<br />
To support this architecture Texo provides a new EMF resource (to be used in the RCP client): the [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/store/TexoResource.java TexoResource]. This implementation has 2 subclasses implementing different scenarios:<br />
* [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]: for direct integration in the same systems layer with the ORM, the 2-tier architecture.<br />
* [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/core/org.eclipse.emf.texo.json/src/org/eclipse/emf/texo/json/JSONTexoResource.java JSONTexoResource]: for a full 3-tier architecture with EObjects on the client, JPA on the server and JSON for the communication.<br />
<br />
== Architecture ==<br />
=== 2-Tier Architecture ===<br />
<br />
The 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. <br />
<br />
In this 2-tier architecture the EMF Resource talks directly (through Texo) with the ORM layer and the database. <br />
<br />
<br />
[[Image:org.eclipse.emf.texo.resource.2tier.png|center]]<br />
<br />
<br />
<br />
=== 3-Tier Architecture ===<br />
<br />
Texo also supports a 3-tier architecture using the JSONTexoResource:<br />
* Front-end: the user interface - client using standard EMF generated code<br />
* Middle-tier: the web server layer provides a [[Texo/JSON_REST_Web_Services|CRUD JSON]] web service function and the JPA/ORM persistence<br />
* Database<br />
<br />
<br />
[[Image:org.eclipse.emf.texo.resource.3tier.png|center]]<br />
<br />
<br />
== Using the Texo Resource ==<br />
<br />
Information can be loaded in the Texo resource in 2 ways:<br />
* 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<br />
* by directly calling the query method on the TexoResource, the query method allows free format HQL/JPQL queries with named parameters.<br />
<br />
The TexoResource internally uses an instance of [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/core/org.eclipse.emf.texo/src/org/eclipse/emf/texo/store/EObjectStore.java EObjectStore]. You can get this object through the getEObjectStore method on the TexoResource. The EObjectStore provides additional methods which can be very usefull:<br />
** cross-referencing: find all the objects that refer to a specific target object<br />
** counting using a query<br />
** refreshing an object from the server<br />
<br />
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.<br />
<br />
=== The JSONTexoResource - setting up a server side ===<br />
<br />
The Texo JSON Resource has some additional specific points to take into account.<br />
<br />
First it needs a running server, see [[Texo/JSON_REST_Web_Services#Video.2FDemo_.26_Example_project|here]] for an example project and video for such a server side.<br />
<br />
Then next, the URI for creating the resource must be a valid web address pointing to the Texo server environment. For example the following web address is used in the test environment of Texo: http://localhost:8080/texo/jsonws<br />
<br />
The JSONTexoResource resolves proxies by doing HTTP requests to the server side to load the proxied objects. EMF proxies only work correctly if the EMF resource is created through a ResourceSet.<br />
<br />
When sending objects from the client to the server (when saving a resource) the server side is allowed to change objects before persisting. The changes are send back to the client and merged into the client-side objects.<br />
<br />
If the client needs to authenticate against the server then you need to create your own subclass of the [http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/tree/core/org.eclipse.emf.texo.json/src/org/eclipse/emf/texo/json/JSONEObjectStore.java JSONEObjectStore]. This class has several overriding points for changing the URL or adding authentication to the HttpUrlConnection. See [[Texo/Components|here]] on how to tell Texo to use your specific subclass of the JSONEObjectStore.<br />
<br />
The JSONTexoResource is specifically targeted for usage in a RCP. For the RCP environment/client side you need 2 plugins:<br />
* org.eclipse.emf.texo<br />
* org.eclipse.emf.texo.json<br />
<br />
And in addition the EMF plugins ofcourse. You can find these plugins through the Texo [[Texo/Download_and_Install#Update_Manager_Locations|update site]].<br />
<br />
=== The EPersistenceTexoResource ===<br />
<br />
The EPersistenceTexoResource uses the [[Texo/EntityManagerHandling|Texo EntityManager]] integration to have access to an EntityManager, please check out the [[Texo/EntityManagerHandling|Texo EntityManager]] wiki page for more information.</div>Mtaal.springsite.com