RSS

Archivos diarios: 8 mayo, 2011

Creating java domain objects from a database with an Ant task and Hibernate tools


This is the third way we mentioned in this parent post of creating java domain objects, or data access objects, mapping files.
We need to create an Ant task within our build.xml file in order to generate our domain objects, daos or xml mapping files.
Once this is done, we have to execute ant hbm (our task name) and our files will be generated. Notice that you need to include a reference to every library we are going to use (hibernate-tools, freemarker, log libraries, …).
Read the rest of this entry »

Anuncios
 
2 comentarios

Publicado por en 8 mayo, 2011 en Hibernate

 

Etiquetas: , , ,

Creating Java domain objects with the Maven Hibernate plugin and Hibernate tools.


Visit my new website http://java4developers.com

This is the second way we mentioned in this parent post of creating java domain objects, or data access objects, mapping files. The Hibernate 3 Maven plugin webpage show us which goals are available for this plugin. In this post we are going to use the following four ones:

  • hibernate3:hbm2cfgxml: Generates hibernate.cfg.xml.
  • hibernate3:hbm2hbmxml: Generates a set of hbm.xml files.
  • hibernate3:hbm2java: Generates Java domain objects.
  • hibernate3:hbm2dao: Generates data access objects.

Read the rest of this entry »

 
5 comentarios

Publicado por en 8 mayo, 2011 en Hibernate

 

Etiquetas: , , , ,

 
A %d blogueros les gusta esto: