user1154644
user1154644

Reputation: 4609

How to connect persistence.xml file with hibernate.properties

I am trying to declare most of my persistence properties in a hibernate.properties file. How do I point the persistence.xml file to the hibernate.properties file?

Upvotes: 0

Views: 153

Answers (1)

Vidya
Vidya

Reputation: 30310

You don't. You simply define the Hibernate-specific properties in persistence.xml:

<properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
         <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
</properties>

You can also put JPA 2 standard properties as listed here in the properties element as well.

When the application is fired up, Hibernate will read the properties here and be configured accordingly.

Upvotes: 1

Related Questions