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
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.