diff --git a/CHANGELOG.md b/CHANGELOG.md index 96797abe..5a255ec2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # 1.0.4 * Added possibility to use multiple storages +* Added Lazy support +* Updated EclipseStore to version 1.3.1 # 1.0.3 diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 86dc85bc..20b43255 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -2,5 +2,6 @@ * xref:installation.adoc[Installation] * xref:configuration.adoc[Configuration] * xref:working-copies.adoc[Working Copies] +* xref:lazies.adoc[Lazy References] * xref:migration.adoc[Migration] * xref:known-issues.adoc[Known issues] diff --git a/docs/modules/ROOT/pages/known-issues.adoc b/docs/modules/ROOT/pages/known-issues.adoc index 54706e47..6c1c9489 100644 --- a/docs/modules/ROOT/pages/known-issues.adoc +++ b/docs/modules/ROOT/pages/known-issues.adoc @@ -1,13 +1,5 @@ = Known issues -== Lazy references - -One of the core features of EclipseStore is its https://docs.eclipsestore.io/manual/storage/loading-data/lazy-loading/index.html[Lazy references]. -Unfortunately this requires our library to implement some kind of proxy. -That's something that takes a lot of effort to implement in our {product-name}. - -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*. - == Query annotations In Spring-Data-JPA you can write a Query over methods of repositories like this: diff --git a/docs/modules/ROOT/pages/lazies.adoc b/docs/modules/ROOT/pages/lazies.adoc new file mode 100644 index 00000000..55f93cbc --- /dev/null +++ b/docs/modules/ROOT/pages/lazies.adoc @@ -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())`` + +[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> 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. diff --git a/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/ComplexDemoApplication.java b/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/ComplexDemoApplication.java index c7e2c7dd..33758888 100644 --- a/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/ComplexDemoApplication.java +++ b/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/ComplexDemoApplication.java @@ -103,6 +103,17 @@ public void run(final String... args) ); } ); + + LOG.info("----Owner-Lazy Pet loading----"); + this.ownerRepository.findAll().forEach( + o -> o.getPets().forEach( + pet -> LOG.info(String.format( + "Pet %s has owner %s %s", + pet.getName(), + o.getFirstName(), + o.getLastName())) + ) + ); } private static Visit createVisit() diff --git a/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/owner/Owner.java b/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/owner/Owner.java index 1cf16094..e9c0467c 100644 --- a/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/owner/Owner.java +++ b/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/owner/Owner.java @@ -19,10 +19,12 @@ import java.util.List; import java.util.Optional; +import org.eclipse.serializer.reference.Lazy; import org.springframework.core.style.ToStringCreator; import org.springframework.util.Assert; import software.xdev.spring.data.eclipse.store.demo.complex.model.Person; +import software.xdev.spring.data.eclipse.store.repository.lazy.SpringDataEclipseStoreLazy; public class Owner extends Person @@ -33,7 +35,7 @@ public class Owner extends Person private String telephone; - private final List pets = new ArrayList<>(); + private Lazy> pets = SpringDataEclipseStoreLazy.build(new ArrayList<>()); public String getAddress() { @@ -52,7 +54,12 @@ public String getTelephone() public List getPets() { - return this.pets; + return this.pets.get(); + } + + public void setPets(final List pets) + { + this.pets = SpringDataEclipseStoreLazy.build(pets); } public void addPet(final Pet pet) diff --git a/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/owner/OwnerRepository.java b/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/owner/OwnerRepository.java index 03b735b1..1c2b3e93 100644 --- a/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/owner/OwnerRepository.java +++ b/spring-data-eclipse-store-demo/src/main/java/software/xdev/spring/data/eclipse/store/demo/complex/owner/OwnerRepository.java @@ -15,6 +15,8 @@ */ package software.xdev.spring.data.eclipse.store.demo.complex.owner; +import java.util.List; + import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.repository.Repository; @@ -28,5 +30,7 @@ public interface OwnerRepository extends Repository Page findAll(Pageable pageable); + List findAll(); + void deleteAll(); } diff --git a/spring-data-eclipse-store-jpa/src/test/java/software/xdev/spring/data/eclipse/store/jpa/integration/repository/PersonToTestInEclipseStoreRepository.java b/spring-data-eclipse-store-jpa/src/test/java/software/xdev/spring/data/eclipse/store/jpa/integration/repository/PersonToTestInEclipseStoreRepository.java index 1f2b5418..a5be72f5 100644 --- a/spring-data-eclipse-store-jpa/src/test/java/software/xdev/spring/data/eclipse/store/jpa/integration/repository/PersonToTestInEclipseStoreRepository.java +++ b/spring-data-eclipse-store-jpa/src/test/java/software/xdev/spring/data/eclipse/store/jpa/integration/repository/PersonToTestInEclipseStoreRepository.java @@ -3,6 +3,7 @@ import software.xdev.spring.data.eclipse.store.repository.interfaces.EclipseStoreListCrudRepository; -public interface PersonToTestInEclipseStoreRepository extends EclipseStoreListCrudRepository +public interface PersonToTestInEclipseStoreRepository + extends EclipseStoreListCrudRepository { } diff --git a/spring-data-eclipse-store/pom.xml b/spring-data-eclipse-store/pom.xml index fc24c45d..75948fe8 100644 --- a/spring-data-eclipse-store/pom.xml +++ b/spring-data-eclipse-store/pom.xml @@ -200,6 +200,7 @@ ${project.organization.url} + 2024 diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/aot/EclipseStoreRuntimeHints.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/aot/EclipseStoreRuntimeHints.java index 20352c97..8055cdae 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/aot/EclipseStoreRuntimeHints.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/aot/EclipseStoreRuntimeHints.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/core/IdentitySet.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/core/IdentitySet.java index d5af7575..2545c21c 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/core/IdentitySet.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/core/IdentitySet.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/AlreadyRegisteredException.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/AlreadyRegisteredException.java index a0ba3bf7..83b59d8c 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/AlreadyRegisteredException.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/AlreadyRegisteredException.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/DataTypeNotSupportedException.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/DataTypeNotSupportedException.java index c6184649..8f0b3579 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/DataTypeNotSupportedException.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/DataTypeNotSupportedException.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/DifferentClassesException.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/DifferentClassesException.java index 9eee8d81..ebe9a16b 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/DifferentClassesException.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/DifferentClassesException.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/FieldAccessReflectionException.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/FieldAccessReflectionException.java index a5c854c7..d64206ef 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/FieldAccessReflectionException.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/FieldAccessReflectionException.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/IdFieldFinalException.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/IdFieldFinalException.java index 2abfa3e2..144e2c55 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/IdFieldFinalException.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/IdFieldFinalException.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/IdGeneratorNotSupportedException.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/IdGeneratorNotSupportedException.java index 808049b7..98f221fc 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/IdGeneratorNotSupportedException.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/IdGeneratorNotSupportedException.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/LazyNotUnlinkableException.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/LazyNotUnlinkableException.java new file mode 100644 index 00000000..4bb9978f --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/LazyNotUnlinkableException.java @@ -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. + *

+ * This exception should not be created by the user, but only within the Spring-Data-Eclipse-Store-Library. + *

