Skip to content

Commit ce893a5

Browse files
Added more docs
1 parent 9231ff8 commit ce893a5

File tree

3 files changed

+50
-9
lines changed

3 files changed

+50
-9
lines changed
Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
11
= Known issues
22

3+
== Lazy references
34

4-
//TODO
5+
One of the core features of EclipseStore is its https://docs.eclipsestore.io/manual/storage/loading-data/lazy-loading/index.html[Lazy references].
6+
Unfortunately this requires our library to implement some kind of proxy.
7+
That's something that takes a lot of effort to implement in our {product-name}.
8+
9+
We created https://github.com/xdev-software/spring-data-eclipse-store/issues/31[an issue] for that but right now we *do not support Lazy references*.
10+
11+
== Query annotations
12+
13+
In Spring-Data-JPA you can write a Query over methods of repositories like this:
14+
15+
[source,java,title="From https://github.com/spring-projects/spring-petclinic/blob/main/src/main/java/org/springframework/samples/petclinic/owner/OwnerRepository.java[spring-petclinic]"]
16+
----
17+
@Query("SELECT ptype FROM PetType ptype ORDER BY ptype.name")
18+
List<PetType> findPetTypes();
19+
----
20+
21+
We created https://github.com/xdev-software/spring-data-eclipse-store/issues/32[an issue] for that but right now we *do not support Query annotations*.
22+
23+
== Data changes
24+
25+
There are two basic ways to keep your data up to date.
26+
27+
=== Structural
28+
29+
As with most projects, data that needs persisting changes over time.
30+
In EclipseStore that's handled through https://docs.eclipsestore.io/manual/storage/legacy-type-mapping/index.html[Legacy Type Mapping].
31+
32+
That consists of https://docs.eclipsestore.io/manual/storage/legacy-type-mapping/index.html#_automatic_mapping[Automatic Mapping] through EclipseStores internal heuristic and https://docs.eclipsestore.io/manual/storage/legacy-type-mapping/index.html#explicit-mapping[Explicit Mapping] by the user.
33+
34+
=== Values
35+
36+
There is a library to version your data in the store called https://github.com/xdev-software/micro-migration[XDEV MicroMigration].
37+
This helps you keep your data up to date regardless of the current version.
38+
39+
We created https://github.com/xdev-software/spring-data-eclipse-store/issues/33[an issue] for that but right now we *do not support XDEVs MicroMigration*.

docs/modules/ROOT/pages/migration.adoc

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,26 @@ mvn org.openrewrite.maven:rewrite-maven-plugin:run \
1111
-Drewrite.activeRecipes=software.xdev.spring.data.eclipse.store.JpaMigration
1212
----
1313

14+
[CAUTION]
15+
====
16+
Since {product-name} can't handle ``@Query``-Annotations, these annotations are getting removed by the Rewrite-Recipe.
17+
====
18+
1419
== Data
1520

1621
To import data from different data sources like JPA, you can simply let the ``EclipseStoreDataImporterComponent`` get injected and then call ``importData()``.
1722
This reads all instances of ``EntityManagerFactory``, creates EclipseStoreRepositories for it and then imports that data.
1823
This can take quite some time if you have a lot of data.
1924

20-
[source,java,title="Maven"]
25+
[source,java]
2126
----
22-
@Autowired
23-
private EclipseStoreDataImporterComponent eclipseStoreDataImporter;
27+
@Autowired
28+
private EclipseStoreDataImporterComponent eclipseStoreDataImporter;
2429
25-
void importDataFromJpaToEclipseStore()
26-
{
27-
final List<SimpleEclipseStoreRepository<?, ?>> repositories = this.eclipseStoreDataImporter.importData();
28-
}
30+
void importDataFromJpaToEclipseStore()
31+
{
32+
final List<SimpleEclipseStoreRepository<?, ?>> repositories = this.eclipseStoreDataImporter.importData();
33+
}
2934
----
3035

3136
After that you can change your JpaRepositories to EclipseStoreRepositories and you're done.

docs/modules/ROOT/pages/working-copies.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ image::../images/WorkingCopy_1.svg[Native behavior of EclipseStore]
77
If you e.g. change the address of a person, the changed address is already in your data model, *even before storing* this person.
88
This is very different from the behavior a Spring user expects.
99

10+
image::../images/WorkingCopy_2.svg[Behavior of EclipseStore with Spring-Data-Eclipse-Store]
11+
1012
With {product-name} every time an object is loaded from the datastore, a working copy of that object (or rather the object tree) is created and returned to the user.
1113
Therefore, the user can make the changes on the working copy without any changes to the actual data model.
1214
The changes are only persisted after calling ``save`` on a repository.
1315

14-
image::../images/WorkingCopy_2.svg[Behavior of EclipseStore with Spring-Data-Eclipse-Store]

0 commit comments

Comments
 (0)