Java Reference
In-Depth Information
created do not exist, because we defined create instead of drop-and-create for the
action of the provider.
<persistence-unit name="chapter04PUM"
transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>com.packt.ch04.entities.Department</class>
<class>com.packt.ch04.entities.Person</class>
<class>com.packt.ch04.entities.Student</class>
<properties>
<property
name="javax.persistence.jdbc.url"value="jdbc:mysql://localhost:3306/
onlineregistration"/>
<property
name="javax.persistence.jdbc.password"value="onlineapp"/>
<property
name="javax.persistence.jdbc.driver"value="com.mysql.jdbc.Driver"/>
<property
name="javax.persistence.jdbc.user"
value="root"/>
<property
name="javax.persistence.schema-generation.database.action"
value="create"/>
<property
name="javax.persistence.schema-generation.create-source"
value="metadata"/>
</properties>
</persistence-unit>
Another aspect of this standardization is the addition of a new method ( Persist-
ence.generateSchema() ), which provides more opportunity for the generation.
Before (in JPA 2.0), the DDL generation was done at the creation of the entity man-
ager. Henceforth, you can generate your tables before, during, or after the creation
of the EntityManagerFactory .
Search WWH ::




Custom Search