Resource resource = resSet.getResource(URI Resource resource = resSet.createResource(URI ResourceSet resSet = new ResourceSetImpl() Register the XMI resource factory for the. IPerson person = factory.createIPerson() create the content of the model via this program MymodelFactory factory = MymodelFactory.eINSTANCE Retrieve the default factory singleton The MANIFEST.MF of the examples project lists dependencies on several plugins, see the next section for more information on this.Package .observers import model.IPerson import model.IPersonList import model.ModelFactory import .notify.Adapter import .notify.Notification import. public class ElementObserver a number of tutorial java classes in the .hibernate.examples package.
The example project contains the generated model code and a number of tutorial classes showing how to work with EMF, Teneo and Hibernate. This example project uses an extended version of the well-known EMF library example. The main examples project used in the tutorials is the: .hibernate.examples project. See this page on how to work with Eclipse GIT repositories. To clone the Teneo git repository execute this action: The example project (.hibernate.examples) can be found in git here. This means that your pom files should list the EMF, commons-logging and hibernate jar file as dependencies. The Teneo pom files do not define explicit dependencies. So the EMF-generated code is in the adventure package and. Teneo and related EMF jar files are published in central maven and in the sonatype-snapshot repository. One of the reasons to do the actual development in a different place or different package than the code generated by EMF is that this way, if you make a change to your EMF code you can simply delete all the generated code and regenerate it, without having to watch out for your own files.
You can find them in maven central or you can download directly from their respective websites.
Dependencies: Teneo depends on the hibernate and commons-logging jars (and a jdbc jar).
You can download these files from the plugins section on the update site using your web browser, or you can use Maven (see below): jdbc Usage in a Web Container - Mavenįor usage within a web container the following jar files are required. hibernate bundle -version = "3.3.2" ,Ĭom. As an example: these are the dependendencies set in the examples project: This can be solved by explicitly declaring the dependency in the MANIFEST.MF of your test or model project. This means that the import-package dependencies are not resolved and ClassNotFoundExceptions are thrown. 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.
The Teneo and Hibernate plugins declare dependencies using import-packages. Teneo, import-packages and ClassNotFoundException when running junit testcases 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. This is required otherwise the Hibernate libraries can not find your model classes when performing runtime class enhancement. 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: The EMF update site, select the EMF/XSD SDK: Note: update site urls in the screenshots below maybe outdated, use the update site urls listed above. The following update sites are no longer available: Teneo is delivered in the following versions:
Usage in Eclipse/OSGI: download and install using the update manager Plugins and dependencies, update site locations
Teneo provide update sites with the required dependencies (see below for the correct update site depending on your version). Some dependencies can not be downloaded from because of licensing differences. To run Teneo you need the following software: This page also describes where to find the example projects used in the tutorials in the wiki. The installation method for Teneo depends on the target environment(Eclipse/OSGI or web container).