Skip to content

Commit 12d7b76

Browse files
First version of describing multiple repositories
1 parent 4422c07 commit 12d7b76

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed

assets/DependingClasses.drawio

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" version="25.0.3">
2+
<diagram name="Page-1" id="6GyipOatxIIVSVKHxFAy">
3+
<mxGraphModel dx="1562" dy="845" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
4+
<root>
5+
<mxCell id="0" />
6+
<mxCell id="1" parent="0" />
7+
<mxCell id="hvzIIKVZ51MqT405g5E5-15" value="" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=none;" vertex="1" parent="1">
8+
<mxGeometry x="150" y="120" width="430" height="250" as="geometry" />
9+
</mxCell>
10+
<mxCell id="hvzIIKVZ51MqT405g5E5-5" value="" style="group" vertex="1" connectable="0" parent="1">
11+
<mxGeometry x="440" y="140" width="100" height="100" as="geometry" />
12+
</mxCell>
13+
<mxCell id="hvzIIKVZ51MqT405g5E5-3" value="" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=none;strokeColor=#D62125;strokeWidth=3;align=center;verticalAlign=middle;fontFamily=Helvetica;fontSize=12;fontColor=default;" vertex="1" parent="hvzIIKVZ51MqT405g5E5-5">
14+
<mxGeometry x="20" y="20" width="60" height="80" as="geometry" />
15+
</mxCell>
16+
<mxCell id="hvzIIKVZ51MqT405g5E5-4" value="&lt;span style=&quot;font-weight: 400; text-wrap-mode: wrap;&quot;&gt;ArticleRepository&lt;/span&gt;" style="text;strokeColor=none;fillColor=none;html=1;fontSize=15;fontStyle=1;verticalAlign=middle;align=center;" vertex="1" parent="hvzIIKVZ51MqT405g5E5-5">
17+
<mxGeometry y="-10" width="100" height="20" as="geometry" />
18+
</mxCell>
19+
<mxCell id="hvzIIKVZ51MqT405g5E5-6" value="" style="group" vertex="1" connectable="0" parent="1">
20+
<mxGeometry x="190" y="140" width="100" height="100" as="geometry" />
21+
</mxCell>
22+
<mxCell id="hvzIIKVZ51MqT405g5E5-1" value="" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fillColor=none;strokeColor=#D62125;strokeWidth=3;" vertex="1" parent="hvzIIKVZ51MqT405g5E5-6">
23+
<mxGeometry x="20" y="20" width="60" height="80" as="geometry" />
24+
</mxCell>
25+
<mxCell id="hvzIIKVZ51MqT405g5E5-2" value="&lt;span style=&quot;font-weight: 400; text-wrap-mode: wrap;&quot;&gt;OrderRepository&lt;/span&gt;" style="text;strokeColor=none;fillColor=none;html=1;fontSize=15;fontStyle=1;verticalAlign=middle;align=center;" vertex="1" parent="hvzIIKVZ51MqT405g5E5-6">
26+
<mxGeometry y="-10" width="100" height="20" as="geometry" />
27+
</mxCell>
28+
<mxCell id="hvzIIKVZ51MqT405g5E5-7" value="&lt;font&gt;Order&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fontSize=15;fillColor=none;strokeColor=#D62125;strokeWidth=3;align=center;verticalAlign=middle;fontFamily=Helvetica;fontColor=default;" vertex="1" parent="1">
29+
<mxGeometry x="180" y="290" width="120" height="60" as="geometry" />
30+
</mxCell>
31+
<mxCell id="hvzIIKVZ51MqT405g5E5-8" value="&lt;font&gt;Article&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fontSize=15;fillColor=none;strokeColor=#D62125;strokeWidth=3;align=center;verticalAlign=middle;fontFamily=Helvetica;fontColor=default;" vertex="1" parent="1">
32+
<mxGeometry x="430" y="290" width="120" height="60" as="geometry" />
33+
</mxCell>
34+
<mxCell id="hvzIIKVZ51MqT405g5E5-16" value="" style="shape=flexArrow;endArrow=classic;startArrow=none;html=1;rounded=0;strokeColor=#C91F24;strokeWidth=2;fillColor=default;startFill=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="hvzIIKVZ51MqT405g5E5-7" target="hvzIIKVZ51MqT405g5E5-8">
35+
<mxGeometry width="100" height="100" relative="1" as="geometry">
36+
<mxPoint x="320" y="470" as="sourcePoint" />
37+
<mxPoint x="480" y="470" as="targetPoint" />
38+
</mxGeometry>
39+
</mxCell>
40+
<mxCell id="hvzIIKVZ51MqT405g5E5-20" value="&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 15px; font-weight: 700;&quot;&gt;@OneToMany&lt;/span&gt;" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="hvzIIKVZ51MqT405g5E5-16">
41+
<mxGeometry x="0.21" relative="1" as="geometry">
42+
<mxPoint x="-17" y="-30" as="offset" />
43+
</mxGeometry>
44+
</mxCell>
45+
</root>
46+
</mxGraphModel>
47+
</diagram>
48+
</mxfile>
Lines changed: 1 addition & 0 deletions
Loading

docs/modules/ROOT/pages/known-issues.adoc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,27 @@ This **should** handle most problems with the ClassLoader.
2929
Restarting the storage leads to a reloading of all entities and may take some time, yet circumvents the Restart ClassLoader Issue.
3030

3131
The behavior can be configured through xref:configuration.adoc#context-close-shutdown-storage[Properties] and is implemented in the https://github.com/xdev-software/spring-data-eclipse-store/tree/develop/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreClientConfiguration.java[EclipseStoreClientConfiguration.java].
32+
33+
== Multiple Repositories with related entities [[multi-repos-with-related-entities]]
34+
35+
Users of SQL-Databases usually have a different understanding regarding relations between entities.
36+
They are handled and checked by the database.
37+
38+
In the Java object graph we only have the relations defined by the user.
39+
This means that if a contained object has no variable that points to the containing object, it does not know anything about it, and we can only find this relation by searching through the whole object graph.
40+
41+
An example: If an order instance contains several references to articles, there is almost no way to find the containing order of an article.
42+
Of course, we could search the whole object tree and then finally find the parent, but that would not be effective at all.
43+
44+
image::DependingClasses.svg[Example structure with orders and articles]
45+
46+
Now what if we deleted a referenced article from the article repository?
47+
48+
-> in a sql database we would expect an exception to arise, because we shouldn't remove a referenced article.
49+
50+
-> but in Spring-Data-Eclipse-Store we can easily remove this article, because the system doesn't know about any references to it.
51+
This results in the article getting removed, but the article actually still exists in the order.
52+
Furthermore, if we store the order again, the article will be existing in the article repository once more.
53+
54+
This is simply a very different behaviour from SQL databases and must be acknowledged.
55+

0 commit comments

Comments
 (0)