【发布时间】:2017-08-01 16:06:36
【问题描述】:
我有一个带有 Hibernate 的 Spring Boot 项目。我想使用 2 个单独的 hibernate.properties 文件:一个用于正常使用应用程序,另一个仅用于测试。
那么,我该怎么做呢?或者也许这是不可能的?我不想在此文件中注释/取消注释行以进行测试。
感谢您的每一个回答和帮助。
#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
【问题讨论】:
标签: database hibernate testing junit spring-data-jpa