-
Notifications
You must be signed in to change notification settings - Fork 1
Lazy #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Lazy #65
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
8966519
Created test environment for lazy
JohannesRabauer f202ee2
Implemented Proxy creator for Lazies
JohannesRabauer 35beb29
Lazy storing working for simplest test
JohannesRabauer cb29ea5
Merge branch 'develop' into lazy
JohannesRabauer a8f408f
Simple Lazy working
JohannesRabauer 93f5e03
Cleanup Lazy
JohannesRabauer 2e1b839
Added Copyrights
JohannesRabauer d7a1a0e
Simple Lazy working quite well. More complex lazies are not implement…
JohannesRabauer 7289cf7
Merge branch 'develop' into lazy
JohannesRabauer 6e1c20a
Fixed lazy tests
JohannesRabauer 10f29b8
Added tests for lazy handling
JohannesRabauer 6b8f038
Most tests for lazy working
JohannesRabauer 5335fac
Lazy working with tests
JohannesRabauer 6f9f53c
Added docs and demos for lazy
JohannesRabauer 7a6eec2
Fix some checkstyle warnings
JohannesRabauer e8cbefb
Refactoring
JohannesRabauer 58c8fde
Update SpringDataEclipseStoreLazyBinaryHandler.java
JohannesRabauer 01f45da
Added deletion test
JohannesRabauer 7dcd74f
Update DeletionTest.java
JohannesRabauer 5786404
Added more deletion tests
JohannesRabauer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
= Lazy References | ||
|
||
Lazy Loading is an essential part of EclipseStore. | ||
The basic mechanism is best explained in the https://docs.eclipsestore.io/manual/storage/loading-data/lazy-loading/index.html[EclipseStore-Docs]. + | ||
In essence java objects which are wrapped in a *Lazy-Reference are not loaded with the startup of the EclipseStore-Storage but only if ``get()`` is called* on them. | ||
|
||
Lazy References are essential for big data sets that can't get loaded into memory. | ||
Since {product-name} operates with xref:working-copies.adoc[working copies] using the EclipseStore-Lazy-References is not possible. + | ||
If you are using the EclipseStore-Lazy-References, all references would be resolved and loaded into memory as soon as a working copy is created, because the ``get()``-Method is called to create a full working copy. | ||
|
||
That's why we implemented ``SpringDataEclipseStoreLazy``. + | ||
The usage is the same as with the EclipseStore-Lazies, but they are handled very differently. | ||
|
||
Simply wrap any kind of java object in the SpringDataEclipseStoreLazy-Wrapper and the wrapped object has a lazy loading behaviour. | ||
|
||
CAUTION: Lazy-References are not only loaded when needed, but also https://docs.eclipsestore.io/manual/storage/loading-data/lazy-loading/clearing-lazy-references.html#automatically[*cleared when they are no longer needed*]! | ||
|
||
Example: ``SpringDataEclipseStoreLazy.build(new HashMap<String, Pet>())`` | ||
|
||
[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/complex/owner/Owner.java[Example from complex demo]"] | ||
---- | ||
package software.xdev.spring.data.eclipse.store.demo.complex.owner; | ||
//... | ||
import software.xdev.spring.data.eclipse.store.repository.lazy.SpringDataEclipseStoreLazy; | ||
|
||
public class Owner extends Person | ||
{ | ||
private String address; | ||
|
||
private Lazy<List<Pet>> pets = SpringDataEclipseStoreLazy.build(new ArrayList<>()); | ||
//... | ||
---- | ||
|
||
== Internas | ||
|
||
SpringDataEclipseStoreLazies work as a proxy for the EclipseStore-Lazies. | ||
As far as EclipseStore is concerned, a SpringDataEclipseStoreLazy-Object is a normal Java object that contains a Lazy-Reference. | ||
|
||
But when {product-name} creates the working copy, *the SpringDataEclipseStoreLazy-Reference is not resolved* but instead only a reference to the original Lazy-Object in EclipseStore is loaded. | ||
As soon as ``get()`` is called on the SpringDataEclipseStoreLazy, a *new working copy of the lazy object* is created. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e/src/main/java/software/xdev/spring/data/eclipse/store/aot/EclipseStoreRuntimeHints.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/core/IdentitySet.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...n/java/software/xdev/spring/data/eclipse/store/exceptions/AlreadyRegisteredException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ava/software/xdev/spring/data/eclipse/store/exceptions/DataTypeNotSupportedException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...in/java/software/xdev/spring/data/eclipse/store/exceptions/DifferentClassesException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...va/software/xdev/spring/data/eclipse/store/exceptions/FieldAccessReflectionException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...c/main/java/software/xdev/spring/data/eclipse/store/exceptions/IdFieldFinalException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../software/xdev/spring/data/eclipse/store/exceptions/IdGeneratorNotSupportedException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...n/java/software/xdev/spring/data/eclipse/store/exceptions/LazyNotUnlinkableException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright © 2024 XDEV Software (https://xdev.software) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package software.xdev.spring.data.eclipse.store.exceptions; | ||
|
||
/** | ||
* Is used when a {@link software.xdev.spring.data.eclipse.store.repository.lazy.SpringDataEclipseStoreLazy} is not able | ||
* to get unlinked from the object tree. | ||
* <p> | ||
* This exception should not be created by the user, but only within the Spring-Data-Eclipse-Store-Library. | ||
* </p> | ||
*/ | ||
public class LazyNotUnlinkableException extends RuntimeException | ||
JohannesRabauer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
public LazyNotUnlinkableException(final String message, final Throwable e) | ||
{ | ||
super(message, e); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...rc/main/java/software/xdev/spring/data/eclipse/store/exceptions/MergeFailedException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...main/java/software/xdev/spring/data/eclipse/store/exceptions/NoIdFieldFoundException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...va/software/xdev/spring/data/eclipse/store/exceptions/NoPageableObjectFoundException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../main/java/software/xdev/spring/data/eclipse/store/exceptions/NotComparableException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rc/main/java/software/xdev/spring/data/eclipse/store/exceptions/StringBlankException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../src/main/java/software/xdev/spring/data/eclipse/store/repository/EntityListProvider.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../src/main/java/software/xdev/spring/data/eclipse/store/repository/EntitySetCollector.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...re/src/main/java/software/xdev/spring/data/eclipse/store/repository/IdSetterProvider.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../src/main/java/software/xdev/spring/data/eclipse/store/repository/PersistableChecker.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/Query.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.