Skip to content

Commit 918e9a5

Browse files
Merge pull request #127 from xdev-software/develop
v2.0.0
2 parents 1bf4d6b + eb0e2ac commit 918e9a5

File tree

99 files changed

+1624
-357
lines changed

Some content is hidden

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

99 files changed

+1624
-357
lines changed

.config/pmd/ruleset.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@
5959
<!-- Prohibits singleton pattern -->
6060
<exclude name="MutableStaticState"/>
6161

62+
<!-- Checks LoC, already handled by Checkstyle -->
63+
<exclude name="NcssCount"/>
64+
6265
<!-- Some override methods or Junit require this -->
6366
<exclude name="SignatureDeclareThrowsException"/>
6467

.github/workflows/test-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
2525

2626
- name: Publish to OSSRH
27-
run: ../mvnw -B deploy -Possrh
27+
run: ../mvnw -B deploy -Possrh -DskipTests
2828
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
2929
env:
3030
MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 2.0.0
2+
3+
* Restructured root to improve performance with IDs in entities
4+
* Implemented auto migration for older version (<2.0.0).
5+
Added [XDEV MicroMigration](https://github.com/xdev-software/micro-migration) as dependency.
6+
* Updated EclipseStore version to 1.4.0
7+
* Updated Spring to version 3.3.2
8+
19
# 1.0.10
210

311
* Optimistic locking with @Version now possible

CONTRIBUTING.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,31 @@ If the ``develop`` is ready for release, create a pull request to the ``master``
4444

4545
When the release is finished do the following:
4646
* Merge the auto-generated PR (with the incremented version number) back into the ``develop``
47+
48+
### Release failures
49+
50+
There are 2 modes of release failure:
51+
1. The remote server was e.g. down and non of the artifacts got published
52+
2. There was a build failure during release and only parts of the artifacts got released
53+
54+
In case 1 we can re-release the existing version,<br/>in case 2 we have to release a new version when we can't get the artifacts deleted (as is the case with Maven Central)
55+
56+
#### How-to: Re-Releasing an existing version
57+
58+
1. Delete the release on GitHub
59+
2. Delete the release Git tag from the repo (locally and remote!)
60+
3. Delete the ``master``-Branch and re-create it from the ``develop`` branch (or reset it to the state before the release-workflow commits have been done)
61+
* This requires __temporarily__ removing the branch protection
62+
* Once this was done a new release is triggered immediately!
63+
64+
#### How-to: Releasing a new version
65+
66+
1. Merge the ``master`` branch back into ``develop`` (or another temporary branch)
67+
2. Make sure all master branch versions are prepared for a new release<br/>e.g. if the broken release was ``1.0.0`` the version should now be at ``1.0.1-SNAPSHOT`` - the ``SNAPSHOT`` is important for the workflow!
68+
3. Mark the broken release as broken e.g. inside the Changelog, GitHub Release page, etc.<br/>
69+
You can use something like this:
70+
```
71+
> [!WARNING]
72+
> This release is broken as my cat accidentally clicked the abort button during the process
73+
```
74+
4. Merge the changes back into the ``master`` branch to trigger a new release

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ instructions** are in the documentation](https://xdev-software.github.io/spring-
5454
| ``<= 1.0.2`` | ``17`` | ``3.2.2`` | ``1.1.0`` |
5555
| ``1.0.3/1.0.4`` | ``17`` | ``3.2.3`` | ``1.2.0`` |
5656
| ``1.0.5-1.0.7`` | ``17`` | ``3.2.5`` | ``1.3.2`` |
57-
| ``>= 1.0.8`` | ``17`` | ``3.3.1`` | ``1.3.2`` |
57+
| ``1.0.8-1.0.10`` | ``17`` | ``3.3.1`` | ``1.3.2`` |
58+
| ``>= 2.0.0`` | ``17`` | ``3.3.2`` | ``1.4.0`` |
5859

5960
## Demo
6061

docs/antora.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: ROOT
22
title: Spring-Data-Eclipse-Store
33
version: master
4-
display_version: '1.0.10'
4+
display_version: '2.0.0'
55
start_page: index.adoc
66
nav:
77
- modules/ROOT/nav.adoc
88
asciidoc:
99
attributes:
1010
product-name: 'Spring-Data-Eclipse-Store'
11-
display-version: '1.0.10'
12-
maven-version: '1.0.10'
11+
display-version: '2.0.0'
12+
maven-version: '2.0.0'
1313
page-editable: false
1414
page-out-of-support: false

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>software.xdev</groupId>
88
<artifactId>spring-data-eclipse-store-root</artifactId>
9-
<version>1.0.11-SNAPSHOT</version>
9+
<version>2.0.0-SNAPSHOT</version>
1010
<packaging>pom</packaging>
1111

1212
<organization>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
<parent>
66
<groupId>software.xdev</groupId>
77
<artifactId>spring-data-eclipse-store-root</artifactId>
8-
<version>1.0.11-SNAPSHOT</version>
8+
<version>2.0.0-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>spring-data-eclipse-store-benchmark</artifactId>
12-
<version>1.0.11-SNAPSHOT</version>
12+
<version>2.0.0-SNAPSHOT</version>
1313
<packaging>jar</packaging>
1414

1515
<inceptionYear>2023</inceptionYear>
@@ -25,7 +25,7 @@
2525
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2626
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
2727

28-
<org.springframework.boot.version>3.3.1</org.springframework.boot.version>
28+
<org.springframework.boot.version>3.3.2</org.springframework.boot.version>
2929
<jmh.version>1.37</jmh.version>
3030
</properties>
3131

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

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<parent>
88
<groupId>software.xdev</groupId>
99
<artifactId>spring-data-eclipse-store-root</artifactId>
10-
<version>1.0.11-SNAPSHOT</version>
10+
<version>2.0.0-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>spring-data-eclipse-store-demo</artifactId>
14-
<version>1.0.11-SNAPSHOT</version>
14+
<version>2.0.0-SNAPSHOT</version>
1515
<packaging>jar</packaging>
1616

1717
<organization>
@@ -28,7 +28,7 @@
2828

2929
<mainClass>software.xdev.spring.data.eclipse.store.demo.complex.ComplexDemoApplication</mainClass>
3030

31-
<org.springframework.boot.version>3.3.1</org.springframework.boot.version>
31+
<org.springframework.boot.version>3.3.2</org.springframework.boot.version>
3232
</properties>
3333

3434
<dependencyManagement>
@@ -64,16 +64,6 @@
6464
</dependency>
6565

6666

67-
<dependency>
68-
<groupId>org.junit.jupiter</groupId>
69-
<artifactId>junit-jupiter</artifactId>
70-
<scope>test</scope>
71-
</dependency>
72-
<dependency>
73-
<groupId>org.junit.jupiter</groupId>
74-
<artifactId>junit-jupiter</artifactId>
75-
<scope>test</scope>
76-
</dependency>
7767
<dependency>
7868
<groupId>org.junit.jupiter</groupId>
7969
<artifactId>junit-jupiter</artifactId>
@@ -82,13 +72,13 @@
8272
<dependency>
8373
<groupId>org.springframework.boot</groupId>
8474
<artifactId>spring-boot-starter-test</artifactId>
75+
<scope>test</scope>
8576
<exclusions>
8677
<exclusion>
8778
<artifactId>spring-boot-starter-logging</artifactId>
8879
<groupId>org.springframework.boot</groupId>
8980
</exclusion>
9081
</exclusions>
91-
<scope>test</scope>
9282
</dependency>
9383
</dependencies>
9484

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<parent>
88
<groupId>software.xdev</groupId>
99
<artifactId>spring-data-eclipse-store-root</artifactId>
10-
<version>1.0.11-SNAPSHOT</version>
10+
<version>2.0.0-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>spring-data-eclipse-store-jpa</artifactId>
14-
<version>1.0.11-SNAPSHOT</version>
14+
<version>2.0.0-SNAPSHOT</version>
1515
<packaging>jar</packaging>
1616

1717
<inceptionYear>2023</inceptionYear>
@@ -30,7 +30,7 @@
3030

3131
<mainClass>software.xdev.spring.data.eclipse.store.demo.complex.ComplexDemoApplication</mainClass>
3232

33-
<org.springframework.boot.version>3.3.1</org.springframework.boot.version>
33+
<org.springframework.boot.version>3.3.2</org.springframework.boot.version>
3434
</properties>
3535

3636
<dependencyManagement>

spring-data-eclipse-store/pom.xml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>software.xdev</groupId>
88
<artifactId>spring-data-eclipse-store</artifactId>
9-
<version>1.0.11-SNAPSHOT</version>
9+
<version>2.0.0-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111

1212
<name>spring-data-eclipse-store</name>
@@ -50,9 +50,9 @@
5050
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
5151

5252
<!-- Should be in sync with org.eclipse.store:integrations-spring-boot3 -->
53-
<org.springframework.boot.version>3.3.1</org.springframework.boot.version>
54-
<org.eclipse.store.version>1.3.2</org.eclipse.store.version>
55-
<org.eclipse.serializer.version>1.3.2</org.eclipse.serializer.version>
53+
<org.springframework.boot.version>3.3.2</org.springframework.boot.version>
54+
<org.eclipse.store.version>1.4.0</org.eclipse.store.version>
55+
<org.eclipse.serializer.version>1.4.0</org.eclipse.serializer.version>
5656
</properties>
5757

5858
<repositories>
@@ -148,6 +148,22 @@
148148
<version>${org.eclipse.serializer.version}</version>
149149
</dependency>
150150

151+
<dependency>
152+
<groupId>software.xdev</groupId>
153+
<artifactId>micro-migration</artifactId>
154+
<version>2.0.0</version>
155+
<exclusions>
156+
<exclusion>
157+
<artifactId>storage-embedded</artifactId>
158+
<groupId>org.eclipse.store</groupId>
159+
</exclusion>
160+
<exclusion>
161+
<artifactId>storage-embedded-configuration</artifactId>
162+
<groupId>org.eclipse.store</groupId>
163+
</exclusion>
164+
</exclusions>
165+
</dependency>
166+
151167
<dependency>
152168
<groupId>org.junit.jupiter</groupId>
153169
<artifactId>junit-jupiter-engine</artifactId>
@@ -197,7 +213,7 @@
197213
<plugin>
198214
<groupId>org.apache.maven.plugins</groupId>
199215
<artifactId>maven-site-plugin</artifactId>
200-
<version>4.0.0-M15</version>
216+
<version>4.0.0-M16</version>
201217
</plugin>
202218
<plugin>
203219
<groupId>org.apache.maven.plugins</groupId>
@@ -251,7 +267,7 @@
251267
<plugin>
252268
<groupId>org.apache.maven.plugins</groupId>
253269
<artifactId>maven-javadoc-plugin</artifactId>
254-
<version>3.7.0</version>
270+
<version>3.8.0</version>
255271
<executions>
256272
<execution>
257273
<id>attach-javadocs</id>

spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/core/EntityListProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
public interface EntityListProvider
1919
{
20-
<T> EntityProvider<T> getEntityProvider(final Class<T> clazz);
20+
<T, ID> EntityProvider<T, ID> getEntityProvider(final Class<T> clazz);
2121

2222
<T> long getEntityCount(final Class<T> clazz);
2323
}

spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/core/EntityProvider.java

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,27 @@
1818
import java.util.ArrayList;
1919
import java.util.Collection;
2020
import java.util.List;
21+
import java.util.Optional;
2122
import java.util.Set;
2223
import java.util.stream.Collectors;
2324
import java.util.stream.Stream;
2425

26+
import software.xdev.spring.data.eclipse.store.repository.root.EntityData;
2527

26-
public class EntityProvider<T>
28+
29+
@SuppressWarnings("java:S119")
30+
public class EntityProvider<T, ID>
2731
{
28-
private final List<IdentitySet<? extends T>> identitySets = new ArrayList<>();
32+
private final List<EntityData<? extends T, ID>> entityDataList = new ArrayList<>();
2933

30-
public void addIdentitySet(final IdentitySet<? extends T> identitySet)
34+
public void addEntityData(final EntityData<? extends T, ID> entityData)
3135
{
32-
this.identitySets.add(identitySet);
36+
this.entityDataList.add(entityData);
3337
}
3438

3539
public Stream<? extends T> stream()
3640
{
37-
return this.identitySets.stream().flatMap(Set::stream);
41+
return this.entityDataList.stream().map(EntityData::getEntities).flatMap(Set::stream);
3842
}
3943

4044
public Collection<T> toCollection()
@@ -51,4 +55,13 @@ public long size()
5155
{
5256
return this.stream().count();
5357
}
58+
59+
public Optional<T> findAnyEntityWithId(final ID id)
60+
{
61+
return (Optional<T>)this.entityDataList
62+
.stream()
63+
.map(entityData -> entityData.getEntitiesById().get(id))
64+
.filter(e -> e != null)
65+
.findAny();
66+
}
5467
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright © 2024 XDEV Software (https://xdev.software)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package software.xdev.spring.data.eclipse.store.exceptions;
17+
18+
public class InvalidRootException extends RuntimeException
19+
{
20+
public InvalidRootException(final String message)
21+
{
22+
super(message);
23+
}
24+
}

spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/importer/EclipseStoreDataImporter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
import software.xdev.spring.data.eclipse.store.repository.SupportedChecker;
3535
import software.xdev.spring.data.eclipse.store.repository.config.EclipseStoreClientConfiguration;
3636
import software.xdev.spring.data.eclipse.store.repository.support.SimpleEclipseStoreRepository;
37-
import software.xdev.spring.data.eclipse.store.repository.support.copier.id.IdManager;
3837
import software.xdev.spring.data.eclipse.store.repository.support.copier.working.RecursiveWorkingCopier;
38+
import software.xdev.spring.data.eclipse.store.repository.support.id.IdManager;
3939
import software.xdev.spring.data.eclipse.store.transactions.EclipseStoreTransactionManager;
4040

4141

0 commit comments

Comments
 (0)