Java Reference
In-Depth Information
Figure 12.1: The HSQLDB GUI client
The Ant build script automatically builds the WAR files with all the
required JARs.
The JPA configuration is placed in the
WEB-INF/classes/META-INF/
persistence.xml
file. This is where you tell JPA to use Hibernate and con-
figure Hibernate to use the HSQLDB database:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="stripes_webmail">
<!-- Tell JPA to use Hibernate -->
<provider>
org.hibernate.ejb.HibernatePersistence
</provider>
<!-- Hibernate settings -->
<properties>
<!-- Autodetect entity classes -->
<property name="hibernate.archive.autodetection" value="class"/>
<!-- Automatically create the SQL schema -->
<property name="hibernate.hbm2ddl.auto" value="create"/>
Search WWH ::
Custom Search