mirror of
https://github.com/sismics/docs.git
synced 2025-12-14 02:06:25 +00:00
Upgrade Hibernate version (#726)
This commit is contained in:
@@ -17,8 +17,8 @@
|
||||
<dependencies>
|
||||
<!-- Persistence layer dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core-jakarta</artifactId>
|
||||
<groupId>org.hibernate.orm</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Other external dependencies -->
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.Properties;
|
||||
public final class EMF {
|
||||
private static final Logger log = LoggerFactory.getLogger(EMF.class);
|
||||
|
||||
private static Map<Object, Object> properties;
|
||||
private static Properties properties;
|
||||
|
||||
private static EntityManagerFactory emfInstance;
|
||||
|
||||
@@ -59,7 +59,7 @@ public final class EMF {
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<Object, Object> getEntityManagerProperties() {
|
||||
private static Properties getEntityManagerProperties() {
|
||||
// Use properties file if exists
|
||||
try {
|
||||
URL hibernatePropertiesUrl = EMF.class.getResource("/hibernate.properties");
|
||||
@@ -81,7 +81,7 @@ public final class EMF {
|
||||
String databasePassword = System.getenv("DATABASE_PASSWORD");
|
||||
|
||||
log.info("Configuring EntityManager from environment parameters");
|
||||
Map<Object, Object> props = new HashMap<>();
|
||||
Properties props = new Properties();
|
||||
Path dbDirectory = DirectoryUtil.getDbDirectory();
|
||||
String dbFile = dbDirectory.resolve("docs").toAbsolutePath().toString();
|
||||
if (Strings.isNullOrEmpty(databaseUrl)) {
|
||||
@@ -92,7 +92,7 @@ public final class EMF {
|
||||
props.put("hibernate.connection.username", "sa");
|
||||
} else {
|
||||
props.put("hibernate.connection.driver_class", "org.postgresql.Driver");
|
||||
props.put("hibernate.dialect", "org.hibernate.dialect.PostgreSQL94Dialect");
|
||||
props.put("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect");
|
||||
props.put("hibernate.connection.url", databaseUrl);
|
||||
props.put("hibernate.connection.username", databaseUsername);
|
||||
props.put("hibernate.connection.password", databasePassword);
|
||||
@@ -136,4 +136,4 @@ public final class EMF {
|
||||
public static String getDriver() {
|
||||
return (String) properties.get("hibernate.connection.driver_class");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user