Skip to content

Commit

Permalink
Merge pull request #201 from xdev-software/develop
Browse files Browse the repository at this point in the history
v2.4.0
  • Loading branch information
JohannesRabauer authored Dec 9, 2024
2 parents 0d62855 + 30256d8 commit 2c02188
Show file tree
Hide file tree
Showing 114 changed files with 2,649 additions and 265 deletions.
7 changes: 7 additions & 0 deletions .config/pmd/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,12 @@
<exclude name="UseStringBufferForStringAppends"/>
</rule>

<rule ref="category/java/performance.xml/TooFewBranchesForSwitch">
<properties>
<!-- If you have one case only please use a if -->
<property name="minimumNumberCaseForASwitch" value="2"/>
</properties>
</rule>

<rule ref="category/java/security.xml"/>
</ruleset>
3 changes: 3 additions & 0 deletions .github/workflows/broken-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ permissions:
jobs:
link-checker:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4

Expand All @@ -19,6 +20,8 @@ jobs:
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2
with:
fail: false # Don't fail on broken links, create an issue instead

- name: Find already existing issue
id: find-issue
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ env:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30

strategy:
matrix:
Expand Down Expand Up @@ -73,6 +74,7 @@ jobs:
checkstyle:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
timeout-minutes: 15

strategy:
matrix:
Expand All @@ -95,6 +97,7 @@ jobs:
pmd:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
timeout-minutes: 15

strategy:
matrix:
Expand All @@ -114,9 +117,6 @@ jobs:
- name: Run PMD
run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C

- name: Run CPD (Copy Paste Detector)
run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C

- name: Upload report
if: always()
uses: actions/upload-artifact@v4
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ permissions:
jobs:
check-code:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -48,6 +49,7 @@ jobs:
prepare-release:
runs-on: ubuntu-latest
needs: [check-code]
timeout-minutes: 10
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
Expand Down Expand Up @@ -109,6 +111,7 @@ jobs:
publish-maven:
runs-on: ubuntu-latest
needs: [prepare-release]
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -140,6 +143,7 @@ jobs:
publish-pages:
runs-on: ubuntu-latest
needs: [prepare-release]
timeout-minutes: 15
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -169,6 +173,7 @@ jobs:
after-release:
runs-on: ubuntu-latest
needs: [publish-maven]
timeout-minutes: 10
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
token-check:
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) }}
timeout-minutes: 5
outputs:
hasToken: ${{ steps.check-token.outputs.has }}
steps:
Expand All @@ -40,6 +41,7 @@ jobs:
runs-on: ubuntu-latest
needs: token-check
if: ${{ needs.token-check.outputs.hasToken }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ permissions:
jobs:
labels:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:
jobs:
publish-maven:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/update-from-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ permissions:
jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 60
outputs:
update_branch_merged_commit: ${{ steps.manage-branches.outputs.update_branch_merged_commit }}
create_update_branch_merged_pr: ${{ steps.manage-branches.outputs.create_update_branch_merged_pr }}
Expand Down Expand Up @@ -180,6 +181,7 @@ jobs:
needs: [update]
if: needs.update.outputs.create_update_branch_merged_pr == 1
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ spring-data-eclipse-store-demo/storage
spring-data-eclipse-store-demo/storage-person
spring-data-eclipse-store-demo/storage-invoice
spring-data-eclipse-store-demo/storage-complex
spring-data-eclipse-store-demo/storage-lazy
spring-data-eclipse-store-jpa/storage-eclipsestore
spring-data-eclipse-store-jpa/storage-h2.mv.db
spring-data-eclipse-store-jpa/storage-h2.trace.db
Expand Down
2 changes: 1 addition & 1 deletion .idea/checkstyle-idea.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2.4.0

* Updated org.springframework.boot.version to v3.4.0
* Updated EclipseStore to v2.0.0
* Implemented Lazy Repositories with ``LazyEclipseStoreRepository``

# 2.3.1

* Auto-Fix problems with adding ids to entities with existing data store.
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ instructions** are in the documentation](https://xdev-software.github.io/spring-
| ``1.0.5-1.0.7`` | ``17`` | ``3.2.5`` | ``1.3.2`` |
| ``1.0.8-1.0.10`` | ``17`` | ``3.3.1`` | ``1.3.2`` |
| ``2.0.0-2.1.0`` | ``17`` | ``3.3.2`` | ``1.4.0`` |
| ``>= 2.2.0`` | ``17`` | ``3.3.4`` | ``1.4.0`` |
| ``2.2.0-2.3.1`` | ``17`` | ``3.3.4`` | ``1.4.0`` |
| ``>= 2.4.0`` | ``17`` | ``3.4.0`` | ``2.0.0`` |

## Demo

Expand All @@ -65,6 +66,7 @@ the [demos](./spring-data-eclipse-store-demo):

* [Simple demo](https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/simple)
* [Complex demo](https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex)
* [Lazy demo](https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/lazy)
* [Demo with coexisting JPA](https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-jpa/src/main/java/software/xdev/spring/data/eclipse/store/jpa)
* [Dual storage demo](https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/dual/storage)

Expand Down
6 changes: 3 additions & 3 deletions docs/antora.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: ROOT
title: Spring-Data-Eclipse-Store
version: master
display_version: '2.3.1'
display_version: '2.4.0'
start_page: index.adoc
nav:
- modules/ROOT/nav.adoc
asciidoc:
attributes:
product-name: 'Spring-Data-Eclipse-Store'
display-version: '2.3.1'
maven-version: '2.3.1'
display-version: '2.4.0'
maven-version: '2.4.0'
page-editable: false
page-out-of-support: false
30 changes: 29 additions & 1 deletion docs/modules/ROOT/pages/features/lazies.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,38 @@ public class Owner extends Person
{
private String address;
private Lazy<List<Pet>> pets = SpringDataEclipseStoreLazy.build(new ArrayList<>());
private final Lazy<List<Pet>> pets = SpringDataEclipseStoreLazy.build(new ArrayList<>());
//...
----

== Repositories

Entities in a repository are by default **not lazy**.
But we made it as easy as possible for you to make these entities lazy: Instead of extending the ``EclipseStoreRepository`` (or any similar class from the ``software.xdev.spring.data.eclipse.store.repository.interfaces``-Package), you simply extend the ``LazyEclipseStoreRepository``.

=== https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/lazy/CustomerRepository.java[Example from lazy demo]

[source,java,title="https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/simple/CustomerRepository.java[Before (not lazy)]"]
----
public interface CustomerRepository extends CrudRepository<Customer, String>
{
}
----

[source,java,title="https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/lazy/CustomerRepository.java[After (lazy)]"]
----
public interface CustomerRepository extends LazyEclipseStoreCrudRepository<Customer, String>
{
}
----

Every instance of the ``Customer``-Entities are now wrapped in a https://docs.eclipsestore.io/manual/storage/loading-data/lazy-loading/index.html[``Lazy``-Reference].
That means that these objects are **only loaded from the storage, if they are needed** e.g. when ``findAll`` is called.

The method **``findById`` only loads the entities with the corresponding IDs**, because a separate list with all ids is stored.
But if any method like **``findByName`` or ``findByChild`` is used, all objects are loaded** from the storage.
This is currently the only way to get the actual values of the entities.

== Internals

SpringDataEclipseStoreLazies work as a proxy for the EclipseStore-Lazies.
Expand Down
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"@antora/lunr-extension": "^1.0.0-alpha.8"
},
"devDependencies": {
"@antora/cli": "3.1.9",
"@antora/site-generator": "3.1.9"
"@antora/cli": "3.1.10",
"@antora/site-generator": "3.1.10"
}
}
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>software.xdev</groupId>
<artifactId>spring-data-eclipse-store-root</artifactId>
<version>2.3.2-SNAPSHOT</version>
<version>2.4.0-SNAPSHOT</version>
<packaging>pom</packaging>

<organization>
Expand Down Expand Up @@ -45,12 +45,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.5.0</version>
<version>3.6.0</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.18.2</version>
<version>10.20.2</version>
</dependency>
</dependencies>
<configuration>
Expand All @@ -75,7 +75,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.25.0</version>
<version>3.26.0</version>
<configuration>
<includeTests>true</includeTests>
<printFailingErrors>true</printFailingErrors>
Expand All @@ -93,12 +93,12 @@
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>7.6.0</version>
<version>7.8.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.6.0</version>
<version>7.8.0</version>
</dependency>
</dependencies>
</plugin>
Expand All @@ -110,7 +110,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>3.5.0</version>
<version>3.6.0</version>
</plugin>
</plugins>
</reporting>
Expand Down
6 changes: 3 additions & 3 deletions spring-data-eclipse-store-benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>software.xdev</groupId>
<artifactId>spring-data-eclipse-store-root</artifactId>
<version>2.3.2-SNAPSHOT</version>
<version>2.4.0-SNAPSHOT</version>
</parent>

<artifactId>spring-data-eclipse-store-benchmark</artifactId>
<version>2.3.2-SNAPSHOT</version>
<version>2.4.0-SNAPSHOT</version>
<packaging>jar</packaging>

<inceptionYear>2023</inceptionYear>
Expand All @@ -25,7 +25,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<org.springframework.boot.version>3.3.4</org.springframework.boot.version>
<org.springframework.boot.version>3.4.0</org.springframework.boot.version>
<jmh.version>1.37</jmh.version>
</properties>

Expand Down
8 changes: 4 additions & 4 deletions spring-data-eclipse-store-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>software.xdev</groupId>
<artifactId>spring-data-eclipse-store-root</artifactId>
<version>2.3.2-SNAPSHOT</version>
<version>2.4.0-SNAPSHOT</version>
</parent>

<artifactId>spring-data-eclipse-store-demo</artifactId>
<version>2.3.2-SNAPSHOT</version>
<version>2.4.0-SNAPSHOT</version>
<packaging>jar</packaging>

<organization>
Expand All @@ -28,7 +28,7 @@

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

<org.springframework.boot.version>3.3.4</org.springframework.boot.version>
<org.springframework.boot.version>3.4.0</org.springframework.boot.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -113,7 +113,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.0</version>
<version>3.5.2</version>
<configuration>
<argLine>
--add-opens java.base/java.util=ALL-UNNAMED
Expand Down
Loading

0 comments on commit 2c02188

Please sign in to comment.