Skip to content

Commit

Permalink
update JPA to 3.1.0 Jakarta
Browse files Browse the repository at this point in the history
  • Loading branch information
HSGamer committed Nov 22, 2023
1 parent 693ebea commit 7a0f89f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
10 changes: 7 additions & 3 deletions hscore-database/hscore-database-client-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@

<artifactId>hscore-database-client-jpa</artifactId>

<properties>
<java.version>11</java.version>
</properties>

<dependencies>
<dependency>
<groupId>me.hsgamer</groupId>
<artifactId>hscore-database-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package me.hsgamer.hscore.database.client.jpa;

import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import jakarta.persistence.Persistence;
import me.hsgamer.hscore.database.BaseClient;
import me.hsgamer.hscore.database.Driver;
import me.hsgamer.hscore.database.Setting;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import java.util.HashMap;
import java.util.Map;

Expand All @@ -26,10 +26,10 @@ public PersistenceClient(String name, Setting setting) {
super(setting);
Driver driver = setting.getDriver();
Map<String, Object> properties = new HashMap<>();
properties.put("javax.persistence.jdbc.url", driver.convertURL(setting));
properties.put("javax.persistence.jdbc.user", setting.getUsername());
properties.put("javax.persistence.jdbc.password", setting.getPassword());
properties.put("javax.persistence.jdbc.driver", driver.getDriverClass());
properties.put("jakarta.persistence.jdbc.url", driver.convertURL(setting));
properties.put("jakarta.persistence.jdbc.user", setting.getUsername());
properties.put("jakarta.persistence.jdbc.password", setting.getPassword());
properties.put("jakarta.persistence.jdbc.driver", driver.getDriverClass());
properties.putAll(setting.getClientProperties());
this.entityManagerFactory = Persistence.createEntityManagerFactory(name, properties);
}
Expand Down

0 comments on commit 7a0f89f

Please sign in to comment.