You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/installation.adoc
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,9 +23,10 @@ Also see the https://github.com/xdev-software/spring-data-eclipse-store/releases
23
23
24
24
After adding the library in your dependencies, using it is as easy as adding the ``@EnableEclipseStoreRepositories`` annotation to your ``@SpringBootApplication`` annotation.
25
25
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:
29
30
30
31
[source,title="JVM Arguments"]
31
32
----
@@ -34,6 +35,11 @@ Since the library is using reflection to copy data, the following JVM-Arguments
34
35
--add-opens=java.base/java.lang=ALL-UNNAMED
35
36
--add-opens=java.base/java.time=ALL-UNNAMED
36
37
----
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.
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]"]
[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]"]
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].
Copy file name to clipboardExpand all lines: spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/ComplexDemoApplication.java
0 commit comments