As was discussed in chapter 10 (section 10.2.2), the HIBERNATE transaction man-
ager simply expects that the properties you would normally put in the hiber-
nate.properties file are listed as properties to the <transactionManager> element.
Because we wanted to keep our source tree clean, we did not put the Hiber-
nate mapping file for the Account bean ( Account.hbm.xml ) in the same package as
our Account bean, but instead added it to the configuration by using a map. prop-
erty that added it to our Hibernate configuration. Remember, it is all about keep-
ing the implementation of the data access separate from the interface.
Mapping the Account table
The mapping file, shown in listing 11.2, is very simple, because we map directly
from the properties files to the columns that have the same names, and there are
no related entities.
Hibernate mapping file for our Account table
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
<id name="accountId" type="int" column="accountid">
<property name="username" />
<property name="password" />
<property name="firstName" />
to a class
Hooking up sequence
for ID generation
Search WWH ::