JAVA-18152 Upgrade libraries-data-db module to JDK 11 (#13716)
Co-authored-by: timis1 <noreplay@yahoo.com>
This commit is contained in:
parent
75e70d595c
commit
9af9ee9b48
|
@ -43,7 +43,7 @@
|
|||
<dependency>
|
||||
<groupId>org.datanucleus</groupId>
|
||||
<artifactId>datanucleus-api-jdo</artifactId>
|
||||
<version>${datanucleus.version}</version>
|
||||
<version>${datanucleus-api.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.datanucleus</groupId>
|
||||
|
@ -135,6 +135,11 @@
|
|||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>${ebean.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -270,15 +275,16 @@
|
|||
<reladomo.version>18.1.0</reladomo.version>
|
||||
<build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version>
|
||||
<maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
|
||||
<ormlite.version>5.0</ormlite.version>
|
||||
<datanucleus.version>5.1.1</datanucleus.version>
|
||||
<datanucleus-maven-plugin.version>5.0.2</datanucleus-maven-plugin.version>
|
||||
<datanucleus-jdo-query.version>5.0.4</datanucleus-jdo-query.version>
|
||||
<javax.jdo.version>3.2.0-m7</javax.jdo.version>
|
||||
<HikariCP.version>3.4.5</HikariCP.version>
|
||||
<ebean.version>11.22.4</ebean.version>
|
||||
<debezium.version>1.4.2.Final</debezium.version>
|
||||
<testcontainers-version>1.15.3</testcontainers-version>
|
||||
<ormlite.version>6.1</ormlite.version>
|
||||
<datanucleus.version>6.0.3</datanucleus.version>
|
||||
<datanucleus-api.version>6.0.1</datanucleus-api.version>
|
||||
<datanucleus-maven-plugin.version>6.0.0-release</datanucleus-maven-plugin.version>
|
||||
<datanucleus-jdo-query.version>6.0.1</datanucleus-jdo-query.version>
|
||||
<javax.jdo.version>3.2.1</javax.jdo.version>
|
||||
<HikariCP.version>5.0.1</HikariCP.version>
|
||||
<ebean.version>13.15.2</ebean.version>
|
||||
<debezium.version>2.1.3.Final</debezium.version>
|
||||
<testcontainers-version>1.17.6</testcontainers-version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -1,12 +1,13 @@
|
|||
package com.baeldung.libraries.ebean.app;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.baeldung.libraries.ebean.model.Address;
|
||||
import com.baeldung.libraries.ebean.model.Customer;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.EbeanServer;
|
||||
import io.ebean.annotation.Transactional;
|
||||
|
||||
import java.util.Arrays;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.Database;
|
||||
import io.ebean.annotation.Transactional;
|
||||
|
||||
public class App {
|
||||
|
||||
|
@ -20,7 +21,7 @@ public class App {
|
|||
public static void insertAndDeleteInsideTransaction() {
|
||||
|
||||
Customer c1 = getCustomer();
|
||||
EbeanServer server = Ebean.getDefaultServer();
|
||||
Database server = DB.getDefault();
|
||||
server.save(c1);
|
||||
Customer foundC1 = server.find(Customer.class, c1.getId());
|
||||
server.delete(foundC1);
|
||||
|
@ -31,16 +32,16 @@ public class App {
|
|||
Address a1 = new Address("5, Wide Street", null, "New York");
|
||||
Customer c1 = new Customer("John Wide", a1);
|
||||
|
||||
EbeanServer server = Ebean.getDefaultServer();
|
||||
Database server = DB.getDefault();
|
||||
server.save(c1);
|
||||
|
||||
c1.setName("Jane Wide");
|
||||
c1.setAddress(null);
|
||||
server.save(c1);
|
||||
|
||||
Customer foundC1 = Ebean.find(Customer.class, c1.getId());
|
||||
Customer foundC1 = DB.find(Customer.class, c1.getId());
|
||||
|
||||
Ebean.delete(foundC1);
|
||||
DB.delete(foundC1);
|
||||
}
|
||||
|
||||
public static void queryCustomers() {
|
||||
|
@ -53,16 +54,16 @@ public class App {
|
|||
Address a3 = new Address("3, Big Street", null, "San Jose");
|
||||
Customer c3 = new Customer("Big Bob", a3);
|
||||
|
||||
Ebean.saveAll(Arrays.asList(c1, c2, c3));
|
||||
DB.saveAll(Arrays.asList(c1, c2, c3));
|
||||
|
||||
Customer customer = Ebean.find(Customer.class)
|
||||
Customer customer = DB.find(Customer.class)
|
||||
.select("name")
|
||||
.fetch("address", "city")
|
||||
.where()
|
||||
.eq("city", "San Jose")
|
||||
.findOne();
|
||||
|
||||
Ebean.deleteAll(Arrays.asList(c1, c2, c3));
|
||||
DB.deleteAll(Arrays.asList(c1, c2, c3));
|
||||
}
|
||||
|
||||
private static Customer getCustomer() {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package com.baeldung.libraries.ebean.app;
|
||||
|
||||
import io.ebean.EbeanServer;
|
||||
import io.ebean.EbeanServerFactory;
|
||||
import io.ebean.config.ServerConfig;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import io.ebean.Database;
|
||||
import io.ebean.DatabaseFactory;
|
||||
import io.ebean.config.DatabaseConfig;
|
||||
|
||||
public class App2 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
ServerConfig cfg = new ServerConfig();
|
||||
DatabaseConfig cfg = new DatabaseConfig();
|
||||
cfg.setDefaultServer(true);
|
||||
Properties properties = new Properties();
|
||||
properties.put("ebean.db.ddl.generate", "true");
|
||||
|
@ -19,8 +19,6 @@ public class App2 {
|
|||
properties.put("datasource.db.databaseUrl", "jdbc:h2:mem:app2");
|
||||
properties.put("datasource.db.databaseDriver", "org.h2.Driver");
|
||||
cfg.loadFromProperties(properties);
|
||||
EbeanServer server = EbeanServerFactory.create(cfg);
|
||||
|
||||
Database server = DatabaseFactory.create(cfg);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ public class GuideToJDO {
|
|||
|
||||
pumd = new PersistenceUnitMetaData("dynamic-unit", "RESOURCE_LOCAL", null);
|
||||
pumd.addClassName("com.baeldung.libraries.jdo.Product");
|
||||
pumd.setExcludeUnlistedClasses();
|
||||
pumd.setExcludeUnlistedClasses(true);
|
||||
pumd.addProperty("javax.jdo.option.ConnectionDriverName", "org.h2.Driver");
|
||||
pumd.addProperty("javax.jdo.option.ConnectionURL", "jdbc:h2:mem:mypersistence");
|
||||
pumd.addProperty("javax.jdo.option.ConnectionUserName", "sa");
|
||||
|
@ -57,7 +57,7 @@ public class GuideToJDO {
|
|||
public void CreateXMLProperties() {
|
||||
pumdXML = new PersistenceUnitMetaData("dynamic-unit", "RESOURCE_LOCAL", null);
|
||||
pumdXML.addClassName("com.baeldung.libraries.jdo.ProductXML");
|
||||
pumdXML.setExcludeUnlistedClasses();
|
||||
pumdXML.setExcludeUnlistedClasses(true);
|
||||
pumdXML.addProperty("javax.jdo.option.ConnectionURL", "xml:file:myPersistence.xml");
|
||||
pumdXML.addProperty("datanucleus.autoCreateSchema", "true");
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ public class GuideToJDOIntegrationTest {
|
|||
public void givenProduct_WhenNewThenPerformTransaction() {
|
||||
PersistenceUnitMetaData pumd = new PersistenceUnitMetaData("dynamic-unit", "RESOURCE_LOCAL", null);
|
||||
pumd.addClassName("com.baeldung.libraries.jdo.Product");
|
||||
pumd.setExcludeUnlistedClasses();
|
||||
pumd.setExcludeUnlistedClasses(true);
|
||||
pumd.addProperty("javax.jdo.option.ConnectionDriverName", "org.h2.Driver");
|
||||
pumd.addProperty("javax.jdo.option.ConnectionURL", "jdbc:h2:mem:mypersistence");
|
||||
pumd.addProperty("javax.jdo.option.ConnectionUserName", "sa");
|
||||
|
@ -53,7 +53,7 @@ public class GuideToJDOIntegrationTest {
|
|||
public void givenProduct_WhenQueryThenExist() {
|
||||
PersistenceUnitMetaData pumd = new PersistenceUnitMetaData("dynamic-unit", "RESOURCE_LOCAL", null);
|
||||
pumd.addClassName("com.baeldung.libraries.jdo.Product");
|
||||
pumd.setExcludeUnlistedClasses();
|
||||
pumd.setExcludeUnlistedClasses(true);
|
||||
pumd.addProperty("javax.jdo.option.ConnectionDriverName", "org.h2.Driver");
|
||||
pumd.addProperty("javax.jdo.option.ConnectionURL", "jdbc:h2:mem:mypersistence");
|
||||
pumd.addProperty("javax.jdo.option.ConnectionUserName", "sa");
|
||||
|
|
|
@ -80,6 +80,8 @@ public class ORMLiteIntegrationTest {
|
|||
wrappedIterable.forEach(lib -> {
|
||||
System.out.println(lib.getName());
|
||||
});
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -162,7 +164,7 @@ public class ORMLiteIntegrationTest {
|
|||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDown() throws SQLException, IOException {
|
||||
public static void tearDown() throws Exception {
|
||||
connectionSource.close();
|
||||
}
|
||||
}
|
||||
|
|
4
pom.xml
4
pom.xml
|
@ -348,7 +348,6 @@
|
|||
<!-- <module>lagom</module> --> <!-- Not a maven project -->
|
||||
<module>language-interop</module>
|
||||
<module>libraries-3</module>
|
||||
<module>libraries-data-db</module>
|
||||
|
||||
<module>lombok-modules</module>
|
||||
|
||||
|
@ -537,7 +536,6 @@
|
|||
<!-- <module>lagom</module> --> <!-- Not a maven project -->
|
||||
<module>language-interop</module>
|
||||
<module>libraries-3</module>
|
||||
<module>libraries-data-db</module>
|
||||
|
||||
<module>lombok-modules</module>
|
||||
<module>muleesb</module>
|
||||
|
@ -751,6 +749,7 @@
|
|||
<module>spring-integration</module>
|
||||
<module>spring-remoting-modules</module>
|
||||
<module>libraries-security</module>
|
||||
<module>libraries-data-db</module>
|
||||
|
||||
<module>performance-tests</module>
|
||||
<module>security-modules</module>
|
||||
|
@ -1025,6 +1024,7 @@
|
|||
<module>spring-integration</module>
|
||||
<module>spring-remoting-modules</module>
|
||||
<module>libraries-security</module>
|
||||
<module>libraries-data-db</module>
|
||||
|
||||
<module>performance-tests</module>
|
||||
<module>security-modules</module>
|
||||
|
|
Loading…
Reference in New Issue