+ */ +public class LazyNotUnlinkableException extends RuntimeException +{ + public LazyNotUnlinkableException(final String message, final Throwable e) + { + super(message, e); + } +} diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/MergeFailedException.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/MergeFailedException.java index 0ce35b02..0a602b3c 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/MergeFailedException.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/MergeFailedException.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/NoIdFieldFoundException.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/NoIdFieldFoundException.java index cd9c6f7f..2f612539 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/NoIdFieldFoundException.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/NoIdFieldFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/NoPageableObjectFoundException.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/NoPageableObjectFoundException.java index c49733a4..3c71f94d 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/NoPageableObjectFoundException.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/NoPageableObjectFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/NotComparableException.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/NotComparableException.java index 115e2b8f..b5fe9aa1 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/NotComparableException.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/NotComparableException.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/StringBlankException.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/StringBlankException.java index 78d203f2..0546e418 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/StringBlankException.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/StringBlankException.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/importer/EclipseStoreDataImporter.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/importer/EclipseStoreDataImporter.java index 18adb2d0..c6109fa7 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/importer/EclipseStoreDataImporter.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/importer/EclipseStoreDataImporter.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -205,8 +205,11 @@ private void createRepositoryForType( storageInstance.getRegistry(), storageInstance, storageInstance, - new SupportedChecker.Implementation()), - domainClass); + new SupportedChecker.Implementation(), + storageInstance + ), + domainClass + ); } private record EntityManagerFactoryRepositoryListPair( diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/importer/EclipseStoreDataImporterComponent.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/importer/EclipseStoreDataImporterComponent.java index 4c024223..ddeb3add 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/importer/EclipseStoreDataImporterComponent.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/importer/EclipseStoreDataImporterComponent.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -56,6 +56,7 @@ public EclipseStoreDataImporterComponent( * * @return all the newly created {@link SimpleEclipseStoreRepository} for the specific entities. */ + @SuppressWarnings("java:S1452") public List> importData() { final Map beansOfEms = diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/EclipseStoreStorage.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/EclipseStoreStorage.java index 32800225..a7764eb8 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/EclipseStoreStorage.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/EclipseStoreStorage.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -26,6 +26,8 @@ import org.eclipse.serializer.persistence.binary.jdk17.java.util.BinaryHandlerImmutableCollectionsList12; import org.eclipse.serializer.persistence.binary.jdk17.java.util.BinaryHandlerImmutableCollectionsSet12; import org.eclipse.serializer.persistence.types.Storer; +import org.eclipse.serializer.reference.LazyReferenceManager; +import org.eclipse.serializer.reference.ObjectSwizzling; import org.eclipse.store.storage.embedded.types.EmbeddedStorageFoundation; import org.eclipse.store.storage.types.StorageManager; import org.slf4j.Logger; @@ -40,7 +42,7 @@ import software.xdev.spring.data.eclipse.store.repository.support.reposyncer.SimpleRepositorySynchronizer; public class EclipseStoreStorage - implements EntityListProvider, IdSetterProvider, PersistableChecker + implements EntityListProvider, IdSetterProvider, PersistableChecker, ObjectSwizzling { private static final Logger LOG = LoggerFactory.getLogger(EclipseStoreStorage.class); private final Map, String> entityClassToRepositoryName = new HashMap<>(); @@ -272,6 +274,7 @@ public synchronized void stop() this.registry.reset(); this.entityClassToIdSetter.clear(); LOG.info("Stopped storage."); + LazyReferenceManager.get().stop(); } else { @@ -311,4 +314,11 @@ public boolean isPersistable(final Class clazz) this.ensureEntitiesInRoot(); return this.persistenceChecker.isPersistable(clazz); } + + @Override + public Object getObject(final long objectId) + { + this.ensureEntitiesInRoot(); + return this.storageManager.getObject(objectId); + } } diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/EntityListProvider.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/EntityListProvider.java index 1be8b552..e69c5f7b 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/EntityListProvider.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/EntityListProvider.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/EntitySetCollector.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/EntitySetCollector.java index d25edbfc..6d5b6936 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/EntitySetCollector.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/EntitySetCollector.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/IdSetterProvider.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/IdSetterProvider.java index 1e2e7133..08b9536c 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/IdSetterProvider.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/IdSetterProvider.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/PersistableChecker.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/PersistableChecker.java index b342a204..7a70c405 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/PersistableChecker.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/PersistableChecker.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/Query.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/Query.java index f56ba3f1..9099f492 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/Query.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/Query.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/RelayedPersistenceChecker.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/RelayedPersistenceChecker.java index ab89f64a..0f82d03a 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/RelayedPersistenceChecker.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/RelayedPersistenceChecker.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/Root.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/Root.java index ad078410..7ccbbc7f 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/Root.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/Root.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/SupportedChecker.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/SupportedChecker.java index 9d9cfc7b..c09d5180 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/SupportedChecker.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/SupportedChecker.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -20,6 +20,9 @@ import java.util.List; import java.util.WeakHashMap; +import org.eclipse.serializer.collections.lazy.LazyArrayList; +import org.eclipse.serializer.collections.lazy.LazyHashMap; +import org.eclipse.serializer.collections.lazy.LazyHashSet; import org.eclipse.serializer.reference.Lazy; @@ -41,29 +44,26 @@ public interface SupportedChecker *

* Some classes are not supported, because Eclipse Store doesn't support them. *

- *

- * {@link Lazy} is not supported, because a lot of hidden stuff must be done to keep Lazy-References really Lazy - * when creating a working copy. - *

*/ boolean isSupported(Class clazz); class Implementation implements SupportedChecker { private static final List> UNSUPPORTED_DATA_TYPES = List.of( - // Is difficult to handle when creating working copies - Lazy.class, // Here EclipseStore has problems: https://github.com/microstream-one/microstream/issues/173 Calendar.class, WeakHashMap.class, // Here EclipseStore has problems too: https://github.com/microstream-one/microstream/issues/204 - EnumMap.class + EnumMap.class, + LazyHashMap.class, + LazyArrayList.class, + LazyHashSet.class ); @Override public boolean isSupported(final Class clazz) { - return !UNSUPPORTED_DATA_TYPES.stream().anyMatch( + return UNSUPPORTED_DATA_TYPES.stream().noneMatch( unsupportedClazz -> unsupportedClazz.isAssignableFrom(clazz) ); } diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/WorkingCopyRegistry.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/WorkingCopyRegistry.java index 6f2b0b56..59d1422a 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/WorkingCopyRegistry.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/WorkingCopyRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -27,6 +27,9 @@ public class WorkingCopyRegistry { private static final Logger LOG = LoggerFactory.getLogger(WorkingCopyRegistry.class); + /** + * Map with Working Copies (key) with the corresponding original object (value). + */ private Map currentWorkingCopies = new IdentityHashMap<>(); /** diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/access/AccessHelper.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/access/AccessHelper.java index 29039059..06649b8a 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/access/AccessHelper.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/access/AccessHelper.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -99,7 +99,7 @@ public static Field getInheritedPrivateField(final Class clazz, final String */ public static Object readFieldVariable(final Field field, final T sourceObject) { - try(final FieldAccessModifier fieldAccessModifier = FieldAccessModifier.makeFieldReadable( + try(final FieldAccessModifier fieldAccessModifier = FieldAccessModifier.prepareForField( Objects.requireNonNull(field), Objects.requireNonNull(sourceObject))) { diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/access/modifier/FieldAccessModifier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/access/modifier/FieldAccessModifier.java index f6a9b382..cee4cae2 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/access/modifier/FieldAccessModifier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/access/modifier/FieldAccessModifier.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -24,7 +24,7 @@ */ public interface FieldAccessModifier extends AutoCloseable { - static FieldAccessModifier makeFieldReadable(final Field field, final T sourceObject) + static FieldAccessModifier prepareForField(final Field field, final T sourceObject) { return new FieldAccessibleMaker<>(Objects.requireNonNull(field), Objects.requireNonNull(sourceObject)); } diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/access/modifier/FieldAccessibleMaker.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/access/modifier/FieldAccessibleMaker.java index 5c0633d8..4381aff5 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/access/modifier/FieldAccessibleMaker.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/access/modifier/FieldAccessibleMaker.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/DefaultEclipseStoreClientConfiguration.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/DefaultEclipseStoreClientConfiguration.java index d621947d..d9659623 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/DefaultEclipseStoreClientConfiguration.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/DefaultEclipseStoreClientConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreClientConfiguration.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreClientConfiguration.java index 4247b395..05f04c80 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreClientConfiguration.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreClientConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreRepositoriesRegistrar.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreRepositoriesRegistrar.java index 5caeb6b7..c6fc042f 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreRepositoriesRegistrar.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreRepositoryConfigNamespaceHandler.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreRepositoryConfigNamespaceHandler.java index 61f3f770..a8d49b08 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreRepositoryConfigNamespaceHandler.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreRepositoryConfigNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreRepositoryConfigurationExtension.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreRepositoryConfigurationExtension.java index ecba9603..28fcd20f 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreRepositoryConfigurationExtension.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreRepositoryConfigurationExtension.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreStorageFoundationProvider.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreStorageFoundationProvider.java index 259c87e4..f01dfd08 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreStorageFoundationProvider.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EclipseStoreStorageFoundationProvider.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -24,5 +24,6 @@ */ public interface EclipseStoreStorageFoundationProvider { + @SuppressWarnings("java:S1452") EmbeddedStorageFoundation createEmbeddedStorageFoundation(); } diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EnableEclipseStoreRepositories.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EnableEclipseStoreRepositories.java index 405e033a..442e6be8 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EnableEclipseStoreRepositories.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/config/EnableEclipseStoreRepositories.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -45,7 +45,8 @@ @ComponentScan({ "software.xdev.spring.data.eclipse.store.importer", "software.xdev.spring.data.eclipse.store.repository", - "org.eclipse.store.integrations.spring.boot.types"}) + "org.eclipse.store.integrations.spring.boot.types", + "org.eclipse.store.integrations.spring.boot.types.converter"}) public @interface EnableEclipseStoreRepositories { diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreCrudRepository.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreCrudRepository.java index f9336ec4..325610c4 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreCrudRepository.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreCrudRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreCustomRepository.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreCustomRepository.java index f8883714..97c7b09e 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreCustomRepository.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreCustomRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreListCrudRepository.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreListCrudRepository.java index 700559fb..ac91ce71 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreListCrudRepository.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreListCrudRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreListPagingAndSortingRepositoryRepository.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreListPagingAndSortingRepositoryRepository.java index 1323550a..34a774fb 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreListPagingAndSortingRepositoryRepository.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreListPagingAndSortingRepositoryRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStorePagingAndSortingRepositoryRepository.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStorePagingAndSortingRepositoryRepository.java index c79b7238..33e65618 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStorePagingAndSortingRepositoryRepository.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStorePagingAndSortingRepositoryRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreRepository.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreRepository.java index 6ba02530..f70c739c 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreRepository.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/interfaces/EclipseStoreRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazy.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazy.java new file mode 100644 index 00000000..5e9fdf72 --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazy.java @@ -0,0 +1,257 @@ +/* + * 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.repository.lazy; + +import java.lang.reflect.Field; +import java.util.Objects; + +import org.eclipse.serializer.reference.Lazy; +import org.eclipse.serializer.reference.ObjectSwizzling; +import org.eclipse.serializer.reference.Swizzling; + +import software.xdev.spring.data.eclipse.store.exceptions.LazyNotUnlinkableException; +import software.xdev.spring.data.eclipse.store.repository.access.modifier.FieldAccessModifier; +import software.xdev.spring.data.eclipse.store.repository.support.copier.working.WorkingCopier; + + +/** + * This is the Lazy-Wrapper a user of the Spring-Data-Eclipse-Store-Library should use. Please do not use the + * {@link Lazy}-Wrapper! Because SDES is making working copies of the stored data, the {@link Lazy} does not work as + * expected. Instead, use this Wrapper. It brings the same functionality as the native {@link Lazy}-Wrapper but works + * with working copies. + * + * @param the type of the lazily referenced element + */ +public interface SpringDataEclipseStoreLazy extends Lazy +{ + static SpringDataEclipseStoreLazy.Default build(final T objectToWrapInLazy) + { + return new Default<>(objectToWrapInLazy); + } + + SpringDataEclipseStoreLazy copyWithReference(); + + void unlink(); + + long objectId(); + + boolean isOriginalObject(); + + interface Internals + { + static SpringDataEclipseStoreLazy.Default buildWithLazy(final Lazy lazySubject) + { + return new Default<>(lazySubject); + } + } + + /** + * This class is very complex and its various member variables all have their reason to exist. This code is very + * difficult to read due to its the functionality explained in the {@link SpringDataEclipseStoreLazyBinaryHandler}. + * + * @param the type of the lazily referenced element + */ + @SuppressWarnings({"java:S2065", "checkstyle:FinalClass"}) + class Default implements SpringDataEclipseStoreLazy + { + private T objectToBeWrapped; + private Lazy wrappedLazy; + private long objectId = Swizzling.notFoundId(); + private transient ObjectSwizzling loader; + private transient WorkingCopier copier; + private transient boolean isStored; + + private Default(final Lazy lazySubject) + { + this.setWrappedLazy(lazySubject); + } + + private Default(final T objectToBeWrapped) + { + this.objectToBeWrapped = objectToBeWrapped; + } + + private Default(final long objectId, final ObjectSwizzling loader, final WorkingCopier copier) + { + this.objectId = objectId; + this.loader = loader; + this.copier = copier; + // This object is already stored in the real storage. So it can get cleared. + this.setStored(); + } + + private Lazy ensureLazy() + { + if(this.wrappedLazy == null || !this.wrappedLazy.isLoaded()) + { + this.wrappedLazy = this.createNewDefaultLazyWithClearableReference(); + } + return this.wrappedLazy; + } + + @SuppressWarnings("unchecked") + private Lazy createNewDefaultLazyWithClearableReference() + { + Objects.requireNonNull(this.loader); + Objects.requireNonNull(this.copier); + + final T originalInstance = (T)this.loader.getObject(this.objectId); + final T copiedInstance = this.copier.onlyCreateCopy(originalInstance, false); + + return Lazy.New( + copiedInstance, + Swizzling.nullId(), + this.loader + ); + } + + @Override + public T get() + { + if(this.objectToBeWrapped != null) + { + return this.objectToBeWrapped; + } + return this.ensureLazy().get(); + } + + @Override + public T peek() + { + return this.ensureLazy().peek(); + } + + @Override + public T clear() + { + if(!this.isStored()) + { + throw new IllegalStateException("Cannot clear an unstored lazy reference."); + } + // Make sure to save the correct objectId. + this.objectId = this.objectId(); + this.wrappedLazy = null; + return null; + } + + @Override + public boolean isStored() + { + return this.isStored; + } + + void setStored() + { + this.isStored = true; + } + + @Override + public boolean isLoaded() + { + if(this.objectToBeWrapped != null) + { + return true; + } + if(this.wrappedLazy == null) + { + return false; + } + return this.ensureLazy().isLoaded(); + } + + @Override + public long lastTouched() + { + return this.ensureLazy().lastTouched(); + } + + @Override + public boolean clear(final ClearingEvaluator clearingEvaluator) + { + if(this.wrappedLazy != null) + { + return this.wrappedLazy.clear(clearingEvaluator); + } + return true; + } + + @Override + public long objectId() + { + if(this.wrappedLazy != null && this.wrappedLazy instanceof final Lazy.Default wrappedTypedLazy) + { + return wrappedTypedLazy.objectId(); + } + return this.objectId; + } + + void setWrappedLazy(final Lazy wrappedLazy) + { + this.wrappedLazy = wrappedLazy; + // This object is already stored in the real storage. So it can get cleared. + this.setStored(); + } + + public T getObjectToBeWrapped() + { + return this.objectToBeWrapped; + } + + @Override + public SpringDataEclipseStoreLazy copyWithReference() + { + final SpringDataEclipseStoreLazy.Default newLazy = new SpringDataEclipseStoreLazy.Default<>( + this.objectId(), + this.loader, + this.copier + ); + newLazy.wrappedLazy = this.wrappedLazy; + return newLazy; + } + + @Override + public void unlink() + { + try + { + if(this.wrappedLazy != null) + { + final Lazy.Default wrappedDefaultLazy = (Lazy.Default)this.wrappedLazy; + wrappedDefaultLazy.$unlink(); + final Field objectIdField = Lazy.Default.class.getDeclaredField("objectId"); + try(final FieldAccessModifier> fam = FieldAccessModifier.prepareForField( + objectIdField, + wrappedDefaultLazy)) + { + // The lazy object should be seen as "stored" by the LazyManager. + // Therefore, we must set the objectId to Swizzling.nullId(). + fam.writeValueOfField(wrappedDefaultLazy, Swizzling.nullId(), true); + } + } + } + catch(final Exception e) + { + throw new LazyNotUnlinkableException("Could not unlink lazy " + this.wrappedLazy, e); + } + } + + @Override + public boolean isOriginalObject() + { + return this.objectToBeWrapped != null; + } + } +} diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazyBinaryHandler.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazyBinaryHandler.java new file mode 100644 index 00000000..a6223a84 --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazyBinaryHandler.java @@ -0,0 +1,197 @@ +/* + * 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.repository.lazy; + +import java.lang.reflect.Constructor; +import java.util.Objects; + +import org.eclipse.serializer.memory.XMemory; +import org.eclipse.serializer.persistence.binary.types.AbstractBinaryHandlerCustom; +import org.eclipse.serializer.persistence.binary.types.Binary; +import org.eclipse.serializer.persistence.binary.types.BinaryTypeHandler; +import org.eclipse.serializer.persistence.types.PersistenceLoadHandler; +import org.eclipse.serializer.persistence.types.PersistenceReferenceLoader; +import org.eclipse.serializer.persistence.types.PersistenceStoreHandler; +import org.eclipse.serializer.reference.Lazy; +import org.eclipse.serializer.reference.ObjectSwizzling; +import org.eclipse.serializer.reflect.XReflect; + +import software.xdev.spring.data.eclipse.store.repository.support.copier.working.WorkingCopier; + + +/** + * This is a complicated one. First off: this handler should only be used for WorkingCopies (see + * {@link + * software.xdev.spring.data.eclipse.store.repository.support.copier.registering.EclipseSerializerRegisteringCopier})! + *

+ * First case:
+ * The user creates a {@link SpringDataEclipseStoreLazy} and puts a object in it. + * This object is stored as with a default {@link BinaryTypeHandler}. But when it gets loaded, + * it does not load as the stored object, but it gets wrapped in a {@link Lazy#Reference(Object)}. + *

+ *

+ * Second case:
+ * The actual lazy object gets loaded from the actual storage. In this case the {@link ObjectSwizzling} is + * important! It's the actual {@link ObjectSwizzling} from the storage (not from the + * {@link + * software.xdev.spring.data.eclipse.store.repository.support.copier.registering.EclipseSerializerRegisteringCopier}). + * This means, the {@link SpringDataEclipseStoreLazy} holds the objectId of the original lazy in the original + * storage. + * Therefore if {@link SpringDataEclipseStoreLazy#get()} is called a new working copy of the lazy from the + * storage is loaded. + *

+ */ +public final class SpringDataEclipseStoreLazyBinaryHandler + extends AbstractBinaryHandlerCustom> +{ + @SuppressWarnings("rawtypes") + static final Constructor CONSTRUCTOR_SURROGATE_LAZY = XReflect.setAccessible( + XReflect.getDeclaredConstructor( + SpringDataEclipseStoreLazy.Default.class, + long.class, + ObjectSwizzling.class, + WorkingCopier.class + ) + ); + + private static final int OFFSET_UNWRAPPED_OBJECT = 8; + private static final int OFFSET_LAZY = 0; + + private final ObjectSwizzling originalStoreLoader; + private final WorkingCopier copier; + + public SpringDataEclipseStoreLazyBinaryHandler( + final ObjectSwizzling originalStoreLoader, + final WorkingCopier copier) + { + super( + // Cast is necessary for the compiler + (Class)SpringDataEclipseStoreLazy.Default.class, + CustomFields( + CustomField(Object.class, "lazySubject"), + CustomField(Object.class, "unwrappedSubject") + ) + ); + this.originalStoreLoader = Objects.requireNonNull(originalStoreLoader); + this.copier = Objects.requireNonNull(copier); + } + + @Override + public void store( + final Binary data, + final SpringDataEclipseStoreLazy.Default instance, + final long objectId, + final PersistenceStoreHandler handler + ) + { + data.storeEntityHeader(Binary.referenceBinaryLength(2), this.typeId(), objectId); + if(instance.isOriginalObject()) + { + // Store unwrapped Object + data.store_long(OFFSET_UNWRAPPED_OBJECT, handler.applyEager(instance.getObjectToBeWrapped())); + } + else + { + // Store only reference to lazy + data.store_long(OFFSET_LAZY, instance.objectId()); + } + instance.setStored(); + } + + @SuppressWarnings("unchecked") + @Override + public SpringDataEclipseStoreLazy.Default create(final Binary data, final PersistenceLoadHandler handler) + { + final long objectIdOfLazy = data.read_long(OFFSET_LAZY); + final long objectIdOfUnwrappedObject = data.read_long(OFFSET_UNWRAPPED_OBJECT); + + if(objectIdOfUnwrappedObject == 0) + { + return Lazy.register( + XReflect.invoke(CONSTRUCTOR_SURROGATE_LAZY, objectIdOfLazy, this.originalStoreLoader, this.copier) + ); + } + return XMemory.instantiateBlank(SpringDataEclipseStoreLazy.Default.class); + } + + @Override + public void updateState( + final Binary data, + final SpringDataEclipseStoreLazy.Default instance, + final PersistenceLoadHandler handler + ) + { + this.updateStateT(data, instance, handler); + } + + private void updateStateT( + final Binary data, + final SpringDataEclipseStoreLazy.Default instance, + final PersistenceLoadHandler handler + ) + { + final long objectIdOfUnwrappedObject = data.read_long(OFFSET_UNWRAPPED_OBJECT); + + if(objectIdOfUnwrappedObject != 0) + { + instance.setWrappedLazy(Lazy.Reference((T)handler.lookupObject(objectIdOfUnwrappedObject))); + // Is already stored in the main storage. + instance.setStored(); + } + } + + @Override + public final void complete( + final Binary data, + final SpringDataEclipseStoreLazy.Default instance, + final PersistenceLoadHandler handler + ) + { + // no-op for normal implementation (see non-reference-hashing collections for other examples) + } + + @Override + public final boolean hasPersistedReferences() + { + return true; + } + + @Override + public final boolean hasPersistedVariableLength() + { + return false; + } + + @Override + public final boolean hasVaryingPersistedLengthInstances() + { + return false; + } + + @Override + public final void iterateLoadableReferences( + final Binary data, + final PersistenceReferenceLoader iterator + ) + { + final long objectIdOfUnwrappedObject = data.read_long(OFFSET_UNWRAPPED_OBJECT); + + if(objectIdOfUnwrappedObject != 0) + { + iterator.acceptObjectId(objectIdOfUnwrappedObject); + } + } +} diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreator.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreator.java index fb685694..6bed9ef5 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreator.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreator.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/FindAllEclipseStoreQueryProvider.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/FindAllEclipseStoreQueryProvider.java index 77e2de71..175e47b6 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/FindAllEclipseStoreQueryProvider.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/FindAllEclipseStoreQueryProvider.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/ReflectedField.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/ReflectedField.java index f3ece752..2fb19a78 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/ReflectedField.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/ReflectedField.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/StringBasedEclipseStoreQueryProvider.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/StringBasedEclipseStoreQueryProvider.java index 9fdfd8ca..957e958b 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/StringBasedEclipseStoreQueryProvider.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/StringBasedEclipseStoreQueryProvider.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/AbstractCriteriaNode.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/AbstractCriteriaNode.java index 876e3e42..fc62538a 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/AbstractCriteriaNode.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/AbstractCriteriaNode.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/Criteria.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/Criteria.java index 1ea456cd..7a211d7c 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/Criteria.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/Criteria.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/CriteriaAndNode.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/CriteriaAndNode.java index adcf44b4..0c683857 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/CriteriaAndNode.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/CriteriaAndNode.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/CriteriaOrNode.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/CriteriaOrNode.java index d7e84dd9..4e22b1b3 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/CriteriaOrNode.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/CriteriaOrNode.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/CriteriaSingleNode.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/CriteriaSingleNode.java index e6eddeeb..a0237d39 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/CriteriaSingleNode.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/criteria/CriteriaSingleNode.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/EntitySorter.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/EntitySorter.java index b34e1efb..48d7e5d9 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/EntitySorter.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/EntitySorter.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/ListQueryExecutor.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/ListQueryExecutor.java index 3a9d13e8..535036a2 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/ListQueryExecutor.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/ListQueryExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/PageableQueryExecutor.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/PageableQueryExecutor.java index cb4fe7ce..c21ffe16 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/PageableQueryExecutor.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/PageableQueryExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/PageableSortableCollectionQuerier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/PageableSortableCollectionQuerier.java index 25dc3923..13901115 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/PageableSortableCollectionQuerier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/PageableSortableCollectionQuerier.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/QueryExecutor.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/QueryExecutor.java index ebe92070..c2b312af 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/QueryExecutor.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/QueryExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/QueryExecutorCreator.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/QueryExecutorCreator.java index c5027e90..f802a9a8 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/QueryExecutorCreator.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/QueryExecutorCreator.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/SingleOptionalQueryExecutor.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/SingleOptionalQueryExecutor.java index eb06865b..ef0a98fa 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/SingleOptionalQueryExecutor.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/SingleOptionalQueryExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/SingleQueryExecutor.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/SingleQueryExecutor.java index 620cfd9f..d5f1c95f 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/SingleQueryExecutor.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/query/executors/SingleQueryExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/EclipseStoreQueryLookupStrategy.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/EclipseStoreQueryLookupStrategy.java index 3f0bf32b..06ca3f2b 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/EclipseStoreQueryLookupStrategy.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/EclipseStoreQueryLookupStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/EclipseStoreRepositoryFactory.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/EclipseStoreRepositoryFactory.java index 2f42894f..f5ab612c 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/EclipseStoreRepositoryFactory.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/EclipseStoreRepositoryFactory.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -86,7 +86,8 @@ private WorkingCopier createWorkingCopier( storage.getRegistry(), storage, storage, - new SupportedChecker.Implementation() + new SupportedChecker.Implementation(), + storage ); } diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/EclipseStoreRepositoryFactoryBean.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/EclipseStoreRepositoryFactoryBean.java index 6ab1907f..fb859e62 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/EclipseStoreRepositoryFactoryBean.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/EclipseStoreRepositoryFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/IdFieldFinder.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/IdFieldFinder.java index c956cf6a..2e0a31e5 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/IdFieldFinder.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/IdFieldFinder.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/SimpleEclipseStoreRepository.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/SimpleEclipseStoreRepository.java index b366c873..8e5ef8cc 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/SimpleEclipseStoreRepository.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/SimpleEclipseStoreRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -151,7 +151,7 @@ public Optional findById(@Nonnull final ID id) { for(final T entity : this.storage.getEntityList(this.domainClass)) { - try(final FieldAccessModifier fam = FieldAccessModifier.makeFieldReadable(this.getIdField(), entity)) + try(final FieldAccessModifier fam = FieldAccessModifier.prepareForField(this.getIdField(), entity)) { if(id.equals(fam.getValueOfField(entity))) { @@ -173,7 +173,7 @@ public boolean existsById(@Nonnull final ID id) { for(final T entity : this.storage.getEntityList(this.domainClass)) { - try(final FieldAccessModifier fam = FieldAccessModifier.makeFieldReadable(this.getIdField(), entity)) + try(final FieldAccessModifier fam = FieldAccessModifier.prepareForField(this.getIdField(), entity)) { if(id.equals(fam.getValueOfField(entity))) { @@ -204,7 +204,7 @@ public List findAllById(@Nonnull final Iterable ids) final List foundEntities = new ArrayList<>(); for(final T entity : this.storage.getEntityList(this.domainClass)) { - try(final FieldAccessModifier fam = FieldAccessModifier.makeFieldReadable(this.getIdField(), entity)) + try(final FieldAccessModifier fam = FieldAccessModifier.prepareForField(this.getIdField(), entity)) { for(final ID id : ids) { diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/DataTypeUtil.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/DataTypeUtil.java index 0e6fc2de..7101400d 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/DataTypeUtil.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/DataTypeUtil.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -20,6 +20,8 @@ import jakarta.annotation.Nonnull; +import software.xdev.spring.data.eclipse.store.repository.lazy.SpringDataEclipseStoreLazy; + public final class DataTypeUtil { @@ -45,6 +47,11 @@ public static boolean isObjectArray(final Object obj) return obj instanceof Object[]; } + public static boolean isSpringDataEclipseStoreLazy(final Object obj) + { + return obj instanceof SpringDataEclipseStoreLazy; + } + public static boolean isPrimitiveArray(final Object obj) { return obj instanceof boolean[] diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/IdSetter.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/IdSetter.java index f3a08497..9a2f1da0 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/IdSetter.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/IdSetter.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/NotSettingIdSetter.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/NotSettingIdSetter.java index 4177bf27..c299b55d 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/NotSettingIdSetter.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/NotSettingIdSetter.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/SimpleIdSetter.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/SimpleIdSetter.java index 5c7a5975..e59bc75f 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/SimpleIdSetter.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/SimpleIdSetter.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -53,7 +53,7 @@ private void checkIfIdFieldIsFinal() @Override public void ensureId(final T objectToSetIdIn) { - try(final FieldAccessModifier fam = FieldAccessModifier.makeFieldReadable( + try(final FieldAccessModifier fam = FieldAccessModifier.prepareForField( this.idField, objectToSetIdIn)) { diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/IdFinder.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/IdFinder.java index b26de773..2618fa2b 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/IdFinder.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/IdFinder.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AbstractAutoIdFinder.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AbstractAutoIdFinder.java index ac603696..beb768f2 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AbstractAutoIdFinder.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AbstractAutoIdFinder.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AutoIntegerIdFinder.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AutoIntegerIdFinder.java index 39602d50..0f4b4535 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AutoIntegerIdFinder.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AutoIntegerIdFinder.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AutoLongIdFinder.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AutoLongIdFinder.java index db1e5ea9..b3b41e56 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AutoLongIdFinder.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AutoLongIdFinder.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AutoStringIdFinder.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AutoStringIdFinder.java index c4e835eb..afc2cbca 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AutoStringIdFinder.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/id/strategy/auto/AutoStringIdFinder.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/AbstractRegisteringCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/AbstractRegisteringCopier.java new file mode 100644 index 00000000..d5bc900d --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/AbstractRegisteringCopier.java @@ -0,0 +1,97 @@ +/* + * 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.repository.support.copier.registering; + +import org.eclipse.serializer.Serializer; +import org.eclipse.serializer.SerializerFoundation; +import org.eclipse.serializer.persistence.binary.jdk17.java.util.BinaryHandlerImmutableCollectionsList12; +import org.eclipse.serializer.persistence.binary.jdk17.java.util.BinaryHandlerImmutableCollectionsSet12; +import org.eclipse.serializer.persistence.binary.types.Binary; +import org.eclipse.serializer.persistence.types.PersistenceManager; +import org.eclipse.serializer.reference.ObjectSwizzling; +import org.eclipse.serializer.reference.Reference; +import org.eclipse.serializer.util.X; + +import software.xdev.spring.data.eclipse.store.repository.SupportedChecker; +import software.xdev.spring.data.eclipse.store.repository.lazy.SpringDataEclipseStoreLazyBinaryHandler; +import software.xdev.spring.data.eclipse.store.repository.support.copier.working.WorkingCopier; + + +/** + * This class registers storage instances and copy them for working copies. Utilizes + * {@link EclipseSerializerRegisteringCopier}. + */ +public abstract class AbstractRegisteringCopier implements RegisteringObjectCopier +{ + private final EclipseSerializerRegisteringCopier actualCopier; + + protected AbstractRegisteringCopier( + final SupportedChecker supportedChecker, + final RegisteringWorkingCopyAndOriginal register, + final ObjectSwizzling objectSwizzling, + final WorkingCopier copier) + { + this.actualCopier = new EclipseSerializerRegisteringCopier( + supportedChecker, + register, + this.createPersistenceManager( + this.createSerializerFoundation(), + objectSwizzling, + copier + ) + ); + } + + private PersistenceManager createPersistenceManager( + final SerializerFoundation serializerFoundation, + final ObjectSwizzling objectSwizzling, + final WorkingCopier copier) + { + return serializerFoundation + .registerCustomTypeHandler(BinaryHandlerImmutableCollectionsSet12.New()) + .registerCustomTypeHandler(BinaryHandlerImmutableCollectionsList12.New()) + .registerCustomTypeHandlers(new SpringDataEclipseStoreLazyBinaryHandler(objectSwizzling, copier)) + .createPersistenceManager(); + } + + @SuppressWarnings("java:S1452") + protected SerializerFoundation createSerializerFoundation() + { + final Reference buffer = X.Reference(null); + final Serializer.Source source = () -> X.Constant(buffer.get()); + final Serializer.Target target = buffer::set; + + return SerializerFoundation.New() + .setPersistenceSource(source) + .setPersistenceTarget(target) + // Make every type persistable. + // This is quite dangerous! + // But if this is not set we get problems e.g. with HashMap$Node + .setTypeEvaluatorPersistable(a -> true); + } + + @Override + public synchronized T copy(final T source) + { + return this.actualCopier.copy(source); + } + + @Override + public synchronized void close() + { + this.actualCopier.close(); + } +} diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/object/EclipseSerializerRegisteringCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/EclipseSerializerRegisteringCopier.java similarity index 65% rename from spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/object/EclipseSerializerRegisteringCopier.java rename to spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/EclipseSerializerRegisteringCopier.java index 00f6f8e5..5ec09598 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/object/EclipseSerializerRegisteringCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/EclipseSerializerRegisteringCopier.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -13,28 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package software.xdev.spring.data.eclipse.store.repository.support.copier.object; +package software.xdev.spring.data.eclipse.store.repository.support.copier.registering; import java.util.HashMap; import java.util.Map; -import org.eclipse.serializer.Serializer; -import org.eclipse.serializer.SerializerFoundation; -import org.eclipse.serializer.persistence.binary.jdk17.java.util.BinaryHandlerImmutableCollectionsList12; -import org.eclipse.serializer.persistence.binary.jdk17.java.util.BinaryHandlerImmutableCollectionsSet12; import org.eclipse.serializer.persistence.binary.types.Binary; import org.eclipse.serializer.persistence.binary.types.BinaryStorer; import org.eclipse.serializer.persistence.types.PersistenceLoader; import org.eclipse.serializer.persistence.types.PersistenceManager; import org.eclipse.serializer.persistence.types.PersistenceStorer; -import org.eclipse.serializer.reference.Reference; -import org.eclipse.serializer.util.X; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import software.xdev.spring.data.eclipse.store.exceptions.DataTypeNotSupportedException; import software.xdev.spring.data.eclipse.store.repository.SupportedChecker; -import software.xdev.spring.data.eclipse.store.repository.WorkingCopyRegistry; import software.xdev.spring.data.eclipse.store.repository.support.copier.DataTypeUtil; @@ -42,32 +35,23 @@ * This class utilizes EclipseStore-Serialization and copies objects by serializing and deserializing objects in * memory. */ -public class EclipseSerializerRegisteringCopier implements RegisteringObjectCopier +public class EclipseSerializerRegisteringCopier implements AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(EclipseSerializerRegisteringCopier.class); - private final SerializerFoundation foundation; private PersistenceManager persistenceManager; private final SupportedChecker supportedChecker; - - private final WorkingCopyRegistry registry; + private final RegisteringWorkingCopyAndOriginal register; public EclipseSerializerRegisteringCopier( - final WorkingCopyRegistry registry, - final SupportedChecker supportedChecker) + final SupportedChecker supportedChecker, + final RegisteringWorkingCopyAndOriginal register, + final PersistenceManager persistenceManager) { - final SerializerFoundation newFoundation = SerializerFoundation.New(); - newFoundation.registerCustomTypeHandler(BinaryHandlerImmutableCollectionsSet12.New()); - newFoundation.registerCustomTypeHandler(BinaryHandlerImmutableCollectionsList12.New()); - this.foundation = newFoundation; - this.registry = registry; this.supportedChecker = supportedChecker; + this.register = register; + this.persistenceManager = persistenceManager; } - - @Override - public synchronized T copy(final T source) - { - return this.copy(source, false); - } + @Override public synchronized void close() @@ -80,28 +64,6 @@ public synchronized void close() } } - private void lazyInit() - { - if(this.persistenceManager == null) - { - final Reference buffer = X.Reference(null); - final Serializer.Source source = () -> X.Constant(buffer.get()); - final Serializer.Target target = buffer::set; - this.persistenceManager = - (((SerializerFoundation)this.foundation.setPersistenceSource(source)) - .setPersistenceTarget(target)) - // Make every type persistable. - // This is quite dangerous! - // But if this is not set we get problems e.g. with HashMap$Node - .setTypeEvaluatorPersistable(a -> true) - .createPersistenceManager(); - } - else - { - this.persistenceManager.objectRegistry().truncateAll(); - } - } - /** * Here lies a lot of knowledge about EclipseStore internals. *

@@ -116,11 +78,9 @@ private void lazyInit() * EclipseStore-ObjectId. *

*/ - @SuppressWarnings("unchecked") - @Override - public synchronized T copy(final T source, final boolean invertRegistering) + public synchronized T copy(final T source) { - this.lazyInit(); + this.persistenceManager.objectRegistry().truncateAll(); final BinaryStorer.Default storer = (BinaryStorer.Default)this.persistenceManager.createStorer(); // Loader erstellen final PersistenceLoader loader = this.persistenceManager.createLoader(); @@ -153,14 +113,7 @@ public synchronized T copy(final T source, final boolean invertRegistering) if(originalObject != null) { summarizer.incrementRegisteredObjectsCount(); - if(invertRegistering) - { - this.registry.invertRegister(copiedObject, originalObject); - } - else - { - this.registry.register(copiedObject, originalObject); - } + this.register.register(copiedObject, originalObject); } } ); diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/object/RegisteringObjectCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringObjectCopier.java similarity index 73% rename from spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/object/RegisteringObjectCopier.java rename to spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringObjectCopier.java index 4e659c08..146cd700 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/object/RegisteringObjectCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringObjectCopier.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -13,12 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package software.xdev.spring.data.eclipse.store.repository.support.copier.object; +package software.xdev.spring.data.eclipse.store.repository.support.copier.registering; -import org.eclipse.serializer.ObjectCopier; - - -public interface RegisteringObjectCopier extends ObjectCopier +public interface RegisteringObjectCopier extends AutoCloseable { - T copy(T t, boolean invertRegistering); + T copy(T t); } diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringStorageToWorkingCopyCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringStorageToWorkingCopyCopier.java new file mode 100644 index 00000000..df11886e --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringStorageToWorkingCopyCopier.java @@ -0,0 +1,44 @@ +/* + * 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.repository.support.copier.registering; + +import org.eclipse.serializer.reference.ObjectSwizzling; + +import software.xdev.spring.data.eclipse.store.repository.SupportedChecker; +import software.xdev.spring.data.eclipse.store.repository.WorkingCopyRegistry; +import software.xdev.spring.data.eclipse.store.repository.support.copier.working.WorkingCopier; + + +/** + * This class registers storage instances and copy them for working copies. Utilizes + * {@link EclipseSerializerRegisteringCopier}. + */ +public class RegisteringStorageToWorkingCopyCopier extends AbstractRegisteringCopier +{ + public RegisteringStorageToWorkingCopyCopier( + final WorkingCopyRegistry registry, + final SupportedChecker supportedChecker, + final ObjectSwizzling objectSwizzling, + final WorkingCopier copier) + { + super( + supportedChecker, + registry::register, + objectSwizzling, + copier + ); + } +} diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringWorkingCopyAndOriginal.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringWorkingCopyAndOriginal.java new file mode 100644 index 00000000..3a9ca24d --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringWorkingCopyAndOriginal.java @@ -0,0 +1,22 @@ +/* + * 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.repository.support.copier.registering; + +@FunctionalInterface +public interface RegisteringWorkingCopyAndOriginal +{ + boolean register(final Object workingCopy, final Object objectToStore); +} diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringWorkingCopyToStorageCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringWorkingCopyToStorageCopier.java new file mode 100644 index 00000000..9fdc45f7 --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringWorkingCopyToStorageCopier.java @@ -0,0 +1,45 @@ +/* + * 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.repository.support.copier.registering; + +import org.eclipse.serializer.reference.ObjectSwizzling; + +import software.xdev.spring.data.eclipse.store.repository.SupportedChecker; +import software.xdev.spring.data.eclipse.store.repository.WorkingCopyRegistry; +import software.xdev.spring.data.eclipse.store.repository.support.copier.working.WorkingCopier; + + +/** + * This class registers working copy instances and copy them for the storage. Utilizes + * {@link EclipseSerializerRegisteringCopier}. + */ +public class RegisteringWorkingCopyToStorageCopier extends AbstractRegisteringCopier +{ + + public RegisteringWorkingCopyToStorageCopier( + final WorkingCopyRegistry registry, + final SupportedChecker supportedChecker, + final ObjectSwizzling objectSwizzling, + final WorkingCopier copier) + { + super( + supportedChecker, + registry::invertRegister, + objectSwizzling, + copier + ); + } +} diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/ChangedObjectCollector.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/ChangedObjectCollector.java index d1cd9f5b..c3461f20 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/ChangedObjectCollector.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/ChangedObjectCollector.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/HashSetChangedObjectCollector.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/HashSetChangedObjectCollector.java index dc9fad70..fd3f31b1 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/HashSetChangedObjectCollector.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/HashSetChangedObjectCollector.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/HashSetMergedTargetsCollector.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/HashSetMergedTargetsCollector.java index 4e1c7cbc..3569e548 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/HashSetMergedTargetsCollector.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/HashSetMergedTargetsCollector.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/MergedTargetsCollector.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/MergedTargetsCollector.java index 86112646..4efaa8ad 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/MergedTargetsCollector.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/MergedTargetsCollector.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/RecursiveWorkingCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/RecursiveWorkingCopier.java index a781da27..c03949fa 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/RecursiveWorkingCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/RecursiveWorkingCopier.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -27,6 +27,8 @@ import java.util.TreeMap; import java.util.TreeSet; +import org.eclipse.serializer.reference.Lazy; +import org.eclipse.serializer.reference.ObjectSwizzling; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -37,9 +39,11 @@ import software.xdev.spring.data.eclipse.store.repository.WorkingCopyRegistry; import software.xdev.spring.data.eclipse.store.repository.access.AccessHelper; import software.xdev.spring.data.eclipse.store.repository.access.modifier.FieldAccessModifier; +import software.xdev.spring.data.eclipse.store.repository.lazy.SpringDataEclipseStoreLazy; import software.xdev.spring.data.eclipse.store.repository.support.copier.DataTypeUtil; -import software.xdev.spring.data.eclipse.store.repository.support.copier.object.EclipseSerializerRegisteringCopier; -import software.xdev.spring.data.eclipse.store.repository.support.copier.object.RegisteringObjectCopier; +import software.xdev.spring.data.eclipse.store.repository.support.copier.registering.RegisteringObjectCopier; +import software.xdev.spring.data.eclipse.store.repository.support.copier.registering.RegisteringStorageToWorkingCopyCopier; +import software.xdev.spring.data.eclipse.store.repository.support.copier.registering.RegisteringWorkingCopyToStorageCopier; /** @@ -48,7 +52,8 @@ public class RecursiveWorkingCopier implements WorkingCopier { private static final Logger LOG = LoggerFactory.getLogger(RecursiveWorkingCopier.class); - private final RegisteringObjectCopier objectCopier; + private final RegisteringObjectCopier workingCopyToStorageCopier; + private final RegisteringObjectCopier storageToWorkingCopyCopier; private final WorkingCopyRegistry registry; private final IdSetterProvider idSetterProvider; private final Class domainClass; @@ -59,11 +64,15 @@ public RecursiveWorkingCopier( final WorkingCopyRegistry registry, final IdSetterProvider idSetterProvider, final PersistableChecker persistableChecker, - final SupportedChecker supportedChecker) + final SupportedChecker supportedChecker, + final ObjectSwizzling objectSwizzling) { this.domainClass = domainClass; this.registry = registry; - this.objectCopier = new EclipseSerializerRegisteringCopier(registry, supportedChecker); + this.workingCopyToStorageCopier = + new RegisteringWorkingCopyToStorageCopier(registry, supportedChecker, objectSwizzling, this); + this.storageToWorkingCopyCopier = + new RegisteringStorageToWorkingCopyCopier(registry, supportedChecker, objectSwizzling, this); this.idSetterProvider = idSetterProvider; this.persistableChecker = persistableChecker; } @@ -144,7 +153,7 @@ public E getOrCreateObjectForDatastore( // The object to merge back is not a working copy, but a originalObject. // Therefore, we create a copy to persist this in the storage. final E objectForDatastore = this.genericCopy(workingCopy, true); - // "Why merging values of an identical object?" you might ask. + // "Why merge values of an identical object?" you might ask. // Well, because some sub-objects might already be in the datastore. this.mergeValues(workingCopy, objectForDatastore, alreadyMergedTargets, changedCollector); changedCollector.collectChangedObject(objectForDatastore); @@ -161,7 +170,8 @@ private void mergeValues( final E sourceObject, final E targetObject, final MergedTargetsCollector alreadyMergedTargets, - final ChangedObjectCollector changedCollector) + final ChangedObjectCollector changedCollector + ) { if(sourceObject == targetObject || alreadyMergedTargets.isAlreadyMerged(targetObject) || targetObject == null) { @@ -172,14 +182,21 @@ private void mergeValues( { alreadyMergedTargets.collectMergedTarget(targetObject); - if(sourceObject instanceof String) + if(sourceObject instanceof String || sourceObject instanceof SpringDataEclipseStoreLazy) { // no merge needed and no merge possible return; } - AccessHelper.getInheritedPrivateFieldsByName(sourceObject.getClass()).values().forEach( + final Collection valuesToMerge = + AccessHelper.getInheritedPrivateFieldsByName(sourceObject.getClass()).values(); + valuesToMerge.forEach( field -> - this.mergeValueOfField(sourceObject, targetObject, field, alreadyMergedTargets, changedCollector) + this.mergeValueOfField( + sourceObject, + targetObject, + field, + alreadyMergedTargets, + changedCollector) ); } catch(final Exception e) @@ -203,7 +220,7 @@ private void mergeValueOfField( return; } - try(final FieldAccessModifier fam = FieldAccessModifier.makeFieldReadable( + try(final FieldAccessModifier fam = FieldAccessModifier.prepareForField( field, sourceObject)) { @@ -243,41 +260,28 @@ else if(DataTypeUtil.isObjectArray(valueOfSourceObject)) ); fam.writeValueOfField(targetObject, newArray, !targetObjectIsPartOfJavaPackage); } + else if(DataTypeUtil.isSpringDataEclipseStoreLazy(valueOfSourceObject)) + { + final SpringDataEclipseStoreLazy newLazy = + this.createNewLazy( + (SpringDataEclipseStoreLazy)valueOfSourceObject, + (SpringDataEclipseStoreLazy)valueOfTargetObject, + alreadyMergedTargets, + changedCollector); + fam.writeValueOfField(targetObject, newLazy, true); + } else { // "Simple" object // get original value object - final Object originalValueObjectOfSource = - this.getOrCreateObjectForDatastore( - valueOfSourceObject, - false, - alreadyMergedTargets, - changedCollector); - if(valueOfTargetObject != originalValueObjectOfSource) - { - // If the reference is new, it must be set - fam.writeValueOfField( - targetObject, - originalValueObjectOfSource, - !targetObjectIsPartOfJavaPackage); - } - - if(this.isSpecialCaseWhereOnlyAFullCopyWorks(valueOfSourceObject)) - { - fam.writeValueOfField( - targetObject, - this.onlyCreateCopy(valueOfSourceObject, true), - !targetObjectIsPartOfJavaPackage); - } - else - { - // Merge after setting reference to avoid endless loops - this.mergeValues( - valueOfSourceObject, - originalValueObjectOfSource, - alreadyMergedTargets, - changedCollector); - } + this.mergeSimpleObjectValue( + targetObject, + alreadyMergedTargets, + changedCollector, + valueOfSourceObject, + valueOfTargetObject, + fam, + targetObjectIsPartOfJavaPackage); } } } @@ -288,6 +292,99 @@ else if(DataTypeUtil.isObjectArray(valueOfSourceObject)) } } + private void mergeSimpleObjectValue( + final E targetObject, + final MergedTargetsCollector alreadyMergedTargets, + final ChangedObjectCollector changedCollector, + final Object valueOfSourceObject, + final Object valueOfTargetObject, + final FieldAccessModifier fam, + final boolean targetObjectIsPartOfJavaPackage) throws IllegalAccessException + { + final Object originalValueObjectOfSource = + this.getOrCreateObjectForDatastore( + valueOfSourceObject, + false, + alreadyMergedTargets, + changedCollector); + if(valueOfTargetObject != originalValueObjectOfSource) + { + // If the reference is new, it must be set + fam.writeValueOfField( + targetObject, + originalValueObjectOfSource, + !targetObjectIsPartOfJavaPackage); + } + + if(this.isSpecialCaseWhereOnlyAFullCopyWorks(valueOfSourceObject)) + { + fam.writeValueOfField( + targetObject, + this.onlyCreateCopy(valueOfSourceObject, true), + !targetObjectIsPartOfJavaPackage); + } + else + { + // Merge after setting reference to avoid endless loops + this.mergeValues( + valueOfSourceObject, + originalValueObjectOfSource, + alreadyMergedTargets, + changedCollector); + } + } + + private SpringDataEclipseStoreLazy createNewLazy( + final SpringDataEclipseStoreLazy oldLazy, + final SpringDataEclipseStoreLazy newLazy, + final MergedTargetsCollector alreadyMergedTargets, + final ChangedObjectCollector changedCollector + ) + { + if(oldLazy.isLoaded()) + { + if(oldLazy.isOriginalObject()) + { + // This object is new and in this case it is merged into the storage. + if(!newLazy.isStored()) + { + // The EclipseSerializerRegisteringCopier already creates the perfect lazy object. + // No change necessary. + return (SpringDataEclipseStoreLazy)newLazy; + } + else + { + // This object is already stored but the new version must get overwritten. + // The oldLazy Object can contain all kinds of objects (including more lazies) + final E copyOfWrappedObject = this.getOrCreateObjectForDatastore( + oldLazy.get(), + true, + alreadyMergedTargets, + changedCollector); + oldLazy.unlink(); + newLazy.unlink(); + + return SpringDataEclipseStoreLazy.Internals.buildWithLazy(Lazy.Reference(copyOfWrappedObject)); + } + } + final E copyOfWrappedObject = this.getOrCreateObjectForDatastore( + oldLazy.get(), + true, + alreadyMergedTargets, + changedCollector); + oldLazy.unlink(); + newLazy.unlink(); + return SpringDataEclipseStoreLazy.build(copyOfWrappedObject); + } + else + { + oldLazy.unlink(); + // This lazy should never be used again! + // It is though of as a temporary copy to merge back into the original-storage-data. + return (SpringDataEclipseStoreLazy)newLazy.copyWithReference(); + } + } + /** * Super special case for HashMap or similar java-classes which can't be merged nicely. Thus, we make a simple copy * of the whole object. @@ -326,9 +423,14 @@ private E[] createGenericObjectArray( return newArray; } - private E onlyCreateCopy(final E objectToCopy, final boolean invertRegistry) + @Override + public E onlyCreateCopy(final E objectToCopy, final boolean invertRegistry) { - return this.objectCopier.copy(objectToCopy, invertRegistry); + if(invertRegistry) + { + return this.workingCopyToStorageCopier.copy(objectToCopy); + } + return this.storageToWorkingCopyCopier.copy(objectToCopy); } @Override diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/WorkingCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/WorkingCopier.java index c2c60f23..fdf84e73 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/WorkingCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/WorkingCopier.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -50,6 +50,8 @@ public interface WorkingCopier */ WorkingCopierResult mergeBack(T workingCopy); + E onlyCreateCopy(final E objectToCopy, final boolean invertRegistry); + /** * @return the original entity that corresponds to the given working copy object. */ diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/WorkingCopierCreator.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/WorkingCopierCreator.java index e5415938..4f0a50a8 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/WorkingCopierCreator.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/WorkingCopierCreator.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/WorkingCopierResult.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/WorkingCopierResult.java index b780b2da..c88bc711 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/WorkingCopierResult.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/WorkingCopierResult.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/reposyncer/RepositorySynchronizer.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/reposyncer/RepositorySynchronizer.java index b071aae5..399552a2 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/reposyncer/RepositorySynchronizer.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/reposyncer/RepositorySynchronizer.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/reposyncer/SimpleRepositorySynchronizer.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/reposyncer/SimpleRepositorySynchronizer.java index 644b4fa8..5b812d77 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/reposyncer/SimpleRepositorySynchronizer.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/reposyncer/SimpleRepositorySynchronizer.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/util/GenericObjectComparer.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/util/GenericObjectComparer.java index 22bf49b3..633f6544 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/util/GenericObjectComparer.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/util/GenericObjectComparer.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/util/StringUtil.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/util/StringUtil.java index bcf1a600..8bea8d55 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/util/StringUtil.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/util/StringUtil.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/DummyWorkingCopier.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/DummyWorkingCopier.java index e92deeb6..d07d0627 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/DummyWorkingCopier.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/DummyWorkingCopier.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -41,6 +41,12 @@ public WorkingCopierResult mergeBack(final T workingCopy) return null; } + @Override + public E onlyCreateCopy(final E objectToCopy, final boolean invertRegistry) + { + return objectToCopy; + } + @Override public T getOriginal(final T workingCopy) { diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/StorageDirectoryNameProvider.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/StorageDirectoryNameProvider.java index d34205b1..2813f208 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/StorageDirectoryNameProvider.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/StorageDirectoryNameProvider.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -20,10 +20,14 @@ public final class StorageDirectoryNameProvider { - private static final AtomicInteger seqNumber = new AtomicInteger(1); + private static final AtomicInteger SEQ_NUMBER = new AtomicInteger(1); + + private StorageDirectoryNameProvider() + { + } public static String getNewStorageDirectoryPath() { - return String.format("./target/tempstorage-%05d", seqNumber.getAndIncrement()); + return String.format("./target/tempstorage-%05d", SEQ_NUMBER.getAndIncrement()); } } diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/TestData.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/TestData.java index e5482b6d..683d5e69 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/TestData.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/TestData.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -22,6 +22,9 @@ public final class TestData public static final String LAST_NAME_ALTERNATIVE = "Nicks"; public static final String FIRST_NAME_ALTERNATIVE = "Stevie"; + public static final String DUMMY_STRING = "-- skldfoöüä+#+!(/%&/%($§\"=)()nxjkß? _:.. ,-.;"; + public static final String DUMMY_STRING_ALTERNATIVE = " abc "; + private TestData() { } diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/TestUtil.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/TestUtil.java index 5def490f..dcfc4e77 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/TestUtil.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/helper/TestUtil.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/TestConfiguration.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/TestConfiguration.java index 855f7e5e..3f6557fd 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/TestConfiguration.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/TestConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/IsolatedTestAnnotations.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/IsolatedTestAnnotations.java index 0fddcacf..164c75e1 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/IsolatedTestAnnotations.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/IsolatedTestAnnotations.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/package-info.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/package-info.java index a5d558eb..917d49c7 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/package-info.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/DeletionTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/DeletionTest.java new file mode 100644 index 00000000..da5a3827 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/DeletionTest.java @@ -0,0 +1,87 @@ +/* + * 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.integration.isolated.tests.deletion; + +import java.util.List; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; + +import software.xdev.spring.data.eclipse.store.helper.TestUtil; +import software.xdev.spring.data.eclipse.store.integration.isolated.IsolatedTestAnnotations; + + +/** + * These tests should show that all or most of the following keywords are available in this library: Repository query + * keywords + */ +@IsolatedTestAnnotations +@ContextConfiguration(classes = {DeletionTestConfiguration.class}) +class DeletionTest +{ + @Autowired + private DeletionTestConfiguration configuration; + + @Test + void deleteReferencedObject( + @Autowired final ReferencedRepository referencedRepository, + @Autowired final ReferencingRepository referencingRepository) + { + final ReferencedDaoObject referencedObject = new ReferencedDaoObject("someValue"); + final ReferencingDaoObject referencingDaoObject = new ReferencingDaoObject(referencedObject); + referencingRepository.save(referencingDaoObject); + + Assertions.assertEquals(1, TestUtil.iterableToList(referencingRepository.findAll()).size()); + Assertions.assertEquals(1, TestUtil.iterableToList(referencedRepository.findAll()).size()); + + referencedRepository.delete(referencedObject); + + TestUtil.doBeforeAndAfterRestartOfDatastore( + this.configuration, + () -> { + Assertions.assertTrue(TestUtil.iterableToList(referencedRepository.findAll()).isEmpty()); + final List referencingDaoObjects = + TestUtil.iterableToList(referencingRepository.findAll()); + Assertions.assertEquals(1, referencingDaoObjects.size()); + Assertions.assertNotNull(referencingDaoObjects.get(0).getValue()); + } + ); + } + + @Test + void restoreDeletedReferencedObject( + @Autowired final ReferencedRepository referencedRepository, + @Autowired final ReferencingRepository referencingRepository) + { + final ReferencedDaoObject referencedObject = new ReferencedDaoObject("someValue"); + final ReferencingDaoObject referencingDaoObject = new ReferencingDaoObject(referencedObject); + + referencingRepository.save(referencingDaoObject); + referencedRepository.delete(referencedObject); + referencingRepository.save(referencingDaoObject); + + TestUtil.doBeforeAndAfterRestartOfDatastore( + this.configuration, + () -> { + Assertions.assertEquals(1, TestUtil.iterableToList(referencingRepository.findAll()).size()); + Assertions.assertEquals(1, TestUtil.iterableToList(referencedRepository.findAll()).size()); + } + ); + } +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/DeletionTestConfiguration.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/DeletionTestConfiguration.java new file mode 100644 index 00000000..0db7c903 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/DeletionTestConfiguration.java @@ -0,0 +1,28 @@ +/* + * 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.integration.isolated.tests.deletion; + +import org.springframework.context.annotation.Configuration; + +import software.xdev.spring.data.eclipse.store.integration.TestConfiguration; +import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories; + + +@Configuration +@EnableEclipseStoreRepositories(clientConfigurationClass = DeletionTestConfiguration.class) +public class DeletionTestConfiguration extends TestConfiguration +{ +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencedDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencedDaoObject.java new file mode 100644 index 00000000..94577218 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencedDaoObject.java @@ -0,0 +1,36 @@ +/* + * 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.integration.isolated.tests.deletion; + +public class ReferencedDaoObject +{ + private String value; + + public ReferencedDaoObject(final String value) + { + this.value = value; + } + + public String getValue() + { + return this.value; + } + + public void setValue(final String value) + { + this.value = value; + } +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencedRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencedRepository.java new file mode 100644 index 00000000..7cc76772 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencedRepository.java @@ -0,0 +1,23 @@ +/* + * 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.integration.isolated.tests.deletion; + +import org.springframework.data.repository.CrudRepository; + + +public interface ReferencedRepository extends CrudRepository +{ +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencingDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencingDaoObject.java new file mode 100644 index 00000000..15d4cf5a --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencingDaoObject.java @@ -0,0 +1,36 @@ +/* + * 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.integration.isolated.tests.deletion; + +public class ReferencingDaoObject +{ + private ReferencedDaoObject value; + + public ReferencingDaoObject(final ReferencedDaoObject value) + { + this.value = value; + } + + public ReferencedDaoObject getValue() + { + return this.value; + } + + public void setValue(final ReferencedDaoObject value) + { + this.value = value; + } +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencingRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencingRepository.java new file mode 100644 index 00000000..f89a1885 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencingRepository.java @@ -0,0 +1,23 @@ +/* + * 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.integration.isolated.tests.deletion; + +import org.springframework.data.repository.CrudRepository; + + +public interface ReferencingRepository extends CrudRepository +{ +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/KeywordsTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/KeywordsTest.java index 348d8980..e4e09179 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/KeywordsTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/KeywordsTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/KeywordsTestConfiguration.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/KeywordsTestConfiguration.java index 241d778d..6c3d3a65 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/KeywordsTestConfiguration.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/KeywordsTestConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/MinimalDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/MinimalDaoObject.java index f306c867..c7c52c70 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/MinimalDaoObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/MinimalDaoObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/MinimalRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/MinimalRepository.java index c1db0a3f..534c042b 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/MinimalRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/keywords/MinimalRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ComplexLazyObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ComplexLazyObject.java new file mode 100644 index 00000000..02413a96 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ComplexLazyObject.java @@ -0,0 +1,55 @@ +/* + * 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.integration.isolated.tests.lazy; + +import java.util.List; + +import org.eclipse.serializer.reference.Lazy; + + +public class ComplexLazyObject +{ + private Lazy simpleObject; + private List>> listOfLazyListOfString; + + public ComplexLazyObject( + final Lazy simpleObject, + final List>> listOfLazyListOfString) + { + this.simpleObject = simpleObject; + this.listOfLazyListOfString = listOfLazyListOfString; + } + + public Lazy getSimpleObject() + { + return this.simpleObject; + } + + public void setSimpleObject(final Lazy simpleObject) + { + this.simpleObject = simpleObject; + } + + public List>> getListOfLazyListOfString() + { + return this.listOfLazyListOfString; + } + + public void setListOfLazyListOfString(final List>> listOfLazyListOfString) + { + this.listOfLazyListOfString = listOfLazyListOfString; + } +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/LazyTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/LazyTest.java new file mode 100644 index 00000000..a9b5c3ff --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/LazyTest.java @@ -0,0 +1,437 @@ +/* + * 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.integration.isolated.tests.lazy; + +import static software.xdev.spring.data.eclipse.store.helper.TestUtil.restartDatastore; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.eclipse.serializer.collections.lazy.LazyArrayList; +import org.eclipse.serializer.collections.lazy.LazyList; +import org.eclipse.serializer.reference.Lazy; +import org.eclipse.serializer.reference.LazyReferenceManager; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; + +import software.xdev.spring.data.eclipse.store.helper.TestData; +import software.xdev.spring.data.eclipse.store.helper.TestUtil; +import software.xdev.spring.data.eclipse.store.integration.isolated.IsolatedTestAnnotations; +import software.xdev.spring.data.eclipse.store.repository.lazy.SpringDataEclipseStoreLazy; + + +@IsolatedTestAnnotations +@ContextConfiguration(classes = {LazyTestConfiguration.class}) +class LazyTest +{ + @Autowired + private LazyTestConfiguration configuration; + + @Test + @Disabled("This should work at some point. At least a warning should be displayed.") + void lazyListStore(@Autowired final ObjectWithLazyListRepository repository) + { + final ObjectWithLazyList newList = new ObjectWithLazyList(); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); + final LazyArrayList lazyArrayList = new LazyArrayList<>(); + lazyArrayList.add(objectToStore); + newList.setLazyList(lazyArrayList); + repository.save(newList); + + TestUtil.doBeforeAndAfterRestartOfDatastore( + this.configuration, + () -> { + Assertions.assertEquals(1, repository.findAll().size()); + final LazyList loadedLazyList = repository.findAll().get(0).getLazyList(); + Assertions.assertEquals(1, loadedLazyList.size()); + Assertions.assertEquals(objectToStore, loadedLazyList.get(0)); + } + ); + } + + @Test + void lazyStore(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + repository.save(newLazy); + + TestUtil.doBeforeAndAfterRestartOfDatastore( + this.configuration, + () -> { + Assertions.assertEquals(1, repository.findAll().size()); + final Lazy lazy = repository.findAll().get(0).getLazy(); + Assertions.assertEquals(objectToStore, lazy.get()); + } + ); + } + + @Test + void lazyGetsCleared(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + repository.save(newLazy); + + restartDatastore(this.configuration); + + final List> loadedObjects = repository.findAll(); + Assertions.assertEquals(1, loadedObjects.size()); + Assertions.assertFalse(loadedObjects.get(0).getLazy().isLoaded()); + Assertions.assertNotNull(loadedObjects.get(0).getLazy().get()); + Assertions.assertTrue(loadedObjects.get(0).getLazy().isLoaded()); + + LazyReferenceManager.get().clear(); + Assertions.assertFalse(repository.findAll().get(0).getLazy().isLoaded()); + } + + @Test + void lazyWorkingCopyIsCreated(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + repository.save(newLazy); + + TestUtil.doBeforeAndAfterRestartOfDatastore( + this.configuration, + () -> { + final SimpleObject storedObject = newLazy.getLazy().get(); + final SimpleObject loadedObject = repository.findAll().get(0).getLazy().get(); + Assertions.assertNotSame(storedObject, loadedObject); + Assertions.assertEquals(storedObject, loadedObject); + } + ); + } + + @Test + void lazyDifferentWorkingCopiesAreCreated(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + repository.save(newLazy); + + TestUtil.doBeforeAndAfterRestartOfDatastore( + this.configuration, + () -> { + final ObjectWithLazy workingCopy1 = repository.findAll().get(0); + final ObjectWithLazy workingCopy2 = repository.findAll().get(0); + Assertions.assertNotSame(workingCopy1.getLazy(), workingCopy2.getLazy()); + Assertions.assertNotSame(workingCopy1.getLazy().get(), workingCopy2.getLazy().get()); + Assertions.assertEquals(workingCopy1.getLazy().get(), workingCopy2.getLazy().get()); + } + ); + } + + @Test + void lazyWorkingCopyChange(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + repository.save(newLazy); + + final SimpleObject changedObjectToStore = new SimpleObject(TestData.DUMMY_STRING_ALTERNATIVE); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(changedObjectToStore)); + + TestUtil.doBeforeAndAfterRestartOfDatastore( + this.configuration, + () -> { + Assertions.assertNotEquals(newLazy.getLazy().get(), repository.findAll().get(0).getLazy().get()); + } + ); + } + + @Test + void lazyWorkingCopyChangeAfterRestart(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + repository.save(newLazy); + + restartDatastore(this.configuration); + + final SimpleObject changedObjectToStore = new SimpleObject(TestData.DUMMY_STRING_ALTERNATIVE); + final ObjectWithLazy objectToChange = repository.findAll().get(0); + objectToChange.setLazy(SpringDataEclipseStoreLazy.build(changedObjectToStore)); + + Assertions.assertNotEquals(objectToChange.getLazy().get(), repository.findAll().get(0).getLazy().get()); + + repository.save(objectToChange); + + final ObjectWithLazy workingCopy1 = repository.findAll().get(0); + final ObjectWithLazy workingCopy2 = repository.findAll().get(0); + Assertions.assertEquals(workingCopy1.getLazy().get(), workingCopy2.getLazy().get()); + } + + @Test + void lazyStoreComplexObject(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final ComplexLazyObject objectToStore = new ComplexLazyObject( + SpringDataEclipseStoreLazy.build(new SimpleObject(TestData.DUMMY_STRING)), + new ArrayList<>(Arrays.asList( + SpringDataEclipseStoreLazy.build(new ArrayList<>(Arrays.asList(TestData.DUMMY_STRING))), + SpringDataEclipseStoreLazy.build(new ArrayList<>(Arrays.asList(TestData.DUMMY_STRING_ALTERNATIVE))) + )) + ); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + repository.save(newLazy); + + TestUtil.doBeforeAndAfterRestartOfDatastore( + this.configuration, + () -> { + Assertions.assertEquals(1, repository.findAll().size()); + final Lazy lazy = repository.findAll().get(0).getLazy(); + Assertions.assertNotNull(lazy.get()); + Assertions.assertEquals(objectToStore.getSimpleObject().get(), lazy.get().getSimpleObject().get()); + Assertions.assertEquals( + objectToStore.getListOfLazyListOfString().size(), + lazy.get().getListOfLazyListOfString().size()); + Assertions.assertEquals( + objectToStore.getListOfLazyListOfString().get(0).get(), + lazy.get().getListOfLazyListOfString().get(0).get()); + Assertions.assertEquals( + objectToStore.getListOfLazyListOfString().get(1).get(), + lazy.get().getListOfLazyListOfString().get(1).get()); + } + ); + } + + @Test + void lazyChangeComplexObject(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final ComplexLazyObject objectToStore = new ComplexLazyObject( + SpringDataEclipseStoreLazy.build(new SimpleObject(TestData.DUMMY_STRING)), + new ArrayList<>(Arrays.asList( + SpringDataEclipseStoreLazy.build(new ArrayList<>(Arrays.asList(TestData.DUMMY_STRING))), + SpringDataEclipseStoreLazy.build(new ArrayList<>(Arrays.asList(TestData.DUMMY_STRING_ALTERNATIVE))) + )) + ); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + repository.save(newLazy); + + restartDatastore(this.configuration); + + final ObjectWithLazy loadedObjectToChange = repository.findAll().get(0); + loadedObjectToChange + .getLazy() + .get() + .getListOfLazyListOfString() + .add(SpringDataEclipseStoreLazy.build(List.of(TestData.DUMMY_STRING_ALTERNATIVE))); + repository.save(loadedObjectToChange); + + TestUtil.doBeforeAndAfterRestartOfDatastore( + this.configuration, + () -> { + final ObjectWithLazy loadedObject = repository.findAll().get(0); + Assertions.assertNotSame(loadedObjectToChange, loadedObject); + Assertions.assertNotSame( + loadedObjectToChange.getLazy().get(), + loadedObject.getLazy().get() + ); + Assertions.assertEquals( + loadedObjectToChange.getLazy().get().getListOfLazyListOfString().size(), + loadedObject.getLazy().get().getListOfLazyListOfString().size() + ); + Assertions.assertEquals( + loadedObjectToChange.getLazy().get().getListOfLazyListOfString().get(0).get().size(), + loadedObject.getLazy().get().getListOfLazyListOfString().get(0).get().size() + ); + Assertions.assertEquals( + loadedObjectToChange.getLazy().get().getListOfLazyListOfString().get(0).get().get(0), + loadedObject.getLazy().get().getListOfLazyListOfString().get(0).get().get(0) + ); + } + ); + } + + @Test + void lazyReloadAndRestoreComplexObject(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final ComplexLazyObject objectToStore = new ComplexLazyObject( + SpringDataEclipseStoreLazy.build(new SimpleObject(TestData.DUMMY_STRING)), + new ArrayList<>(Arrays.asList( + SpringDataEclipseStoreLazy.build(new ArrayList<>(Arrays.asList(TestData.DUMMY_STRING))), + SpringDataEclipseStoreLazy.build(new ArrayList<>(Arrays.asList(TestData.DUMMY_STRING_ALTERNATIVE))) + )) + ); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + repository.save(newLazy); + + restartDatastore(this.configuration); + + final ObjectWithLazy loadedObjectToChange = repository.findAll().get(0); + repository.save(loadedObjectToChange); + + TestUtil.doBeforeAndAfterRestartOfDatastore( + this.configuration, + () -> { + final ObjectWithLazy loadedObject = repository.findAll().get(0); + Assertions.assertNotSame(loadedObjectToChange, loadedObject); + Assertions.assertNotSame( + loadedObjectToChange.getLazy().get(), + loadedObject.getLazy().get() + ); + Assertions.assertEquals( + loadedObjectToChange.getLazy().get().getListOfLazyListOfString().size(), + loadedObject.getLazy().get().getListOfLazyListOfString().size() + ); + Assertions.assertEquals( + loadedObjectToChange.getLazy().get().getListOfLazyListOfString().get(0).get().size(), + loadedObject.getLazy().get().getListOfLazyListOfString().get(0).get().size() + ); + Assertions.assertEquals( + loadedObjectToChange.getLazy().get().getListOfLazyListOfString().get(0).get().get(0), + loadedObject.getLazy().get().getListOfLazyListOfString().get(0).get().get(0) + ); + } + ); + } + + @Test + void lazyClearBeforeSave() + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + final Lazy lazy = newLazy.getLazy(); + Assertions.assertThrows(IllegalStateException.class, () -> lazy.clear()); + } + + @Test + @Disabled("This should work at some point. At least a warning should be displayed.") + void lazyUseEclipseStoreLazy(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); + newLazy.setLazy(Lazy.Reference(objectToStore)); + Assertions.assertThrows(Exception.class, () -> repository.save(newLazy)); + } + + @Test + void lazyClearAfterSave(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + repository.save(newLazy); + newLazy.getLazy().clear(); + + TestUtil.doBeforeAndAfterRestartOfDatastore( + this.configuration, + () -> { + Assertions.assertEquals(1, repository.findAll().size()); + final Lazy lazy = repository.findAll().get(0).getLazy(); + Assertions.assertEquals(objectToStore, lazy.get()); + } + ); + } + + @Test + void lazyClearAfterRestart(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + repository.save(newLazy); + + restartDatastore(this.configuration); + + Assertions.assertDoesNotThrow(() -> newLazy.getLazy().clear()); + } + + @Test + void lazyChangeAfterSave(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + repository.save(newLazy); + + final SimpleObject objectToStore2 = new SimpleObject(TestData.DUMMY_STRING_ALTERNATIVE); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore2)); + repository.save(newLazy); + + TestUtil.doBeforeAndAfterRestartOfDatastore( + this.configuration, + () -> { + Assertions.assertEquals(1, repository.findAll().size()); + final Lazy lazy = repository.findAll().get(0).getLazy(); + Assertions.assertEquals(objectToStore2, lazy.get()); + } + ); + } + + @Test + void lazyChangeBeforeSave(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + + final SimpleObject objectToStore2 = new SimpleObject(TestData.DUMMY_STRING_ALTERNATIVE); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore2)); + repository.save(newLazy); + + TestUtil.doBeforeAndAfterRestartOfDatastore( + this.configuration, + () -> { + Assertions.assertEquals(1, repository.findAll().size()); + final Lazy lazy = repository.findAll().get(0).getLazy(); + Assertions.assertEquals(objectToStore2, lazy.get()); + } + ); + } + + @Test + void lazyChangeAfterRestart(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + repository.save(newLazy); + + restartDatastore(this.configuration); + + Assertions.assertEquals(1, repository.findAll().size()); + final ObjectWithLazy reloadedObjectWithLazy = repository.findAll().get(0); + Assertions.assertEquals(objectToStore, reloadedObjectWithLazy.getLazy().get()); + + final SimpleObject objectToStore2 = new SimpleObject(TestData.DUMMY_STRING_ALTERNATIVE); + reloadedObjectWithLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore2)); + repository.save(reloadedObjectWithLazy); + + TestUtil.doBeforeAndAfterRestartOfDatastore( + this.configuration, + () -> { + Assertions.assertEquals(1, repository.findAll().size()); + final Lazy lazy = repository.findAll().get(0).getLazy(); + Assertions.assertEquals(objectToStore2, lazy.get()); + } + ); + } +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/LazyTestConfiguration.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/LazyTestConfiguration.java new file mode 100644 index 00000000..75dcafa4 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/LazyTestConfiguration.java @@ -0,0 +1,28 @@ +/* + * 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.integration.isolated.tests.lazy; + +import org.springframework.context.annotation.Configuration; + +import software.xdev.spring.data.eclipse.store.integration.TestConfiguration; +import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories; + + +@Configuration +@EnableEclipseStoreRepositories(clientConfigurationClass = LazyTestConfiguration.class) +public class LazyTestConfiguration extends TestConfiguration +{ +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazy.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazy.java new file mode 100644 index 00000000..f670d298 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazy.java @@ -0,0 +1,34 @@ +/* + * 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.integration.isolated.tests.lazy; + +import org.eclipse.serializer.reference.Lazy; + + +public class ObjectWithLazy +{ + private Lazy lazy; + + public Lazy getLazy() + { + return this.lazy; + } + + public void setLazy(final Lazy lazy) + { + this.lazy = lazy; + } +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashMap.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashMap.java new file mode 100644 index 00000000..10b2f430 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashMap.java @@ -0,0 +1,34 @@ +/* + * 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.integration.isolated.tests.lazy; + +import org.eclipse.serializer.collections.lazy.LazyHashMap; + + +public class ObjectWithLazyHashMap +{ + private LazyHashMap lazyHashMap; + + public LazyHashMap getLazyHashMap() + { + return this.lazyHashMap; + } + + public void setLazyHashMap(final LazyHashMap lazyHashMap) + { + this.lazyHashMap = lazyHashMap; + } +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashMapRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashMapRepository.java new file mode 100644 index 00000000..3a4f8857 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashMapRepository.java @@ -0,0 +1,23 @@ +/* + * 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.integration.isolated.tests.lazy; + +import org.springframework.data.repository.ListCrudRepository; + + +public interface ObjectWithLazyHashMapRepository extends ListCrudRepository +{ +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashSet.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashSet.java new file mode 100644 index 00000000..2f8b0cd4 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashSet.java @@ -0,0 +1,34 @@ +/* + * 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.integration.isolated.tests.lazy; + +import org.eclipse.serializer.collections.lazy.LazyHashSet; + + +public class ObjectWithLazyHashSet +{ + private LazyHashSet lazyHashSet; + + public LazyHashSet getLazyHashSet() + { + return this.lazyHashSet; + } + + public void setLazyHashSet(final LazyHashSet lazyHashSet) + { + this.lazyHashSet = lazyHashSet; + } +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashSetRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashSetRepository.java new file mode 100644 index 00000000..070ff4b8 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashSetRepository.java @@ -0,0 +1,23 @@ +/* + * 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.integration.isolated.tests.lazy; + +import org.springframework.data.repository.ListCrudRepository; + + +public interface ObjectWithLazyHashSetRepository extends ListCrudRepository +{ +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyList.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyList.java new file mode 100644 index 00000000..e15783c0 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyList.java @@ -0,0 +1,34 @@ +/* + * 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.integration.isolated.tests.lazy; + +import org.eclipse.serializer.collections.lazy.LazyList; + + +public class ObjectWithLazyList +{ + private LazyList lazyList; + + public LazyList getLazyList() + { + return this.lazyList; + } + + public void setLazyList(final LazyList lazyList) + { + this.lazyList = lazyList; + } +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyListRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyListRepository.java new file mode 100644 index 00000000..773e1d0d --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyListRepository.java @@ -0,0 +1,23 @@ +/* + * 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.integration.isolated.tests.lazy; + +import org.springframework.data.repository.ListCrudRepository; + + +public interface ObjectWithLazyListRepository extends ListCrudRepository +{ +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyRepository.java new file mode 100644 index 00000000..a0e4164f --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyRepository.java @@ -0,0 +1,23 @@ +/* + * 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.integration.isolated.tests.lazy; + +import org.springframework.data.repository.ListCrudRepository; + + +public interface ObjectWithLazyRepository extends ListCrudRepository, Integer> +{ +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazySimpleObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazySimpleObject.java new file mode 100644 index 00000000..75dbfb07 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazySimpleObject.java @@ -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.integration.isolated.tests.lazy; + +public class ObjectWithLazySimpleObject +{ + private SimpleObject lazySimpleObject; + + public SimpleObject getLazySimpleObject() + { + return this.lazySimpleObject; + } + + public void setLazySimpleObject(final SimpleObject lazySimpleObject) + { + this.lazySimpleObject = lazySimpleObject; + } +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazySimpleObjectRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazySimpleObjectRepository.java new file mode 100644 index 00000000..4bd550a6 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazySimpleObjectRepository.java @@ -0,0 +1,23 @@ +/* + * 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.integration.isolated.tests.lazy; + +import org.springframework.data.repository.ListCrudRepository; + + +public interface ObjectWithLazySimpleObjectRepository extends ListCrudRepository +{ +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/SimpleObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/SimpleObject.java new file mode 100644 index 00000000..f09879e4 --- /dev/null +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/SimpleObject.java @@ -0,0 +1,20 @@ +/* + * 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.integration.isolated.tests.lazy; + +public record SimpleObject(String value) +{ +} diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigDecimalDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigDecimalDaoObject.java index 52c42c58..bbb331d6 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigDecimalDaoObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigDecimalDaoObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigDecimalRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigDecimalRepository.java index f56eb4a8..44451dde 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigDecimalRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigDecimalRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigIntegerDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigIntegerDaoObject.java index 90dc44f1..5dba8163 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigIntegerDaoObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigIntegerDaoObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigIntegerRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigIntegerRepository.java index 74a8d364..7dcc0f5e 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigIntegerRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/BigIntegerRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/CalendarDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/CalendarDaoObject.java index 3b835475..df30ccbc 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/CalendarDaoObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/CalendarDaoObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/CalendarRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/CalendarRepository.java index 187d33fb..85451deb 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/CalendarRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/CalendarRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/ComplexObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/ComplexObject.java index 5561bb6c..6c5b61ab 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/ComplexObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/ComplexObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/DateDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/DateDaoObject.java index f93dfa12..6a3b066f 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/DateDaoObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/DateDaoObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/DateRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/DateRepository.java index f967c16f..b25a000d 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/DateRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/DateRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumMapDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumMapDaoObject.java index cd81c07c..dfd07ec3 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumMapDaoObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumMapDaoObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumMapRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumMapRepository.java index 4f49be48..77f5ce6e 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumMapRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumMapRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumSetDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumSetDaoObject.java index 31acf389..01738257 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumSetDaoObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumSetDaoObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumSetRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumSetRepository.java index f2f186b8..aea2509a 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumSetRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/EnumSetRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LazyDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LazyDaoObject.java index 41221a67..a58bf983 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LazyDaoObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LazyDaoObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -15,6 +15,8 @@ */ package software.xdev.spring.data.eclipse.store.integration.isolated.tests.special.types; +import java.util.Objects; + import org.eclipse.serializer.reference.Lazy; @@ -24,4 +26,29 @@ public LazyDaoObject(final Integer id, final Lazy value) { super(id, value); } + + @Override + public int hashCode() + { + return super.hashCode(); + } + + @Override + public boolean equals(final Object o) + { + if(this == o) + { + return true; + } + if(o == null || this.getClass() != o.getClass()) + { + return false; + } + final ComplexObject> that = (ComplexObject>)o; + return Objects.equals(this.getId(), that.getId()) + && (this.getValue() == null && that.getValue() == null) + || Objects.equals( + this.getValue().get(), + that.getValue().get()); + } } diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LazyRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LazyRepository.java index a3cd5e37..812806ee 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LazyRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LazyRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/ListDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/ListDaoObject.java index f4cb80e7..8d6b1154 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/ListDaoObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/ListDaoObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/ListRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/ListRepository.java index b0351524..3aad2865 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/ListRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/ListRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateDaoObject.java index bf6cf781..c232caa1 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateDaoObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateDaoObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateRepository.java index 0aa50229..a44c110d 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateTimeDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateTimeDaoObject.java index 169ea937..6a4e5ac9 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateTimeDaoObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateTimeDaoObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateTimeRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateTimeRepository.java index 737c6ebf..c5d83582 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateTimeRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalDateTimeRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalTimeDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalTimeDaoObject.java index 953aeab5..6ae4c6b1 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalTimeDaoObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalTimeDaoObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalTimeRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalTimeRepository.java index db1cac67..046295b0 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalTimeRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/LocalTimeRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/MapDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/MapDaoObject.java index 372ec6b3..fc466f74 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/MapDaoObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/MapDaoObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/MapRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/MapRepository.java index ebbb1d18..4e9e790d 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/MapRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/MapRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/OptionalDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/OptionalDaoObject.java index 228abedc..6a50a276 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/OptionalDaoObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/OptionalDaoObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/OptionalRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/OptionalRepository.java index 7868afc6..be0456d0 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/OptionalRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/OptionalRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/SetDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/SetDaoObject.java index be214b09..07dcf5dc 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/SetDaoObject.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/SetDaoObject.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/SetRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/SetRepository.java index e3ed468b..c75f089f 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/SetRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/SetRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/SpecialTypesTestConfiguration.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/SpecialTypesTestConfiguration.java index 1dfe164e..54a8bc9a 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/SpecialTypesTestConfiguration.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/SpecialTypesTestConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/TypesData.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/TypesData.java index 4429ddb6..0062d6de 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/TypesData.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/TypesData.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -44,14 +44,21 @@ import java.util.function.Function; import java.util.stream.Stream; -import org.eclipse.serializer.reference.Lazy; +import org.eclipse.serializer.collections.lazy.LazyArrayList; +import org.eclipse.serializer.collections.lazy.LazyHashMap; +import org.eclipse.serializer.collections.lazy.LazyHashSet; import org.junit.jupiter.params.provider.Arguments; import software.xdev.spring.data.eclipse.store.repository.interfaces.EclipseStoreRepository; +import software.xdev.spring.data.eclipse.store.repository.lazy.SpringDataEclipseStoreLazy; final class TypesData { + private TypesData() + { + } + public record ListOfTestArguments(List> testArguments) { public Stream toArguments() @@ -378,6 +385,11 @@ public static Stream generateData() OptionalRepository.class, id -> new OptionalDaoObject(id, null), set -> set.setValue(Optional.of("1")) + ), + new TestArguments<>( + LazyRepository.class, + id -> new LazyDaoObject(id, SpringDataEclipseStoreLazy.build("1")), + object -> object.setValue(SpringDataEclipseStoreLazy.build("2")) ) ) ).toArguments(); @@ -392,16 +404,6 @@ public static Stream generateNotWorkingData() { return new ListOfTestArguments( List.of( - new TestArguments<>( - LazyRepository.class, - id -> new LazyDaoObject(id, Lazy.Reference("1")), - object -> object.setValue(Lazy.Reference("2")) - ), - new TestArguments<>( - LazyRepository.class, - id -> new LazyDaoObject(id, Lazy.Reference("1")), - object -> object.getValue().clear() - ), new TestArguments<>( EnumMapRepository.class, id -> new EnumMapDaoObject(id, new EnumMap<>(EnumMapDaoObject.Album.class)), @@ -436,6 +438,82 @@ public static Stream generateNotWorkingData() CalendarRepository.class, id -> new CalendarDaoObject(id, Calendar.getInstance()), object -> object.getValue().add(Calendar.DAY_OF_MONTH, 1) + ), + new TestArguments<>( + MapRepository.class, + id -> { + final LazyHashMap lazyHashMap = new LazyHashMap<>(); + lazyHashMap.put("1", "1"); + return new MapDaoObject(id, lazyHashMap); + }, + set -> set.getValue().put("2", "2") + ), + new TestArguments<>( + MapRepository.class, + id -> { + final LazyHashMap lazyHashMap = new LazyHashMap<>(); + lazyHashMap.put("1", "1"); + lazyHashMap.put("2", "2"); + return new MapDaoObject(id, lazyHashMap); + }, + set -> set.getValue().put("3", "3") + ), + new TestArguments<>( + SetRepository.class, + id -> new SetDaoObject(id, new LazyHashSet<>()), + set -> set.getValue().add("1") + ), + new TestArguments<>( + SetRepository.class, + id -> + { + final LazyHashSet set = new LazyHashSet<>(); + set.add("1"); + return new SetDaoObject(id, set); + }, + set -> set.getValue().add("2") + ), + new TestArguments<>( + SetRepository.class, + id -> + { + final LazyHashSet set = new LazyHashSet<>(); + set.add("1"); + set.add("2"); + return new SetDaoObject(id, set); + }, + set -> set.getValue().add("3") + ), + new TestArguments<>( + ListRepository.class, + id -> new ListDaoObject(id, new LazyArrayList<>()), + object -> object.getValue().add("1") + ), + new TestArguments<>( + ListRepository.class, + id -> + { + final LazyArrayList list = new LazyArrayList<>(); + list.add("1"); + return new ListDaoObject(id, list); + }, + object -> object.getValue().add("2") + ), + new TestArguments<>( + ListRepository.class, + id -> + { + final LazyArrayList list = new LazyArrayList<>(); + list.add("1"); + list.add("2"); + return new ListDaoObject(id, list); + }, + object -> object.getValue().add("3") + ), + new TestArguments<>( + MapRepository.class, + id -> new MapDaoObject(id, new LazyHashMap<>()), + set -> set.getValue().put("1", "1") ) ) ).toArguments(); diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/TypesTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/TypesTest.java index d7278d7a..2cc4ac96 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/TypesTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/TypesTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/DefaultTestAnnotations.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/DefaultTestAnnotations.java index 41a134d6..84295620 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/DefaultTestAnnotations.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/DefaultTestAnnotations.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/SharedTestConfiguration.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/SharedTestConfiguration.java index d4b6a582..565c2270 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/SharedTestConfiguration.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/SharedTestConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/package-info.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/package-info.java index 77b2d9f2..0c47ebef 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/package-info.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Child.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Child.java index 549da2db..64521977 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Child.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Child.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ChildCustomer.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ChildCustomer.java index a243bdfe..136fb6b1 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ChildCustomer.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ChildCustomer.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ChildCustomerRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ChildCustomerRepository.java index 08622099..a45bed32 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ChildCustomerRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ChildCustomerRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Customer.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Customer.java index 2ef2e24d..767ef6d9 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Customer.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Customer.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerAsRecord.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerAsRecord.java index 9c9df6c7..ab242afa 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerAsRecord.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerAsRecord.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerAsRecordRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerAsRecordRepository.java index a28803fa..8119fc23 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerAsRecordRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerAsRecordRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerNotCrud.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerNotCrud.java index fe960ddd..00835cdc 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerNotCrud.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerNotCrud.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerNotCrudRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerNotCrudRepository.java index df0ff39e..29e21eb9 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerNotCrudRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerNotCrudRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepository.java index 7c90c670..ec3c5fa2 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepositoryWithHashSet.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepositoryWithHashSet.java index cf53de00..8e51bc5f 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepositoryWithHashSet.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepositoryWithHashSet.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepositoryWithNonFinalHashSet.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepositoryWithNonFinalHashSet.java index e459843e..8cae4400 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepositoryWithNonFinalHashSet.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepositoryWithNonFinalHashSet.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepositoryWithQuery.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepositoryWithQuery.java index f845fed8..86d5b1d2 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepositoryWithQuery.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerRepositoryWithQuery.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithChild.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithChild.java index 272318d8..07f1ca9d 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithChild.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithChild.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithChildRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithChildRepository.java index e74bc81b..25e6e98d 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithChildRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithChildRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithHashSet.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithHashSet.java index b46e5b72..f5e6158f 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithHashSet.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithHashSet.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithNonFinalHashSet.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithNonFinalHashSet.java index 45009fd3..24cc8632 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithNonFinalHashSet.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithNonFinalHashSet.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithQuery.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithQuery.java index 43d6d234..b917f505 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithQuery.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/CustomerWithQuery.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Node.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Node.java index 27764c50..44a933d2 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Node.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Node.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/NodeRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/NodeRepository.java index efa0d716..43b0739f 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/NodeRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/NodeRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Owner.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Owner.java index 896ed6a2..43ac8d71 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Owner.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/Owner.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/OwnerRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/OwnerRepository.java index ce29f850..72a47207 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/OwnerRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/OwnerRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ParentCustomer.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ParentCustomer.java index 2256d706..bda9afb6 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ParentCustomer.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ParentCustomer.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ParentCustomerRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ParentCustomerRepository.java index 29057f43..0758223a 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ParentCustomerRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/ParentCustomerRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/SubCustomer.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/SubCustomer.java index e72316ff..ccb5b68a 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/SubCustomer.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/SubCustomer.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/SubCustomerRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/SubCustomerRepository.java index 321323a2..39188d6e 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/SubCustomerRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/SubCustomerRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdInt.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdInt.java index 4b4f4562..30a8c9ca 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdInt.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdInt.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntRepository.java index 888a123d..8e32578d 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdInteger.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdInteger.java index b0a9e1e8..81cd2f1f 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdInteger.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdInteger.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntegerNoAutoGenerate.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntegerNoAutoGenerate.java index 7618633b..c3540763 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntegerNoAutoGenerate.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntegerNoAutoGenerate.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntegerNoAutoGenerateRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntegerNoAutoGenerateRepository.java index 7ddc6171..55c15fe0 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntegerNoAutoGenerateRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntegerNoAutoGenerateRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntegerRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntegerRepository.java index f6de36f0..8846c83a 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntegerRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdIntegerRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdLong.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdLong.java index 49d3f384..1fa239b0 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdLong.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdLong.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdLongRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdLongRepository.java index e86acdcc..d70b9b76 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdLongRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdLongRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdString.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdString.java index eaa32ad8..4ff3e317 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdString.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdString.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdStringRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdStringRepository.java index c40f899e..7efb2535 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdStringRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithIdStringRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithPurchase.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithPurchase.java index c37d67c5..d55f7503 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithPurchase.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithPurchase.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithPurchaseRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithPurchaseRepository.java index 2f986e3a..9bc5eae8 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithPurchaseRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/CustomerWithPurchaseRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/Purchase.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/Purchase.java index 52de0753..2a3af61e 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/Purchase.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/id/Purchase.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinal.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinal.java index d0ddd64d..404bf5d9 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinal.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinal.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalChild.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalChild.java index 1bde2eae..359c8033 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalChild.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalChild.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalChildRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalChildRepository.java index 22e9d951..59061f54 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalChildRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalChildRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalId.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalId.java index c10b2d74..4655a388 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalId.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalId.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalIdRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalIdRepository.java index ebb4df9e..83957816 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalIdRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalIdRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalRepository.java index 519b3f95..2daf2ab1 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/immutables/CustomerWithFinalRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerCrud.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerCrud.java index 7d9778f7..d549f64e 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerCrud.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerCrud.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreCrudRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreCrudRepository.java index 64ff9274..5782778e 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreCrudRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreCrudRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreListCrudRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreListCrudRepository.java index 5fb57f8f..99fd8de1 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreListCrudRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreListCrudRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreListPagingAndSortingRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreListPagingAndSortingRepository.java index c0d0fb6d..575042ad 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreListPagingAndSortingRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreListPagingAndSortingRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStorePagingAndSortingRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStorePagingAndSortingRepository.java index 14b444c2..53710546 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStorePagingAndSortingRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStorePagingAndSortingRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreRepository.java index 0a476e5f..a86bc48a 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerEclipseStoreRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerListCrud.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerListCrud.java index fe5c0c02..fedb81fb 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerListCrud.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerListCrud.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerListPagingAndSorting.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerListPagingAndSorting.java index 89ef5b9f..e18ddffa 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerListPagingAndSorting.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerListPagingAndSorting.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerPagingAndSorting.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerPagingAndSorting.java index 4cf9b1c3..65837819 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerPagingAndSorting.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerPagingAndSorting.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerSimple.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerSimple.java index e5f8404b..23ff527d 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerSimple.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/interfaces/CustomerSimple.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Article.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Article.java index f67cc905..a9d5d997 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Article.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Article.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/ArticleGroup.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/ArticleGroup.java index d8378911..dc73ba6d 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/ArticleGroup.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/ArticleGroup.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Invoice.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Invoice.java index 498f7492..868061ee 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Invoice.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Invoice.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/InvoiceRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/InvoiceRepository.java index b86bd835..baa35843 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/InvoiceRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/InvoiceRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Position.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Position.java index 85f40363..b0894b12 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Position.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Position.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/PositionRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/PositionRepository.java index 3692bbc5..c8656c26 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/PositionRepository.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/PositionRepository.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Warehouse.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Warehouse.java index ce814b84..8d5b0663 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Warehouse.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/repositories/real/life/example/Warehouse.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/ChangeRootTests.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/ChangeRootTests.java index 055c6078..356f6c1a 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/ChangeRootTests.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/ChangeRootTests.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/ConcurrencyTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/ConcurrencyTest.java index 4e1ae8d8..81a7b087 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/ConcurrencyTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/ConcurrencyTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/FinalTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/FinalTest.java index 74e48fb3..00d99a0a 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/FinalTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/FinalTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/HashSetTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/HashSetTest.java index 29d451c0..62f494ee 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/HashSetTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/HashSetTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/IdTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/IdTest.java index 5833c0e4..cf6f91b9 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/IdTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/IdTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/InheritanceTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/InheritanceTest.java index 6cd03676..28da0952 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/InheritanceTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/InheritanceTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/JpaCompatibilityTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/JpaCompatibilityTest.java index ec626212..5a1a095f 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/JpaCompatibilityTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/JpaCompatibilityTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/QueryTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/QueryTest.java index 1bbd8778..bf6d24b1 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/QueryTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/QueryTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/RealLifeTests.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/RealLifeTests.java index bae2ea7c..026a3a05 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/RealLifeTests.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/RealLifeTests.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/SimpleMultipleTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/SimpleMultipleTest.java index 26855070..a9650158 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/SimpleMultipleTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/SimpleMultipleTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/SimpleSingleTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/SimpleSingleTest.java index 49a8c87e..4052eeef 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/SimpleSingleTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/SimpleSingleTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/SpecificInterfacesTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/SpecificInterfacesTest.java index 07126440..e428269a 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/SpecificInterfacesTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/SpecificInterfacesTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/StressTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/StressTest.java index 0916f46e..a7f59903 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/StressTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/StressTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/WorkingCopyTests.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/WorkingCopyTests.java index 41c5311d..84de03cb 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/WorkingCopyTests.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/shared/tests/WorkingCopyTests.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorAndOrTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorAndOrTest.java index 344496c4..99541199 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorAndOrTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorAndOrTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorBooleanTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorBooleanTest.java index a3e4164e..87047cf1 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorBooleanTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorBooleanTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorCollectionTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorCollectionTest.java index 107b90fc..9c791de5 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorCollectionTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorCollectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorGreaterLessTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorGreaterLessTest.java index 652c21fe..c21f14f9 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorGreaterLessTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorGreaterLessTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorIsIsNotTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorIsIsNotTest.java index 7b8ae212..7414f93c 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorIsIsNotTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorIsIsNotTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorStringTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorStringTest.java index f05f6589..5908e5d9 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorStringTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/EclipseStoreQueryCreatorStringTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/QueryCreatorUtil.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/QueryCreatorUtil.java index 4d365471..c7c283f4 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/QueryCreatorUtil.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/QueryCreatorUtil.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/executors/PageableSortableCollectionQuerierTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/executors/PageableSortableCollectionQuerierTest.java index 9e8d6ebb..b6798947 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/executors/PageableSortableCollectionQuerierTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/query/executors/PageableSortableCollectionQuerierTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/DataTypeUtilTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/DataTypeUtilTest.java index b1ec1493..4f997a50 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/DataTypeUtilTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/DataTypeUtilTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/object/EclipseStoreRegisteringCopierTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringStorageToWorkingCopyCopierTest.java similarity index 65% rename from spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/object/EclipseStoreRegisteringCopierTest.java rename to spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringStorageToWorkingCopyCopierTest.java index 51ad01bf..2c54b385 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/object/EclipseStoreRegisteringCopierTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringStorageToWorkingCopyCopierTest.java @@ -1,5 +1,5 @@ /* - * Copyright © 2023 XDEV Software (https://xdev.software) + * 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. @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package software.xdev.spring.data.eclipse.store.repository.support.copier.object; +package software.xdev.spring.data.eclipse.store.repository.support.copier.registering; import java.util.List; import java.util.stream.IntStream; @@ -21,11 +21,12 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import software.xdev.spring.data.eclipse.store.helper.DummyWorkingCopier; import software.xdev.spring.data.eclipse.store.repository.SupportedChecker; import software.xdev.spring.data.eclipse.store.repository.WorkingCopyRegistry; -class EclipseStoreRegisteringCopierTest +class RegisteringStorageToWorkingCopyCopierTest { private record DummyData(String data, int number) { @@ -34,8 +35,12 @@ private record DummyData(String data, int number) @Test void testCopyManyCopiesSingle() { - try(final EclipseSerializerRegisteringCopier copier = - new EclipseSerializerRegisteringCopier(new WorkingCopyRegistry(), new SupportedChecker.Implementation())) + try(final RegisteringStorageToWorkingCopyCopier copier = + new RegisteringStorageToWorkingCopyCopier( + new WorkingCopyRegistry(), + new SupportedChecker.Implementation(), + o -> null, + new DummyWorkingCopier())) { final List originalObjects = IntStream.range(0, 1_000).mapToObj( i -> new DummyData("Data" + i, i) @@ -50,8 +55,12 @@ void testCopyManyCopiesSingle() @Test void testCopyAgainSameObject() { - try(final EclipseSerializerRegisteringCopier copier = - new EclipseSerializerRegisteringCopier(new WorkingCopyRegistry(), new SupportedChecker.Implementation())) + try(final RegisteringStorageToWorkingCopyCopier copier = + new RegisteringStorageToWorkingCopyCopier( + new WorkingCopyRegistry(), + new SupportedChecker.Implementation(), + o -> null, + new DummyWorkingCopier())) { final DummyData originalObject = new DummyData("Test", 1); @@ -65,8 +74,12 @@ void testCopyAgainSameObject() @Test void testCopyAgainTheCopy() { - try(final EclipseSerializerRegisteringCopier copier = - new EclipseSerializerRegisteringCopier(new WorkingCopyRegistry(), new SupportedChecker.Implementation())) + try(final RegisteringStorageToWorkingCopyCopier copier = + new RegisteringStorageToWorkingCopyCopier( + new WorkingCopyRegistry(), + new SupportedChecker.Implementation(), + o -> null, + new DummyWorkingCopier())) { final DummyData originalObject = new DummyData("Test", 1); @@ -82,8 +95,12 @@ void testCopyAgainTheCopy() @Test void testCopyManyCopiesBulk() { - try(final EclipseSerializerRegisteringCopier copier = - new EclipseSerializerRegisteringCopier(new WorkingCopyRegistry(), new SupportedChecker.Implementation())) + try(final RegisteringStorageToWorkingCopyCopier copier = + new RegisteringStorageToWorkingCopyCopier( + new WorkingCopyRegistry(), + new SupportedChecker.Implementation(), + o -> null, + new DummyWorkingCopier())) { final List originalObjects = IntStream.range(0, 100_000).mapToObj( i -> new DummyData("Data" + i, i) @@ -98,8 +115,12 @@ void testCopyManyCopiesBulk() @Test void testCopyEmpty() { - try(final EclipseSerializerRegisteringCopier copier = - new EclipseSerializerRegisteringCopier(new WorkingCopyRegistry(), new SupportedChecker.Implementation())) + try(final RegisteringStorageToWorkingCopyCopier copier = + new RegisteringStorageToWorkingCopyCopier( + new WorkingCopyRegistry(), + new SupportedChecker.Implementation(), + o -> null, + new DummyWorkingCopier())) { Assertions.assertThrows(NullPointerException.class, () -> copier.copy(null)); }