0

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?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.