Skip to content

Commit 3f501e1

Browse files
Merge pull request #18 from xdev-software/develop
v1.0.1
2 parents 789dc9a + 1d6aeee commit 3f501e1

File tree

47 files changed

+1480
-76
lines changed

Some content is hidden

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

47 files changed

+1480
-76
lines changed

.github/workflows/checkBuild.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
strategy:
2929
matrix:
30-
java: [17, 21]
30+
java: [17, 21.0.1]
3131
distribution: [temurin]
3232

3333
steps:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ target/
6868

6969
# EclipseStore
7070
storage
71+
storage-jpa
7172

7273
# == IntelliJ ==
7374
*.iml

.run/Run JPA Demo.run.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Run JPA Demo" type="Application" factoryName="Application">
3+
<option name="MAIN_CLASS_NAME" value="software.xdev.spring.data.eclipse.store.jpa.JpaDemoApplication" />
4+
<module name="spring-data-eclipse-store-jpa" />
5+
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
6+
<extension name="coverage">
7+
<pattern>
8+
<option name="PATTERN" value="software.xdev.*" />
9+
<option name="ENABLED" value="true" />
10+
</pattern>
11+
</extension>
12+
<method v="2">
13+
<option name="Make" enabled="true" />
14+
</method>
15+
</configuration>
16+
</component>

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1+
# 1.0.1
2+
3+
* Fix for NullPointerException when storing an entity with Auto-ID and no previous action on the database.
4+
* Provide multiple Repository Interfaces, not only EclipseStoreRepository (e.g. EclipseStoreCrudRepository).
5+
16
# 1.0.0
7+
28
* Initial release
9+

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ After adding the library in your dependencies, using it is as easy as adding the
6767

6868
## Demo
6969

70-
To see how easy it is to implement EclipseStore in your Spring project, take a look at the two
70+
To see how easy it is to implement EclipseStore in your Spring project, take a look at the three
7171
[demos](./spring-data-eclipse-store-demo):<br/>
72-
A [simple](./spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/simple)
73-
and a
74-
more [complex demo](./spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex).
72+
A [simple](./spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/simple), a
73+
more [complex demo](./spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex)
74+
and
75+
a [demo with coexisting JPA](./spring-data-eclipse-store-jpa/src/main/java/software/xdev/spring/data/eclipse/store/jpa).
7576

7677
> [!NOTE]
7778
> Since the library is using reflection to copy data, the following JVM-Arguments may have to be set:

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<module>spring-data-eclipse-store</module>
1919
<module>spring-data-eclipse-store-demo</module>
2020
<module>spring-data-eclipse-store-benchmark</module>
21+
<module>spring-data-eclipse-store-jpa</module>
2122
</modules>
2223

2324
<licenses>

spring-data-eclipse-store-benchmark/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
<dependency>
9797
<groupId>com.puppycrawl.tools</groupId>
9898
<artifactId>checkstyle</artifactId>
99-
<version>10.12.7</version>
99+
<version>10.13.0</version>
100100
</dependency>
101101
</dependencies>
102102
<configuration>

spring-data-eclipse-store-demo/pom.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2424
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
2525

26-
<mainClass>software.xdev.Application</mainClass>
26+
<mainClass>software.xdev.spring.data.eclipse.store.demo.complex.ComplexDemoApplication</mainClass>
2727

2828
<org.springframework.boot.version>3.2.2</org.springframework.boot.version>
2929
</properties>
@@ -80,6 +80,13 @@
8080
<groupId>org.springframework.boot</groupId>
8181
<artifactId>spring-boot-maven-plugin</artifactId>
8282
<version>${org.springframework.boot.version}</version>
83+
<configuration>
84+
<mainClass>${mainClass}</mainClass>
85+
<jvmArguments>
86+
--add-opens java.base/java.util=ALL-UNNAMED
87+
--add-opens java.base/java.time=ALL-UNNAMED
88+
</jvmArguments>
89+
</configuration>
8390
</plugin>
8491
</plugins>
8592
</build>
@@ -96,7 +103,7 @@
96103
<dependency>
97104
<groupId>com.puppycrawl.tools</groupId>
98105
<artifactId>checkstyle</artifactId>
99-
<version>10.12.7</version>
106+
<version>10.13.0</version>
100107
</dependency>
101108
</dependencies>
102109
<configuration>

