Skip to content

Commit

Permalink
Upgrade Hibernate version (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Kirch authored Oct 9, 2023
1 parent a89543b commit 0351f94
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand Down
10 changes: 5 additions & 5 deletions docs-core/src/main/java/com/sismics/util/jpa/EMF.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
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;

Expand Down Expand Up @@ -59,7 +59,7 @@ public void onUpgrade(int oldVersion, int newVersion) throws Exception {
}
}

private static Map<Object, Object> getEntityManagerProperties() {
private static Properties getEntityManagerProperties() {
// Use properties file if exists
try {
URL hibernatePropertiesUrl = EMF.class.getResource("/hibernate.properties");
Expand All @@ -81,7 +81,7 @@ private static Map<Object, Object> getEntityManagerProperties() {
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)) {
Expand All @@ -92,7 +92,7 @@ private static Map<Object, Object> getEntityManagerProperties() {
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);
Expand Down Expand Up @@ -136,4 +136,4 @@ public static boolean isDriverPostgresql() {
public static String getDriver() {
return (String) properties.get("hibernate.connection.driver_class");
}
}
}
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<org.apache.pdfbox.pdfbox.version>2.0.27</org.apache.pdfbox.pdfbox.version>
<org.bouncycastle.bcprov-jdk15on.version>1.70</org.bouncycastle.bcprov-jdk15on.version>
<joda-time.joda-time.version>2.12.2</joda-time.joda-time.version>
<org.hibernate.hibernate.version>5.6.15.Final</org.hibernate.hibernate.version>
<org.hibernate.hibernate.version>6.3.1.Final</org.hibernate.hibernate.version>
<fr.opensagres.xdocreport.version>2.0.4</fr.opensagres.xdocreport.version>
<net.java.dev.jna.jna.version>5.13.0</net.java.dev.jna.jna.version>
<com.twelvemonkeys.imageio.version>3.9.4</com.twelvemonkeys.imageio.version>
Expand Down Expand Up @@ -327,8 +327,8 @@
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core-jakarta</artifactId>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
<version>${org.hibernate.hibernate.version}</version>
</dependency>

Expand Down

0 comments on commit 0351f94

Please sign in to comment.