Skip to content

Commit 1583397

Browse files
authored
[JAVA-47035] Created new module libraries-data-db-2 and moved code from libraries-data-db (#18597)
1 parent 22e363e commit 1583397

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+395
-266
lines changed

libraries-data-db-2/pom.xml

Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,280 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<artifactId>libraries-data-db-2</artifactId>
7+
<name>libraries-data-db-2</name>
8+
9+
<parent>
10+
<groupId>com.baeldung</groupId>
11+
<artifactId>parent-boot-3</artifactId>
12+
<version>0.0.1-SNAPSHOT</version>
13+
<relativePath>../parent-boot-3</relativePath>
14+
</parent>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>com.goldmansachs.reladomo</groupId>
19+
<artifactId>reladomo</artifactId>
20+
<version>${reladomo.version}</version>
21+
</dependency>
22+
<dependency>
23+
<groupId>com.goldmansachs.reladomo</groupId>
24+
<artifactId>reladomo-test-util</artifactId>
25+
<version>${reladomo.version}</version>
26+
</dependency>
27+
<dependency>
28+
<groupId>com.j256.ormlite</groupId>
29+
<artifactId>ormlite-jdbc</artifactId>
30+
<version>${ormlite.version}</version>
31+
</dependency>
32+
<!-- JDO -->
33+
<dependency>
34+
<groupId>org.datanucleus</groupId>
35+
<artifactId>javax.jdo</artifactId>
36+
<version>${javax.jdo.version}</version>
37+
</dependency>
38+
<dependency>
39+
<groupId>org.datanucleus</groupId>
40+
<artifactId>datanucleus-core</artifactId>
41+
<version>${datanucleus.version}</version>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.datanucleus</groupId>
45+
<artifactId>datanucleus-api-jdo</artifactId>
46+
<version>${datanucleus-api.version}</version>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.datanucleus</groupId>
50+
<artifactId>datanucleus-rdbms</artifactId>
51+
<version>${datanucleus.version}</version>
52+
</dependency>
53+
<dependency>
54+
<groupId>org.datanucleus</groupId>
55+
<artifactId>datanucleus-maven-plugin</artifactId>
56+
<version>${datanucleus-maven-plugin.version}</version>
57+
</dependency>
58+
<dependency>
59+
<groupId>org.datanucleus</groupId>
60+
<artifactId>datanucleus-jdo-query</artifactId>
61+
<version>${datanucleus-jdo-query.version}</version>
62+
</dependency>
63+
<dependency>
64+
<groupId>com.h2database</groupId>
65+
<artifactId>h2</artifactId>
66+
</dependency>
67+
<!-- ebean -->
68+
<dependency>
69+
<groupId>io.ebean</groupId>
70+
<artifactId>ebean</artifactId>
71+
<version>${ebean.version}</version>
72+
<exclusions>
73+
<exclusion>
74+
<groupId>com.fasterxml.jackson.core</groupId>
75+
<artifactId>jackson-core</artifactId>
76+
</exclusion>
77+
</exclusions>
78+
</dependency>
79+
<!-- flexypool -->
80+
<dependency>
81+
<groupId>com.vladmihalcea.flexy-pool</groupId>
82+
<artifactId>flexy-micrometer-metrics</artifactId>
83+
<version>${flexy-pool.version}</version>
84+
</dependency>
85+
<dependency>
86+
<groupId>com.vladmihalcea.flexy-pool</groupId>
87+
<artifactId>flexy-hikaricp</artifactId>
88+
<version>${flexy-pool.version}</version>
89+
<exclusions>
90+
<exclusion>
91+
<groupId>com.vladmihalcea.flexy-pool</groupId>
92+
<artifactId>flexy-dropwizard-metrics</artifactId>
93+
</exclusion>
94+
</exclusions>
95+
</dependency>
96+
<!-- Spring Core dependencies -->
97+
<dependency>
98+
<groupId>org.springframework.boot</groupId>
99+
<artifactId>spring-boot-starter-web</artifactId>
100+
</dependency>
101+
<!-- Spring Data JPA, crud repository -->
102+
<dependency>
103+
<groupId>org.springframework.boot</groupId>
104+
<artifactId>spring-boot-starter-data-jpa</artifactId>
105+
</dependency>
106+
<!-- MySQL -->
107+
<dependency>
108+
<groupId>com.mysql</groupId>
109+
<artifactId>mysql-connector-j</artifactId>
110+
</dependency>
111+
<!-- Utility dependencies -->
112+
<dependency>
113+
<groupId>org.projectlombok</groupId>
114+
<artifactId>lombok</artifactId>
115+
<version>${lombok.version}</version>
116+
</dependency>
117+
<dependency>
118+
<groupId>io.ebean</groupId>
119+
<artifactId>ebean-api</artifactId>
120+
<version>${ebean.version}</version>
121+
</dependency>
122+
<dependency>
123+
<groupId>jakarta.xml.bind</groupId>
124+
<artifactId>jakarta.xml.bind-api</artifactId>
125+
<version>${jakarta.xml.bind.version}</version>
126+
</dependency>
127+
<!-- TigerBeetle -->
128+
<dependency>
129+
<groupId>com.tigerbeetle</groupId>
130+
<artifactId>tigerbeetle-java</artifactId>
131+
<version>0.15.3</version>
132+
</dependency>
133+
</dependencies>
134+
135+
<build>
136+
<finalName>libraries-data-db</finalName>
137+
<plugins>
138+
<!-- Reladomo -->
139+
<plugin>
140+
<groupId>org.apache.maven.plugins</groupId>
141+
<artifactId>maven-antrun-plugin</artifactId>
142+
<version>${maven-antrun-plugin.version}</version>
143+
<executions>
144+
<execution>
145+
<id>generateMithra</id>
146+
<phase>generate-sources</phase>
147+
<goals>
148+
<goal>run</goal>
149+
</goals>
150+
<configuration>
151+
<tasks>
152+
<property name="plugin_classpath"
153+
refid="maven.plugin.classpath"/>
154+
<taskdef name="gen-reladomo" classpath="plugin_classpath"
155+
classname="com.gs.fw.common.mithra.generator.MithraGenerator"/>
156+
<gen-reladomo
157+
xml="${project.basedir}/src/main/resources/reladomo/ReladomoClassList.xml"
158+
generatedDir="${project.build.directory}/generated-sources/reladomo"
159+
nonGeneratedDir="${project.basedir}/src/main/java"/>
160+
<taskdef name="gen-ddl"
161+
classname="com.gs.fw.common.mithra.generator.dbgenerator.MithraDbDefinitionGenerator"
162+
loaderRef="reladomoGenerator">
163+
<classpath refid="maven.plugin.classpath"/>
164+
</taskdef>
165+
<gen-ddl
166+
xml="${project.basedir}/src/main/resources/reladomo/ReladomoClassList.xml"
167+
generatedDir="${project.build.directory}/generated-db/sql"
168+
databaseType="postgres"/>
169+
</tasks>
170+
</configuration>
171+
</execution>
172+
</executions>
173+
<dependencies>
174+
<dependency>
175+
<groupId>com.goldmansachs.reladomo</groupId>
176+
<artifactId>reladomogen</artifactId>
177+
<version>${reladomo.version}</version>
178+
</dependency>
179+
<dependency>
180+
<groupId>com.goldmansachs.reladomo</groupId>
181+
<artifactId>reladomo-gen-util</artifactId>
182+
<version>${reladomo.version}</version>
183+
</dependency>
184+
</dependencies>
185+
</plugin>
186+
<plugin>
187+
<groupId>org.codehaus.mojo</groupId>
188+
<artifactId>build-helper-maven-plugin</artifactId>
189+
<version>${build-helper-maven-plugin.version}</version>
190+
<executions>
191+
<execution>
192+
<id>add-source</id>
193+
<phase>generate-sources</phase>
194+
<goals>
195+
<goal>add-source</goal>
196+
</goals>
197+
<configuration>
198+
<sources>
199+
<source>${project.build.directory}/generated-sources/reladomo</source>
200+
</sources>
201+
</configuration>
202+
</execution>
203+
<execution>
204+
<id>add-resource</id>
205+
<phase>generate-resources</phase>
206+
<goals>
207+
<goal>add-resource</goal>
208+
</goals>
209+
<configuration>
210+
<resources>
211+
<resource>
212+
<directory>${project.build.directory}/generated-db/</directory>
213+
</resource>
214+
</resources>
215+
</configuration>
216+
</execution>
217+
</executions>
218+
</plugin>
219+
<!-- /Reladomo -->
220+
<!-- JDO Plugin -->
221+
<plugin>
222+
<groupId>org.datanucleus</groupId>
223+
<artifactId>datanucleus-maven-plugin</artifactId>
224+
<version>${datanucleus-maven-plugin.version}</version>
225+
<configuration>
226+
<api>JDO</api>
227+
<props>${basedir}/datanucleus.properties</props>
228+
<log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
229+
<verbose>true</verbose>
230+
<fork>false</fork>
231+
<!-- Solve windows line too long error -->
232+
</configuration>
233+
<executions>
234+
<execution>
235+
<phase>process-classes</phase>
236+
<goals>
237+
<goal>enhance</goal>
238+
</goals>
239+
</execution>
240+
</executions>
241+
</plugin>
242+
<plugin>
243+
<groupId>io.ebean</groupId>
244+
<artifactId>ebean-maven-plugin</artifactId>
245+
<version>${ebean.plugin.version}</version>
246+
<executions>
247+
<!-- enhance main classes -->
248+
<execution>
249+
<id>main</id>
250+
<phase>process-classes</phase>
251+
<configuration>
252+
<transformArgs>debug=1</transformArgs>
253+
</configuration>
254+
<goals>
255+
<goal>enhance</goal>
256+
</goals>
257+
</execution>
258+
</executions>
259+
</plugin>
260+
</plugins>
261+
</build>
262+
263+
<properties>
264+
<ebean.plugin.version>13.25.2</ebean.plugin.version>
265+
<reladomo.version>18.1.0</reladomo.version>
266+
<build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version>
267+
<maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
268+
<ormlite.version>6.1</ormlite.version>
269+
<datanucleus.version>6.0.6</datanucleus.version>
270+
<datanucleus-api.version>6.0.1</datanucleus-api.version>
271+
<datanucleus-maven-plugin.version>6.0.0-release</datanucleus-maven-plugin.version>
272+
<datanucleus-jdo-query.version>6.0.1</datanucleus-jdo-query.version>
273+
<javax.jdo.version>3.2.1</javax.jdo.version>
274+
<ebean.version>13.15.2</ebean.version>
275+
<flexy-pool.version>2.2.3</flexy-pool.version>
276+
<jakarta.xml.bind.version>4.0.1</jakarta.xml.bind.version>
277+
<spring-boot.repackage.skip>true</spring-boot.repackage.skip> <!-- to avoid repackaging of the jar -->
278+
</properties>
279+
280+
</project>
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
package com.baeldung.libraries.flexypool;
2+
3+
import java.sql.Date;
4+
5+
public class Employee {
6+
7+
private int empNo;
8+
private String ename;
9+
private String job;
10+
private int mgr;
11+
private Date hiredate;
12+
private int sal;
13+
private int comm;
14+
private int deptno;
15+
16+
public int getEmpNo() {
17+
return empNo;
18+
}
19+
20+
public void setEmpNo(int empNo) {
21+
this.empNo = empNo;
22+
}
23+
24+
public String getEname() {
25+
return ename;
26+
}
27+
28+
public void setEname(String ename) {
29+
this.ename = ename;
30+
}
31+
32+
public String getJob() {
33+
return job;
34+
}
35+
36+
public void setJob(String job) {
37+
this.job = job;
38+
}
39+
40+
public int getMgr() {
41+
return mgr;
42+
}
43+
44+
public void setMgr(int mgr) {
45+
this.mgr = mgr;
46+
}
47+
48+
public Date getHiredate() {
49+
return hiredate;
50+
}
51+
52+
public void setHiredate(Date hiredate) {
53+
this.hiredate = hiredate;
54+
}
55+
56+
public int getSal() {
57+
return sal;
58+
}
59+
60+
public void setSal(int sal) {
61+
this.sal = sal;
62+
}
63+
64+
public int getComm() {
65+
return comm;
66+
}
67+
68+
public void setComm(int comm) {
69+
this.comm = comm;
70+
}
71+
72+
public int getDeptno() {
73+
return deptno;
74+
}
75+
76+
public void setDeptno(int deptno) {
77+
this.deptno = deptno;
78+
}
79+
80+
@Override
81+
public String toString() {
82+
return String.format("Employee [empNo=%d, ename=%s, job=%s, mgr=%d, hiredate=%s, sal=%d, comm=%d, deptno=%d]", empNo, ename, job, mgr, hiredate, sal, comm, deptno);
83+
}
84+
85+
}

libraries-data-db/src/main/java/com/baeldung/libraries/flexypool/FlexypoolDemoApplication.java renamed to libraries-data-db-2/src/main/java/com/baeldung/libraries/flexypool/FlexypoolDemoApplication.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.baeldung.libraries.flexypool;
22

3-
import com.baeldung.libraries.hikaricp.Employee;
43
import com.vladmihalcea.flexypool.FlexyPoolDataSource;
54
import com.zaxxer.hikari.HikariDataSource;
65
import org.springframework.boot.SpringApplication;

0 commit comments

Comments
 (0)