spring-data-eclipse-store-jpa/pom.xml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
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+
7+
<groupId>software.xdev</groupId>
8+
<artifactId>spring-data-eclipse-store-jpa</artifactId>
9+
<version>1.0.1-SNAPSHOT</version>
10+
<packaging>jar</packaging>
11+
12+
<inceptionYear>2023</inceptionYear>
13+
14+
<organization>
15+
<name>XDEV Software</name>
16+
<url>https://xdev.software</url>
17+
</organization>
18+
19+
<properties>
20+
<javaVersion>17</javaVersion>
21+
<maven.compiler.release>${javaVersion}</maven.compiler.release>
22+
23+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
24+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
25+
26+
<mainClass>software.xdev.spring.data.eclipse.store.demo.complex.ComplexDemoApplication</mainClass>
27+
28+
<org.springframework.boot.version>3.2.2</org.springframework.boot.version>
29+
</properties>
30+
31+
<dependencyManagement>
32+
<dependencies>
33+
<dependency>
34+
<groupId>org.springframework.boot</groupId>
35+
<artifactId>spring-boot-dependencies</artifactId>
36+
<version>${org.springframework.boot.version}</version>
37+
<type>pom</type>
38+
<scope>import</scope>
39+
</dependency>
40+
</dependencies>
41+
</dependencyManagement>
42+
43+
<dependencies>
44+
<dependency>
45+
<groupId>org.springframework.boot</groupId>
46+
<artifactId>spring-boot-autoconfigure</artifactId>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.springframework.boot</groupId>
50+
<artifactId>spring-boot-starter-data-jpa</artifactId>
51+
</dependency>
52+
<dependency>
53+
<groupId>com.h2database</groupId>
54+
<artifactId>h2</artifactId>
55+
</dependency>
56+
<dependency>
57+
<groupId>software.xdev</groupId>
58+
<artifactId>spring-data-eclipse-store</artifactId>
59+
<version>${project.version}</version>
60+
</dependency>
61+
62+
<dependency>
63+
<groupId>org.junit.jupiter</groupId>
64+
<artifactId>junit-jupiter-engine</artifactId>
65+
<scope>test</scope>
66+
</dependency>
67+
<dependency>
68+
<groupId>org.junit.jupiter</groupId>
69+
<artifactId>junit-jupiter-api</artifactId>
70+
<scope>test</scope>
71+
</dependency>
72+
<dependency>
73+
<groupId>org.junit.jupiter</groupId>
74+
<artifactId>junit-jupiter-params</artifactId>
75+
<scope>test</scope>
76+
</dependency>
77+
<dependency>
78+
<groupId>org.springframework</groupId>
79+
<artifactId>spring-test</artifactId>
80+
<scope>test</scope>
81+
</dependency>
82+
</dependencies>
83+
84+
<build>
85+
<finalName>${project.artifactId}</finalName>
86+
87+
<plugins>
88+
<plugin>
89+
<groupId>org.apache.maven.plugins</groupId>
90+
<artifactId>maven-compiler-plugin</artifactId>
91+
<version>3.12.1</version>
92+
<configuration>
93+
<release>${maven.compiler.release}</release>
94+
<compilerArgs>
95+
<arg>-proc:none</arg>
96+
</compilerArgs>
97+
</configuration>
98+
</plugin>
99+
<plugin>
100+
<groupId>org.springframework.boot</groupId>
101+
<artifactId>spring-boot-maven-plugin</artifactId>
102+
<version>${org.springframework.boot.version}</version>
103+
<configuration>
104+
<mainClass>${mainClass}</mainClass>
105+
<jvmArguments>
106+
--add-opens java.base/java.util=ALL-UNNAMED
107+
--add-opens java.base/java.time=ALL-UNNAMED
108+
</jvmArguments>
109+
</configuration>
110+
</plugin>
111+
</plugins>
112+
</build>
113+
<profiles>
114+
<profile>
115+
<id>checkstyle</id>
116+
<build>
117+
<plugins>
118+
<plugin>
119+
<groupId>org.apache.maven.plugins</groupId>
120+
<artifactId>maven-checkstyle-plugin</artifactId>
121+
<version>3.3.1</version>
122+
<dependencies>
123+
<dependency>
124+
<groupId>com.puppycrawl.tools</groupId>
125+
<artifactId>checkstyle</artifactId>
126+
<version>10.12.7</version>
127+
</dependency>
128+
</dependencies>
129+
<configuration>
130+
<configLocation>../.config/checkstyle/checkstyle.xml</configLocation>
131+
</configuration>
132+
<executions>
133+
<execution>
134+
<goals>
135+
<goal>check</goal>
136+
</goals>
137+
</execution>
138+
</executions>
139+
</plugin>
140+
</plugins>
141+
</build>
142+
</profile>
143+
</profiles>
144+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package software.xdev.spring.data.eclipse.store.jpa;
2+
3+
import jakarta.persistence.Id;
4+
5+
6+
public class CustomerInEclipseStore
7+
{
8+
@Id
9+
private String id;
10+
11+
private String firstName;
12+
private String lastName;
13+
14+
public CustomerInEclipseStore(final String id, final String firstName, final String lastName)
15+
{
16+
this.id = id;
17+
this.firstName = firstName;
18+
this.lastName = lastName;
19+
}
20+
21+
public CustomerInEclipseStore()
22+
{
23+
24+
}
25+
26+
@Override
27+
public String toString()
28+
{
29+
return String.format(
30+
"Customer[id=%s, firstName='%s', lastName='%s']",
31+
this.id, this.firstName, this.lastName);
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package software.xdev.spring.data.eclipse.store.jpa;
2+
3+
import software.xdev.spring.data.eclipse.store.repository.interfaces.EclipseStoreCrudRepository;
4+
5+
6+
/**
7+
* To be able to properly coexist with JPA in one project, the repositories must be declared as specific JPA- or
8+
* EclipseStore-Repositories.
9+
*/
10+
public interface CustomerInEclipseStoreRepository extends EclipseStoreCrudRepository<CustomerInEclipseStore, String>
11+
{
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package software.xdev.spring.data.eclipse.store.jpa;
2+
3+
import jakarta.persistence.Entity;
4+
import jakarta.persistence.Id;
5+
6+
7+
@Entity
8+
public class CustomerInJpa
9+
{
10+
@Id
11+
private String id;
12+
13+
private String firstName;
14+
private String lastName;
15+
16+
public CustomerInJpa(final String id, final String firstName, final String lastName)
17+
{
18+
this.id = id;
19+
this.firstName = firstName;
20+
this.lastName = lastName;
21+
}
22+
23+
public CustomerInJpa()
24+
{
25+
26+
}
27+
28+
@Override
29+
public String toString()
30+
{
31+
return String.format(
32+
"Customer[id=%s, firstName='%s', lastName='%s']",
33+
this.id, this.firstName, this.lastName);
34+
}
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package software.xdev.spring.data.eclipse.store.jpa;
2+
3+
import org.springframework.data.jpa.repository.JpaRepository;
4+
5+
6+
/**
7+
* To be able to properly coexist with JPA in one project, the repositories must be declared as specific JPA- or
8+
* EclipseStore-Repositories.
9+
*/
10+
public interface CustomerInJpaRepository extends JpaRepository<CustomerInJpa, String>
11+
{
12+
}

0 commit comments

Comments
 (0)