Salto-db generator is an Eclipse plug-in that allows you to generate JAVA classes in order to interact between your application and a datasource.
At this time, salto-db generator supports two persistance layers softwares:
Installation is straight forward, once you have Eclipse. You need to add a new update site (Eclipse -> Help -> Software Updates -> Find and install -> Search for new features to install -> New remote site)
The update site URL that you need is the following: http://salto-db.sourceforge.net/plugin/
Salto-db generator is available in an Eclipse perspective:
Here is an example to illustrate functionalities provided by this plug-in.
Suppose that we have a database which contains three tables with the following relationships between them:
One or more customers (CLIENT table) can live in only one address (ADRESSE table). Each customer has his own detail (PROFIL_CLIENT table).
The first step is to connect to database through salto-db generator plug-in to retrieve database schema.
Then, you just have to "connect" to this new connection:
Once you are connected, you can see tables in database:
The next step is to generate classes. You have to choose your plugin (Hibernate with EJB3 annotations, Hibernate, Salto-db) thanks to this view:
You also need to select tables that you need to map in your application:
Salto-db generator proposes you types mapping between Java types and Sql types:
You can click the "Apply Templates" button to apply template. Generation can start!
Your project looks like:
We advise you to have a look to the hibernate.cfg.xml to check if you are agree with the chosen dialect.
You can now use generated classes in your code: