Skip to content

Commit 4121076

Browse files
Merge pull request #75 from xdev-software/develop
v1.0.5
2 parents 18ccbaf + 15bf717 commit 4121076

File tree

56 files changed

+1858
-317
lines changed

Some content is hidden

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

56 files changed

+1858
-317
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ instructions** are in the documentation](https://xdev-software.github.io/spring-
5151
| Spring-Data-Eclipse-Store | Java | Spring Data | EclipseStore |
5252
|---------------------------|--------|-------------|--------------|
5353
| ``<= 1.0.2`` | ``17`` | ``3.2.2`` | ``1.1.0`` |
54-
| ``>= 1.0.3`` | ``17`` | ``3.2.3`` | ``1.2.0`` |
54+
| ``1.0.3/1.0.4`` | ``17`` | ``3.2.3`` | ``1.2.0`` |
55+
| ``>= 1.0.5`` | ``17`` | ``3.2.5`` | ``1.3.2`` |
5556

5657
## Demo
5758

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.3'
4+
display_version: '1.0.5'
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.3'
12-
maven-version: '1.0.3'
11+
display-version: '1.0.5'
12+
maven-version: '1.0.5'
1313
page-editable: false
1414
page-out-of-support: false

docs/modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
* xref:configuration.adoc[Configuration]
44
* xref:working-copies.adoc[Working Copies]
55
* xref:lazies.adoc[Lazy References]
6+
* xref:transactions.adoc[Transactions]
67
* xref:migration.adoc[Migration]
78
* xref:known-issues.adoc[Known issues]

docs/modules/ROOT/pages/configuration.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import org.eclipse.store.storage.embedded.types.EmbeddedStorageFoundation;
1515
import org.eclipse.store.storage.types.Storage;
1616
...
1717
@Configuration
18-
@EnableEclipseStoreRepositories(clientConfigurationClass = DemoConfiguration.class)
18+
@EnableEclipseStoreRepositories
1919
public class DemoConfiguration extends EclipseStoreClientConfiguration
2020
{
2121
@Override

docs/modules/ROOT/pages/installation.adoc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ Also see the https://github.com/xdev-software/spring-data-eclipse-store/releases
2323

2424
After adding the library in your dependencies, using it is as easy as adding the ``@EnableEclipseStoreRepositories`` annotation to your ``@SpringBootApplication`` annotation.
2525

26-
[NOTE]
27-
====
28-
Since the library is using reflection to copy data, the following JVM-Arguments may have to be set.
26+
=== Merge behavior
27+
28+
To merge data of the xref:working-copies.adoc[working copy] into the original object graph, the library is using reflection.
29+
Therefore, the following *JVM-Arguments* may have to be set:
2930

3031
[source,title="JVM Arguments"]
3132
----
@@ -34,6 +35,11 @@ Since the library is using reflection to copy data, the following JVM-Arguments
3435
--add-opens=java.base/java.lang=ALL-UNNAMED
3536
--add-opens=java.base/java.time=ALL-UNNAMED
3637
----
38+
39+
[NOTE]
40+
====
41+
To access ``private`` variables, the library uses reflection and sets the access level to ``public`` (see https://github.com/xdev-software/spring-data-eclipse-store/blob/develop/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/access/modifier/FieldAccessibleMaker.java[FieldAccessibleMaker]).
42+
For performance reasons, *this change stays permanent* during runtime.
3743
====
3844

3945
== Demo

docs/modules/ROOT/pages/lazies.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class Owner extends Person
3131
//...
3232
----
3333

34-
== Internas
34+
== Internals
3535

3636
SpringDataEclipseStoreLazies work as a proxy for the EclipseStore-Lazies.
3737
As far as EclipseStore is concerned, a SpringDataEclipseStoreLazy-Object is a normal Java object that contains a Lazy-Reference.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
= Transactions
2+
3+
[quote,https://docs.spring.io/spring-framework/reference/data-access/transaction.html[spring - Transaction Management]]
4+
5+
____
6+
Comprehensive transaction support is among the *most compelling reasons* to use the Spring Framework.
7+
____
8+
9+
That's why we implemented *Spring Transactions*.
10+
11+
Just like Spring JPA you can use https://docs.spring.io/spring-framework/reference/data-access/transaction/declarative.html[declarative] or https://docs.spring.io/spring-framework/reference/data-access/transaction/programmatic.html[programmatic] transaction management.
12+
13+
[source,java,title="https://github.com/xdev-software/spring-data-eclipse-store/blob/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/VetService.java[Declarative example from complex demo]"]
14+
----
15+
import org.springframework.stereotype.Service;
16+
import org.springframework.transaction.annotation.Transactional;
17+
//...
18+
@Service
19+
@Transactional
20+
public class VetService
21+
{
22+
//...
23+
public void saveNewEntries()
24+
{
25+
final Vet vet = this.createVet();
26+
this.vetRepository.save(vet);
27+
}
28+
//...
29+
----
30+
31+
[source,java,title="https://github.com/xdev-software/spring-data-eclipse-store/blob/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/OwnerService.java[Programmatic example from complex demo]"]
32+
----
33+
import org.springframework.stereotype.Service;
34+
import org.springframework.transaction.PlatformTransactionManager;
35+
//...
36+
@Service
37+
public class OwnerService
38+
{
39+
private final PlatformTransactionManager transactionManager;
40+
41+
@Autowired
42+
public OwnerService(
43+
final OwnerRepository ownerRepository,
44+
final PlatformTransactionManager transactionManager)
45+
{
46+
this.ownerRepository = ownerRepository;
47+
this.transactionManager = transactionManager;
48+
}
49+
//...
50+
public void deleteAll()
51+
{
52+
new TransactionTemplate(this.transactionManager).execute(
53+
status ->
54+
{
55+
this.ownerRepository.deleteAll();
56+
return null;
57+
});
58+
}
59+
//...
60+
----
61+
62+
CAUTION: If you are using transaction, you need to define a ``Bean`` for ``PlatformTransactionManager``! This is easiest achieved by extending the ``EclipseStoreClientConfiguration``. See https://github.com/xdev-software/spring-data-eclipse-store/blob/develop/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/ComplexConfiguration.java[the complex demo].

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2121
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
2222

23-
<org.springframework.boot.version>3.2.3</org.springframework.boot.version>
23+
<org.springframework.boot.version>3.2.5</org.springframework.boot.version>
2424
<jmh.version>1.37</jmh.version>
2525
</properties>
2626

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

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

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

26-
<org.springframework.boot.version>3.2.3</org.springframework.boot.version>
26+
<org.springframework.boot.version>3.2.5</org.springframework.boot.version>
2727
</properties>
2828

2929
<dependencyManagement>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package software.xdev.spring.data.eclipse.store.demo.complex;
2+
3+
import org.eclipse.store.integrations.spring.boot.types.configuration.EclipseStoreProperties;
4+
import org.eclipse.store.integrations.spring.boot.types.factories.EmbeddedStorageFoundationFactory;
5+
import org.springframework.beans.factory.ObjectProvider;
6+
import org.springframework.beans.factory.annotation.Autowired;
7+
import org.springframework.boot.autoconfigure.transaction.TransactionManagerCustomizers;
8+
import org.springframework.context.annotation.Bean;
9+
import org.springframework.context.annotation.Configuration;
10+
import org.springframework.transaction.PlatformTransactionManager;
11+
12+
import software.xdev.spring.data.eclipse.store.repository.config.EclipseStoreClientConfiguration;
13+
import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
14+
15+
16+
@Configuration
17+
@EnableEclipseStoreRepositories
18+
public class ComplexConfiguration extends EclipseStoreClientConfiguration
19+
{
20+
@Autowired
21+
public ComplexConfiguration(
22+
final EclipseStoreProperties defaultEclipseStoreProperties,
23+
final EmbeddedStorageFoundationFactory defaultEclipseStoreProvider
24+
)
25+
{
26+
super(defaultEclipseStoreProperties, defaultEclipseStoreProvider);
27+
}
28+
29+
/**
30+
* Overriding {@link #transactionManager(ObjectProvider)} only to add the {@link Bean}-Annotation.
31+
*/
32+
@Bean
33+
@Override
34+
public PlatformTransactionManager transactionManager(
35+
final ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers
36+
)
37+
{
38+
return super.transactionManager(transactionManagerCustomizers);
39+
}
40+
}

0 commit comments

Comments
 (0)