mardi 1 août 2017

Have 2 hibernate.properties files

I have a Spring Boot project with Hibernate. I would like to use 2 separate hibernate.properties files: one for normal use of application, another only for test.

So, how can I do that? Or maybe it is not possible? I don't want to comment/uncomment lines in this file for tests.

Thanks for every answers and help.

#hibernate.connection.driver_class = org.postgresql.Driver
#hibernate.connection.url = jdbc:postgresql://localhost:5432/dummydb
#hibernate.connection.username = postgres
#hibernate.connection.password = postgres
#hibernate.dialect = org.hibernate.dialect.PostgreSQL91Dialect

hibernate.connection.driver_class = org.hsqldb.jdbcDriver
hibernate.connection.url = jdbc:hsqldb:mem:dummydb
hibernate.connection.username = user
hibernate.connection.password = password
hibernate.hbm2ddl.auto=create
hibernate.dialect = org.hibernate.dialect.HSQLDialect

hibernate.show_sql=true

Aucun commentaire:

Enregistrer un commentaire