Teneo Setup for Eclipse 4.2 – Juno

In this section we will see how, starting from  Eclipse Juno Modeling, you can install some plugins that will allow management of the persistence to a database using the Teneo framework.
This framework implements a layer that links EMF and ORMs like Hibernate or EclipseLink, which in turn handle the persistence on relational databases.
The advantage, in using Teneo, is that you can act at EMF level and hit the database, without knowing the intermediate mechanisms.
Regarding the database choice, in this series of articles, we will work with MySQL as target database.

Go to menu Help -> Install New Software…, press button Add… , set “Teneo Dependencies” into Name field the following address into Location field:

http://www.elver.org/eclipse/2.0.0/update

press OK and select the following items:

  • Apache Commons Logging
  • Apache Log4j
  • Dom4j
  • Hibernate
  • Javax Persistence
  • MySQL Connector/J

then press button Next and follow the wizard until you are asked to restart Eclipse. Just answer no by pressing button “Not Now” since we need some more install to be completed.

Let’s repeat the operation ( Help -> Install New Software…), now typing “Teneo 2.0.0” into Name field and the following address into Location field:

http://download.eclipse.org/modeling/emf/teneo/updates/2.0.0/interim/

press OK and select the category “EMF Teneo – Hibernate

now press Next button and follow the wizard until we are asked to restart Eclipse. This time let’s accept, by clicking “Restart Now“.

You can find details about how to download, install and use Teneo on the official Wiki page:
http://wiki.eclipse.org/Teneo/Hibernate/Download_and_Install

 

Back to index

By | 2013-01-20T09:39:59+00:00 August 8th, 2011|Altri Tutorials, Articoli, Tutorials Eclipse RCP|4 Comments

About the Author:

4 Comments

  1. franco Tuesday January 3rd, 2012 at 09:51 AM - Reply

    Dato che sto incominciando ad utilizzare eclipse (e Java) come sviluppo di applicazioni desktop database driven, vorrei sapere se e’ possibile usare db come derby o H2 e loro eventuale configurazione.
    Grazie

    • Vincenzo Saturday January 7th, 2012 at 06:53 PM - Reply

      Franco,
      Teneo utilizza Hibernate (o EclipseLink) per la connessione al database, quindi è sufficiente cambiare i parametri di connessione in modo opportuno. Se ad es. fai riferimento al tutorial Eclipse EMF: un CRUD immediato per database e intendi usare Derby, i parametri dovrebbero essere impostati come segue:
      props.setProperty(Environment.DRIVER, “org.apache.derby.jdbc.ClientDriver”);
      props.setProperty(Environment.USER, “”);
      props.setProperty(Environment.PASS, “”);
      props.setProperty(Environment.URL, “jdbc:derby://localhost:1527/myDerbyDb”);
      props.setProperty(Environment.DIALECT, org.hibernate.dialect.DerbyDialect.class.getName());

  2. renzo Sunday April 22nd, 2012 at 06:38 PM - Reply

    Vorrei provare ad usare Teneo con DB2 , cosa devo fare ?

    • Vincenzo Monday April 23rd, 2012 at 09:12 AM - Reply

      Ciao Renzo,
      quando si usa Teneo e si opta per un certo database occorrono due cose:
      1) che esista il giusto Dialect di Hibernate per quel database (e per DB2 questo requisito è soddisfatto: “org.hibernate.dialect.DB2Dialect”). Per una lista completa dei dialetti Hibernate vedere qui: http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html
      2) che il driver jdbc sia disponibile a livello di PDE (Plug-in Development Environment). Per questo basta creare un Plug-in (File->New->Plug-in Project), anche privo di Activator e di contributo alla UI, che possiamo chiamare in questo caso ad es. “com.ibm.db2.jdbc”, creare una cartella “lib”, copiare al suo interno il jar del driver jdbc e dal tab “Runtime” esportare tutti i package. A questo punto questo plug-in è da trattare come nel tutorial viene trattato il plug-in “com.mysql.jdbc”. L’unica differenza quindi è che stavolta il plug-in che contribuisce al jdbc driver non sta nella platform, ma viene aggiunto esplicitamente da noi.
      Sono a disposizione se questa fase non dovesse essere chiara.
      Vincenzo

Leave A Comment

This Is A Custom Widget

This Sliding Bar can be switched on or off in theme options, and can take any widget you throw at it or even fill it with your custom HTML Code. Its perfect for grabbing the attention of your viewers. Choose between 1, 2, 3 or 4 columns, set the background color, widget divider color, activate transparency, a top border or fully disable it on desktop and mobile.

This Is A Custom Widget

This Sliding Bar can be switched on or off in theme options, and can take any widget you throw at it or even fill it with your custom HTML Code. Its perfect for grabbing the attention of your viewers. Choose between 1, 2, 3 or 4 columns, set the background color, widget divider color, activate transparency, a top border or fully disable it on desktop and mobile.