ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Hibernate Your Data
Subject:   Code gen to generate Java Classes
Date:   2004-12-30 17:05:29
From:   dvohra09
In the tutorial the java classes, with the getter and the setter methods, were created prior to the retrieving and storing of the data in the database. Hibernate has the provision to generate the java classes from the hbm.xml configuration file with the Hibernate code generation class
net.sf.hibernate.tool.hbm2java.hbm2JavaTask.



Also, the database tables were created prior to the implementing the Hibernate features. Hibernate provides the schema generation class
net.sf.hibernate.tool.hbm2ddl.SchemaExportTask to generate the database schema for a hbm.xml configurtion file.