From 89665190b27165933f796b57a2325a5efc0c1690 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Thu, 7 Mar 2024 14:14:03 +0100 Subject: [PATCH 01/18] Created test environment for lazy --- .../isolated/tests/lazy/LazyTest.java | 56 +++++++++++++++++++ .../tests/lazy/LazyTestConfiguration.java | 28 ++++++++++ .../tests/lazy/ObjectWithLazyHashMap.java | 34 +++++++++++ .../lazy/ObjectWithLazyHashMapRepository.java | 23 ++++++++ .../tests/lazy/ObjectWithLazyHashSet.java | 34 +++++++++++ .../lazy/ObjectWithLazyHashSetRepository.java | 23 ++++++++ .../tests/lazy/ObjectWithLazyList.java | 34 +++++++++++ .../lazy/ObjectWithLazyListRepository.java | 23 ++++++++ .../lazy/ObjectWithLazySimpleObject.java | 31 ++++++++++ .../ObjectWithLazySimpleObjectRepository.java | 23 ++++++++ .../isolated/tests/lazy/SimpleObject.java | 5 ++ 11 files changed, 314 insertions(+) create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/LazyTest.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/LazyTestConfiguration.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashMap.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashMapRepository.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashSet.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashSetRepository.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyList.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyListRepository.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazySimpleObject.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazySimpleObjectRepository.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/SimpleObject.java 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..ee4832e8 --- /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,56 @@ +/* + * Copyright © 2023 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.LazyArrayList; +import org.eclipse.serializer.collections.lazy.LazyList; +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; + + +@IsolatedTestAnnotations +@ContextConfiguration(classes = {LazyTestConfiguration.class}) +class LazyTest +{ + @Autowired + private LazyTestConfiguration configuration; + + @Test + void lazyListStore(final ObjectWithLazyListRepository repository) + { + final ObjectWithLazyList newList = new ObjectWithLazyList(); + final SimpleObject objectToStore = new SimpleObject("Test"); + 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().getFirst().getLazyList(); + Assertions.assertEquals(1, loadedLazyList.size()); + Assertions.assertEquals(objectToStore, loadedLazyList.getFirst()); + } + ); + } +} 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..625c98da --- /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 © 2023 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/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..3ea0d2fd --- /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 © 2023 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..7389aebb --- /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 © 2023 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..7a366f72 --- /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 © 2023 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..cffb92aa --- /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 © 2023 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..dc608f8e --- /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 © 2023 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..964f6117 --- /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 © 2023 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/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..3ae4c2b8 --- /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 © 2023 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..9d413d7f --- /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 © 2023 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..abbd79d3 --- /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,5 @@ +package software.xdev.spring.data.eclipse.store.integration.isolated.tests.lazy; + +public record SimpleObject(String value) +{ +} From f202ee21d0554a880a9163e27265aed65767d0f6 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Fri, 8 Mar 2024 14:51:17 +0100 Subject: [PATCH 02/18] Implemented Proxy creator for Lazies --- .../store/repository/SupportedChecker.java | 6 - .../repository/lazy/LazyInterceptor.java | 22 +++ .../repository/lazy/LazyProxyGenerator.java | 28 +++ .../lazy/SuperLazyBinaryHandler.java | 169 ++++++++++++++++++ .../support/copier/DataTypeUtil.java | 7 + .../copier/AbstractRegisteringCopier.java | 80 +++++++++ .../EclipseSerializerRegisteringCopier.java | 71 ++------ .../RegisteringObjectCopier.java | 9 +- ...RegisteringStorageToWorkingCopyCopier.java | 49 +++++ .../RegisteringWorkingCopyAndOriginal.java | 7 + ...RegisteringWorkingCopyToStorageCopier.java | 48 +++++ .../working/RecursiveWorkingCopier.java | 98 ++++++++-- .../integration/isolated/package-info.java | 15 ++ .../isolated/tests/lazy/LazyTest.java | 4 +- .../isolated/tests/lazy/SimpleObject.java | 15 ++ .../tests/special/types/LazyDaoObject.java | 19 ++ .../tests/special/types/TypesData.java | 99 ++++++++-- .../integration/shared/package-info.java | 15 ++ ...teringStorageToWorkingCopyCopierTest.java} | 34 ++-- 19 files changed, 683 insertions(+), 112 deletions(-) create mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyInterceptor.java create mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyProxyGenerator.java create mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SuperLazyBinaryHandler.java create mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java rename spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/{object => copier}/EclipseSerializerRegisteringCopier.java (66%) rename spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/{object => copier}/RegisteringObjectCopier.java (80%) create mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java create mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyAndOriginal.java create mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java rename spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/{object/EclipseStoreRegisteringCopierTest.java => copier/RegisteringStorageToWorkingCopyCopierTest.java} (72%) 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..832ad604 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 @@ -41,18 +41,12 @@ 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, diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyInterceptor.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyInterceptor.java new file mode 100644 index 00000000..9ab1a39e --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyInterceptor.java @@ -0,0 +1,22 @@ +package software.xdev.spring.data.eclipse.store.repository.lazy; + +import org.aopalliance.intercept.ConstructorInterceptor; +import org.aopalliance.intercept.ConstructorInvocation; +import org.eclipse.serializer.reference.Lazy; + + +public class LazyInterceptor implements ConstructorInterceptor +{ + private final Lazy originalLazy; + + public LazyInterceptor(final Lazy originalLazy) + { + this.originalLazy = originalLazy; + } + + @Override + public Lazy construct(final ConstructorInvocation invocation) + { + return Lazy.Reference(this.originalLazy.get()); + } +} diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyProxyGenerator.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyProxyGenerator.java new file mode 100644 index 00000000..b9d0b36b --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyProxyGenerator.java @@ -0,0 +1,28 @@ +package software.xdev.spring.data.eclipse.store.repository.lazy; + +import org.eclipse.serializer.reference.Lazy; +import org.springframework.aop.framework.ProxyFactory; + + +public final class LazyProxyGenerator +{ + private LazyProxyGenerator() + { + } + + public static , T> L generateLazyProxy(final L lazy, final Class clazz) + { + final ProxyFactory f = new ProxyFactory(clazz, new LazyInterceptor<>(lazy)); + return (L)f.getProxy(); + } + + public static Lazy generateLazyProxy(final Lazy lazy) + { + return generateLazyProxy(lazy, Lazy.class); + } + + public static Lazy.Default generateLazyDefaultProxy(final Lazy.Default lazy) + { + return generateLazyProxy(lazy, Lazy.Default.class); + } +} diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SuperLazyBinaryHandler.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SuperLazyBinaryHandler.java new file mode 100644 index 00000000..2577588c --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SuperLazyBinaryHandler.java @@ -0,0 +1,169 @@ +package software.xdev.spring.data.eclipse.store.repository.lazy; + +import java.lang.reflect.Constructor; + +import org.eclipse.serializer.persistence.binary.types.AbstractBinaryHandlerCustom; +import org.eclipse.serializer.persistence.binary.types.Binary; +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; + + +/** + * Copied from + * {@link org.eclipse.serializer.persistence.binary.org.eclipse.serializer.reference.BinaryHandlerLazyDefault}. + */ +public class SuperLazyBinaryHandler extends AbstractBinaryHandlerCustom> +{ + /////////////////////////////////////////////////////////////////////////// + // static methods // + /////////////////// + + public static SuperLazyBinaryHandler New() + { + return new SuperLazyBinaryHandler(); + } + + @SuppressWarnings("rawtypes") + static final Constructor CONSTRUCTOR = XReflect.setAccessible( + XReflect.getDeclaredConstructor(Lazy.Default.class, Object.class, long.class, ObjectSwizzling.class) + ); + + /////////////////////////////////////////////////////////////////////////// + // constructors // + ///////////////// + + private SuperLazyBinaryHandler() + { + super( + Lazy.Default.genericType(), + CustomFields( + CustomField(Object.class, "subject") + ) + ); + } + + /////////////////////////////////////////////////////////////////////////// + // methods // + //////////// + + @Override + public final void store( + final Binary data, + final Lazy.Default instance, + final long objectId, + final PersistenceStoreHandler handler + ) + { + /* (29.09.2015 TM)NOTE: There are several cases that have to be handled here correctly: + * + * 1) objectId == 0, referent == null + * "Empty" lazy reference that must be stored as such + * + * 2.) objectId == 0, referent != null + * Newly created lazy reference with a referent. The referent has to be handled and the lazy reference has + * to be stored with the referent's OID + * + * 3.) objectId != null, referent == null + * The lazy reference represents a non-null referent that is currently simply not loaded. The lazy reference + * must be stored nonetheless, pointing to its known referent objectId + * + * 4.) objectId != null, referent != null + * The lazy reference represents a non-null referent that is currently loaded. The refernt must be handled, + * the lazy reference must be stored, pointing to its known referent objectId. + */ + + final Object referent = instance.peek(); + final long referenceOid; + + if(referent == null) + { + referenceOid = instance.objectId(); + } + else + { + // OID validation or updating is done by linking logic + referenceOid = handler.apply(referent); + } + + // link to object supplier (internal logic can either update, discard or throw exception on mismatch) + // instance.$link(referenceOid, handler.getObjectRetriever()); + + // lazy reference instance must be stored in any case + data.storeEntityHeader(Binary.referenceBinaryLength(1), this.typeId(), objectId); + data.store_long(referenceOid); + } + + @SuppressWarnings("unchecked") + @Override + public final Lazy.Default create(final Binary data, final PersistenceLoadHandler handler) + { + /* (27.04.2016 TM)NOTE: registering a Lazy instance with a reference manager + * without having the object supplier set yet might cause an inconsistency if the + * LRM iterates lazy references before the update added the supplier reference. + * ON the other hand: the lazy reference instance is not yet completed and whatever + * logic iterates over the LRM's entries shouldn't rely on anything. + */ + final long objectId = data.read_long(0); + + final Lazy.Default newLazy = Lazy.register( + XReflect.invoke(CONSTRUCTOR, null, objectId, null) + ); + return LazyProxyGenerator.generateLazyProxy(newLazy); + } + + @Override + public final void updateState( + final Binary data, + final Lazy.Default instance, + final PersistenceLoadHandler handler + ) + { + /* + * Intentionally no subject lookup here as premature strong referencing + * might defeat the purpose of memory freeing lazy referencing if no + * other strong reference to the subject is present at the moment. + */ + instance.$setLoader(handler.getObjectRetriever()); + } + + @Override + public final void complete( + final Binary data, + final Lazy.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 offset, + final PersistenceReferenceLoader iterator + ) + { + // the lazy reference is not naturally loadable, but special-handled by this handler + } +} 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..254fa092 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 @@ -20,6 +20,8 @@ import jakarta.annotation.Nonnull; +import org.eclipse.serializer.reference.Lazy; + public final class DataTypeUtil { @@ -45,6 +47,11 @@ public static boolean isObjectArray(final Object obj) return obj instanceof Object[]; } + public static boolean isLazy(final Object obj) + { + return obj instanceof Lazy; + } + 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/copier/AbstractRegisteringCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java new file mode 100644 index 00000000..219a1cc0 --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java @@ -0,0 +1,80 @@ +/* + * Copyright © 2023 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.copier; + +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.Reference; +import org.eclipse.serializer.util.X; + +import software.xdev.spring.data.eclipse.store.repository.SupportedChecker; + + +/** + * This class registers storage instances and copy them for working copies. Utilizes + * {@link EclipseSerializerRegisteringCopier}. + */ +public abstract class AbstractRegisteringCopier implements RegisteringObjectCopier +{ + private final EclipseSerializerRegisteringCopier actualCopier; + + public AbstractRegisteringCopier( + final SupportedChecker supportedChecker, + final RegisteringWorkingCopyAndOriginal register) + { + this.actualCopier = new EclipseSerializerRegisteringCopier( + supportedChecker, + register, + this.createPersistenceManager() + ); + } + + protected abstract PersistenceManager createPersistenceManager(); + + protected SerializerFoundation createSerializerFoundation() + { + final SerializerFoundation newFoundation = SerializerFoundation.New(); + newFoundation.registerCustomTypeHandler(BinaryHandlerImmutableCollectionsSet12.New()); + newFoundation.registerCustomTypeHandler(BinaryHandlerImmutableCollectionsList12.New()); + + final Reference buffer = X.Reference(null); + final Serializer.Source source = () -> X.Constant(buffer.get()); + final Serializer.Target target = buffer::set; + return newFoundation + .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/copier/EclipseSerializerRegisteringCopier.java similarity index 66% 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/copier/EclipseSerializerRegisteringCopier.java index 00f6f8e5..4420a5a4 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/copier/EclipseSerializerRegisteringCopier.java @@ -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.copier; 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/copier/RegisteringObjectCopier.java similarity index 80% 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/copier/RegisteringObjectCopier.java index 4e659c08..e111941e 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/copier/RegisteringObjectCopier.java @@ -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.copier; -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/copier/RegisteringStorageToWorkingCopyCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java new file mode 100644 index 00000000..283b7b04 --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java @@ -0,0 +1,49 @@ +/* + * Copyright © 2023 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.copier; + +import org.eclipse.serializer.persistence.binary.types.Binary; +import org.eclipse.serializer.persistence.types.PersistenceManager; + +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.lazy.SuperLazyBinaryHandler; + + +/** + * 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) + { + super( + supportedChecker, + (workingCopy, objectToStore) -> registry.register(workingCopy, objectToStore) + ); + } + + @Override + protected PersistenceManager createPersistenceManager() + { + return this.createSerializerFoundation() + .registerCustomTypeHandlers(SuperLazyBinaryHandler.New()) + .createPersistenceManager(); + } +} diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyAndOriginal.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyAndOriginal.java new file mode 100644 index 00000000..1438d835 --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyAndOriginal.java @@ -0,0 +1,7 @@ +package software.xdev.spring.data.eclipse.store.repository.support.copier.copier; + +@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/copier/RegisteringWorkingCopyToStorageCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java new file mode 100644 index 00000000..39708b45 --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java @@ -0,0 +1,48 @@ +/* + * Copyright © 2023 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.copier; + +import org.eclipse.serializer.persistence.binary.types.Binary; +import org.eclipse.serializer.persistence.types.PersistenceManager; + +import software.xdev.spring.data.eclipse.store.repository.SupportedChecker; +import software.xdev.spring.data.eclipse.store.repository.WorkingCopyRegistry; + + +/** + * 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) + { + super( + supportedChecker, + (workingCopy, objectToStore) -> registry.invertRegister(workingCopy, objectToStore) + ); + } + + @Override + protected PersistenceManager createPersistenceManager() + { + return this.createSerializerFoundation() + .createPersistenceManager(); + } +} 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..76906a2e 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 @@ -27,6 +27,7 @@ import java.util.TreeMap; import java.util.TreeSet; +import org.eclipse.serializer.reference.Lazy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -37,9 +38,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.LazyProxyGenerator; 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.copier.RegisteringObjectCopier; +import software.xdev.spring.data.eclipse.store.repository.support.copier.copier.RegisteringStorageToWorkingCopyCopier; +import software.xdev.spring.data.eclipse.store.repository.support.copier.copier.RegisteringWorkingCopyToStorageCopier; /** @@ -47,8 +50,14 @@ */ public class RecursiveWorkingCopier implements WorkingCopier { + public enum MergingDirection + { + STORAGE_TO_WORKING_COPY, + WORKING_COPY_TO_STORAGE + } 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; @@ -63,7 +72,8 @@ public RecursiveWorkingCopier( { this.domainClass = domainClass; this.registry = registry; - this.objectCopier = new EclipseSerializerRegisteringCopier(registry, supportedChecker); + this.workingCopyToStorageCopier = new RegisteringWorkingCopyToStorageCopier(registry, supportedChecker); + this.storageToWorkingCopyCopier = new RegisteringStorageToWorkingCopyCopier(registry, supportedChecker); this.idSetterProvider = idSetterProvider; this.persistableChecker = persistableChecker; } @@ -110,7 +120,8 @@ public WorkingCopierResult mergeBack(final T workingCopy) workingCopy, true, new HashSetMergedTargetsCollector(), - changedObjectCollector); + changedObjectCollector, + MergingDirection.WORKING_COPY_TO_STORAGE); if(LOG.isTraceEnabled()) { LOG.trace("Merging back the working copy object of class {}", workingCopy.getClass().getSimpleName()); @@ -123,7 +134,8 @@ public E getOrCreateObjectForDatastore( final E workingCopy, final boolean mergeValues, final MergedTargetsCollector alreadyMergedTargets, - final ChangedObjectCollector changedCollector) + final ChangedObjectCollector changedCollector, + final MergingDirection mergingDirection) { if(workingCopy == null) { @@ -135,7 +147,8 @@ public E getOrCreateObjectForDatastore( { if(mergeValues) { - this.mergeValues(workingCopy, originalObject, alreadyMergedTargets, changedCollector); + this.mergeValues(workingCopy, originalObject, alreadyMergedTargets, changedCollector, + mergingDirection); } changedCollector.collectChangedObject(originalObject); return originalObject; @@ -146,7 +159,7 @@ public E getOrCreateObjectForDatastore( final E objectForDatastore = this.genericCopy(workingCopy, true); // "Why merging 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); + this.mergeValues(workingCopy, objectForDatastore, alreadyMergedTargets, changedCollector, mergingDirection); changedCollector.collectChangedObject(objectForDatastore); return objectForDatastore; } @@ -161,7 +174,9 @@ private void mergeValues( final E sourceObject, final E targetObject, final MergedTargetsCollector alreadyMergedTargets, - final ChangedObjectCollector changedCollector) + final ChangedObjectCollector changedCollector, + final MergingDirection mergingDirection + ) { if(sourceObject == targetObject || alreadyMergedTargets.isAlreadyMerged(targetObject) || targetObject == null) { @@ -179,7 +194,13 @@ private void mergeValues( } AccessHelper.getInheritedPrivateFieldsByName(sourceObject.getClass()).values().forEach( field -> - this.mergeValueOfField(sourceObject, targetObject, field, alreadyMergedTargets, changedCollector) + this.mergeValueOfField( + sourceObject, + targetObject, + field, + alreadyMergedTargets, + changedCollector, + mergingDirection) ); } catch(final Exception e) @@ -193,7 +214,8 @@ private void mergeValueOfField( final E targetObject, final Field field, final MergedTargetsCollector alreadyMergedTargets, - final ChangedObjectCollector changedCollector) + final ChangedObjectCollector changedCollector, + final MergingDirection mergingDirection) { try { @@ -239,10 +261,16 @@ else if(DataTypeUtil.isObjectArray(valueOfSourceObject)) valueOfSourceObject.getClass().getComponentType(), (Object[])valueOfSourceObject, alreadyMergedTargets, - changedCollector + changedCollector, + mergingDirection ); fam.writeValueOfField(targetObject, newArray, !targetObjectIsPartOfJavaPackage); } + else if(DataTypeUtil.isLazy(valueOfSourceObject)) + { + final Lazy newLazy = this.createNewLazy((Lazy)valueOfSourceObject, mergingDirection); + fam.writeValueOfField(targetObject, newLazy, true); + } else { // "Simple" object @@ -252,7 +280,8 @@ else if(DataTypeUtil.isObjectArray(valueOfSourceObject)) valueOfSourceObject, false, alreadyMergedTargets, - changedCollector); + changedCollector, + mergingDirection); if(valueOfTargetObject != originalValueObjectOfSource) { // If the reference is new, it must be set @@ -276,7 +305,8 @@ else if(DataTypeUtil.isObjectArray(valueOfSourceObject)) valueOfSourceObject, originalValueObjectOfSource, alreadyMergedTargets, - changedCollector); + changedCollector, + mergingDirection); } } } @@ -288,6 +318,34 @@ else if(DataTypeUtil.isObjectArray(valueOfSourceObject)) } } + private Lazy createNewLazy( + final Lazy valueOfSourceObject, + final MergingDirection mergingDirection + ) + { + final Lazy oldLazy = valueOfSourceObject; + final Lazy newLazy; + if(mergingDirection.equals(MergingDirection.STORAGE_TO_WORKING_COPY)) + { + // If this object is generated for a working copy we need a proxy that only loads the actual + // stored lazy if needed and not before. + newLazy = LazyProxyGenerator.generateLazyProxy(oldLazy); + } + else + { + // TODO + if(oldLazy.isLoaded()) + { + newLazy = Lazy.Reference(oldLazy.get()); + } + else + { + throw new RuntimeException(""); + } + } + return newLazy; + } + /** * 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. @@ -311,7 +369,8 @@ private E[] createGenericObjectArray( final Class clazz, final Object[] valueOfSourceObjectArray, final MergedTargetsCollector alreadyMergedTargets, - final ChangedObjectCollector changedCollector) + final ChangedObjectCollector changedCollector, + final MergingDirection mergingDirection) { // Create new Array with original objects with merged data final E[] newArray = (E[])Array.newInstance(clazz, valueOfSourceObjectArray.length); @@ -321,14 +380,19 @@ private E[] createGenericObjectArray( (E)valueOfSourceObjectArray[i], true, alreadyMergedTargets, - changedCollector); + changedCollector, + mergingDirection); } return newArray; } private 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/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 f5465f61..a5d558eb 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,3 +1,18 @@ +/* + * Copyright © 2023 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. + */ /** * The repositories of these tests are seperated from each other. That means that e.g. the * {@link software.xdev.spring.data.eclipse.store.integration.isolated.tests.special.types.TypesTest} can't access the 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 index ee4832e8..d05c7b64 100644 --- 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 @@ -47,9 +47,9 @@ void lazyListStore(final ObjectWithLazyListRepository repository) this.configuration, () -> { Assertions.assertEquals(1, repository.findAll().size()); - final LazyList loadedLazyList = repository.findAll().getFirst().getLazyList(); + final LazyList loadedLazyList = repository.findAll().get(0).getLazyList(); Assertions.assertEquals(1, loadedLazyList.size()); - Assertions.assertEquals(objectToStore, loadedLazyList.getFirst()); + Assertions.assertEquals(objectToStore, loadedLazyList.get(0)); } ); } 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 index abbd79d3..96d53b3e 100644 --- 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 @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 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/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..641d8531 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 @@ -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,21 @@ public LazyDaoObject(final Integer id, final Lazy value) { super(id, value); } + + @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()) && 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/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..b4968828 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 @@ -44,6 +44,9 @@ import java.util.function.Function; import java.util.stream.Stream; +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; import org.junit.jupiter.params.provider.Arguments; @@ -108,6 +111,32 @@ public static Stream generateData() id -> new SetDaoObject(id, new HashSet<>(List.of("1", "2"))), set -> set.getValue().add("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<>( SetRepository.class, id -> new SetDaoObject(id, new TreeSet<>()), @@ -244,6 +273,32 @@ public static Stream generateData() }, object -> object.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<>( ListRepository.class, id -> new ListDaoObject(id, new ArrayList<>(Set.of("1"))), @@ -378,6 +433,40 @@ 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, 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<>( + MapRepository.class, + id -> new MapDaoObject(id, new LazyHashMap<>()), + set -> set.getValue().put("1", "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") ) ) ).toArguments(); @@ -392,16 +481,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)), 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 be4503c9..77b2d9f2 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,3 +1,18 @@ +/* + * Copyright © 2023 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. + */ /** * These tests SHARE their repositories. That's not ideal and should be changed in the future. */ 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/copier/RegisteringStorageToWorkingCopyCopierTest.java similarity index 72% 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/copier/RegisteringStorageToWorkingCopyCopierTest.java index 51ad01bf..f870a9b4 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/copier/RegisteringStorageToWorkingCopyCopierTest.java @@ -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.copier; import java.util.List; import java.util.stream.IntStream; @@ -25,7 +25,7 @@ import software.xdev.spring.data.eclipse.store.repository.WorkingCopyRegistry; -class EclipseStoreRegisteringCopierTest +class RegisteringStorageToWorkingCopyCopierTest { private record DummyData(String data, int number) { @@ -34,8 +34,10 @@ 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())) { final List originalObjects = IntStream.range(0, 1_000).mapToObj( i -> new DummyData("Data" + i, i) @@ -50,8 +52,10 @@ 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())) { final DummyData originalObject = new DummyData("Test", 1); @@ -65,8 +69,10 @@ 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())) { final DummyData originalObject = new DummyData("Test", 1); @@ -82,8 +88,10 @@ 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())) { final List originalObjects = IntStream.range(0, 100_000).mapToObj( i -> new DummyData("Data" + i, i) @@ -98,8 +106,10 @@ 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())) { Assertions.assertThrows(NullPointerException.class, () -> copier.copy(null)); } From 35beb2918dd0f41e954495782f6d5f4cc6e788fd Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Tue, 12 Mar 2024 09:13:06 +0100 Subject: [PATCH 03/18] Lazy storing working for simplest test --- .../BinaryHandlerOnlyForCopyingException.java | 11 ++ .../importer/EclipseStoreDataImporter.java | 7 +- .../store/repository/EclipseStoreStorage.java | 10 +- .../repository/lazy/LazyProxyGenerator.java | 14 +- .../lazy/SpringDataEclipseStoreLazy.java | 129 +++++++++++++ ...ringDataEclipseStoreLazyBinaryHandler.java | 117 ++++++++++++ .../lazy/SuperLazyBinaryHandler.java | 169 ------------------ .../EclipseStoreRepositoryFactory.java | 3 +- .../support/copier/DataTypeUtil.java | 6 +- .../copier/AbstractRegisteringCopier.java | 8 +- .../copier/PersistenceManagerProvider.java | 12 ++ ...RegisteringStorageToWorkingCopyCopier.java | 19 +- ...RegisteringWorkingCopyToStorageCopier.java | 17 +- .../working/RecursiveWorkingCopier.java | 92 ++++------ .../tests/special/types/TypesData.java | 8 +- ...steringStorageToWorkingCopyCopierTest.java | 15 +- 16 files changed, 370 insertions(+), 267 deletions(-) create mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/BinaryHandlerOnlyForCopyingException.java create mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazy.java create mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazyBinaryHandler.java delete mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SuperLazyBinaryHandler.java create mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/PersistenceManagerProvider.java diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/BinaryHandlerOnlyForCopyingException.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/BinaryHandlerOnlyForCopyingException.java new file mode 100644 index 00000000..96ab9ca3 --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/BinaryHandlerOnlyForCopyingException.java @@ -0,0 +1,11 @@ +package software.xdev.spring.data.eclipse.store.exceptions; + +public class BinaryHandlerOnlyForCopyingException extends RuntimeException +{ + public BinaryHandlerOnlyForCopyingException() + { + super( + "This handler should only be used for copying objects one time. It shouldn't be used for anything else, " + + "yet it looks like you are using it for something else."); + } +} 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..b21fc73c 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 @@ -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/repository/EclipseStoreStorage.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/EclipseStoreStorage.java index 32800225..07b06e8a 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 @@ -26,6 +26,7 @@ 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.ObjectSwizzling; import org.eclipse.store.storage.embedded.types.EmbeddedStorageFoundation; import org.eclipse.store.storage.types.StorageManager; import org.slf4j.Logger; @@ -40,7 +41,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<>(); @@ -311,4 +312,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/lazy/LazyProxyGenerator.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyProxyGenerator.java index b9d0b36b..f9650a98 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyProxyGenerator.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyProxyGenerator.java @@ -10,19 +10,9 @@ private LazyProxyGenerator() { } - public static , T> L generateLazyProxy(final L lazy, final Class clazz) - { - final ProxyFactory f = new ProxyFactory(clazz, new LazyInterceptor<>(lazy)); - return (L)f.getProxy(); - } - public static Lazy generateLazyProxy(final Lazy lazy) { - return generateLazyProxy(lazy, Lazy.class); - } - - public static Lazy.Default generateLazyDefaultProxy(final Lazy.Default lazy) - { - return generateLazyProxy(lazy, Lazy.Default.class); + final ProxyFactory f = new ProxyFactory(Lazy.class, new LazyInterceptor<>(lazy)); + return (Lazy)f.getProxy(); } } 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..cf9c2487 --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazy.java @@ -0,0 +1,129 @@ +package software.xdev.spring.data.eclipse.store.repository.lazy; + +import java.util.Objects; + +import org.eclipse.serializer.reference.Lazy; +import org.eclipse.serializer.reference.ObjectSwizzling; + + +public interface SpringDataEclipseStoreLazy extends Lazy +{ + static SpringDataEclipseStoreLazy.Default build(final T objectToWrapInLazy) + { + return new Default<>(objectToWrapInLazy); + } + + static SpringDataEclipseStoreLazy.Default buildFromStorage(final long objectId, final ObjectSwizzling loader) + { + return new Default<>(objectId, loader); + } + + static SpringDataEclipseStoreLazy.Default buildOnlyForStorage(final long objectId) + { + return new Default<>(objectId); + } + + long objectId(); + + class Default implements SpringDataEclipseStoreLazy + { + private Lazy wrappedLazy; + private long objectId; + private ObjectSwizzling loader; + + private Default(final T wrappedObject) + { + this.wrappedLazy = Lazy.Reference(wrappedObject); + } + + private Default(final long objectId, final ObjectSwizzling loader) + { + this.objectId = objectId; + this.loader = loader; + } + + private Default(final long objectId) + { + this.objectId = objectId; + } + + private Lazy ensureLazy() + { + if(this.wrappedLazy == null) + { + Objects.requireNonNull(this.loader); + Objects.requireNonNull(this.objectId); + this.wrappedLazy = Lazy.Reference((T)this.loader.getObject(this.objectId)); + } + return this.wrappedLazy; + } + + @SuppressWarnings("all") + public static final Class> genericType() + { + // no idea how to get ".class" to work otherwise in conjunction with generics. + return (Class)SpringDataEclipseStoreLazy.Default.class; + } + + @Override + public T get() + { + return this.ensureLazy().get(); + } + + @Override + public T peek() + { + return this.ensureLazy().peek(); + } + + @Override + public T clear() + { + this.wrappedLazy = null; + return null; + } + + @Override + public boolean isStored() + { + return this.ensureLazy().isStored(); + } + + @Override + public boolean isLoaded() + { + 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 Lazy.Default) + { + return ((Lazy.Default)this.wrappedLazy).objectId(); + } + return this.objectId; + } + } +} 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..fc04264a --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazyBinaryHandler.java @@ -0,0 +1,117 @@ +package software.xdev.spring.data.eclipse.store.repository.lazy; + +import java.lang.reflect.Constructor; +import java.util.Objects; + +import org.eclipse.serializer.persistence.binary.types.AbstractBinaryHandlerCustom; +import org.eclipse.serializer.persistence.binary.types.Binary; +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.exceptions.BinaryHandlerOnlyForCopyingException; + + +/** + * Copied from + * {@link org.eclipse.serializer.persistence.binary.org.eclipse.serializer.reference.BinaryHandlerLazyDefault}. + */ +public final class SpringDataEclipseStoreLazyBinaryHandler + extends AbstractBinaryHandlerCustom> +{ + @SuppressWarnings("rawtypes") + static final Constructor CONSTRUCTOR = XReflect.setAccessible( + XReflect.getDeclaredConstructor( + SpringDataEclipseStoreLazy.Default.class, + long.class, + ObjectSwizzling.class + ) + ); + + private final ObjectSwizzling objectSwizzling; + + public SpringDataEclipseStoreLazyBinaryHandler(final ObjectSwizzling objectSwizzling) + { + super( + SpringDataEclipseStoreLazy.Default.genericType(), + CustomFields( + CustomField(Object.class, "subject") + ) + ); + this.objectSwizzling = Objects.requireNonNull(objectSwizzling); + } + + @Override + public final void store( + final Binary data, + final SpringDataEclipseStoreLazy.Default instance, + final long objectId, + final PersistenceStoreHandler handler + ) + { + final long referenceOid = instance.objectId(); + data.storeEntityHeader(Binary.referenceBinaryLength(1), this.typeId(), objectId); + data.store_long(referenceOid); + } + + @SuppressWarnings("unchecked") + @Override + public final SpringDataEclipseStoreLazy.Default create(final Binary data, final PersistenceLoadHandler handler) + { + final long objectId = data.read_long(0); + + return Lazy.register( + XReflect.invoke(CONSTRUCTOR, objectId, this.objectSwizzling) + ); + } + + @Override + public final void updateState( + final Binary data, + final SpringDataEclipseStoreLazy.Default instance, + final PersistenceLoadHandler handler + ) + { + throw new BinaryHandlerOnlyForCopyingException(); + } + + @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 offset, + final PersistenceReferenceLoader iterator + ) + { + // the lazy reference is not naturally loadable, but special-handled by this handler + } +} diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SuperLazyBinaryHandler.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SuperLazyBinaryHandler.java deleted file mode 100644 index 2577588c..00000000 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SuperLazyBinaryHandler.java +++ /dev/null @@ -1,169 +0,0 @@ -package software.xdev.spring.data.eclipse.store.repository.lazy; - -import java.lang.reflect.Constructor; - -import org.eclipse.serializer.persistence.binary.types.AbstractBinaryHandlerCustom; -import org.eclipse.serializer.persistence.binary.types.Binary; -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; - - -/** - * Copied from - * {@link org.eclipse.serializer.persistence.binary.org.eclipse.serializer.reference.BinaryHandlerLazyDefault}. - */ -public class SuperLazyBinaryHandler extends AbstractBinaryHandlerCustom> -{ - /////////////////////////////////////////////////////////////////////////// - // static methods // - /////////////////// - - public static SuperLazyBinaryHandler New() - { - return new SuperLazyBinaryHandler(); - } - - @SuppressWarnings("rawtypes") - static final Constructor CONSTRUCTOR = XReflect.setAccessible( - XReflect.getDeclaredConstructor(Lazy.Default.class, Object.class, long.class, ObjectSwizzling.class) - ); - - /////////////////////////////////////////////////////////////////////////// - // constructors // - ///////////////// - - private SuperLazyBinaryHandler() - { - super( - Lazy.Default.genericType(), - CustomFields( - CustomField(Object.class, "subject") - ) - ); - } - - /////////////////////////////////////////////////////////////////////////// - // methods // - //////////// - - @Override - public final void store( - final Binary data, - final Lazy.Default instance, - final long objectId, - final PersistenceStoreHandler handler - ) - { - /* (29.09.2015 TM)NOTE: There are several cases that have to be handled here correctly: - * - * 1) objectId == 0, referent == null - * "Empty" lazy reference that must be stored as such - * - * 2.) objectId == 0, referent != null - * Newly created lazy reference with a referent. The referent has to be handled and the lazy reference has - * to be stored with the referent's OID - * - * 3.) objectId != null, referent == null - * The lazy reference represents a non-null referent that is currently simply not loaded. The lazy reference - * must be stored nonetheless, pointing to its known referent objectId - * - * 4.) objectId != null, referent != null - * The lazy reference represents a non-null referent that is currently loaded. The refernt must be handled, - * the lazy reference must be stored, pointing to its known referent objectId. - */ - - final Object referent = instance.peek(); - final long referenceOid; - - if(referent == null) - { - referenceOid = instance.objectId(); - } - else - { - // OID validation or updating is done by linking logic - referenceOid = handler.apply(referent); - } - - // link to object supplier (internal logic can either update, discard or throw exception on mismatch) - // instance.$link(referenceOid, handler.getObjectRetriever()); - - // lazy reference instance must be stored in any case - data.storeEntityHeader(Binary.referenceBinaryLength(1), this.typeId(), objectId); - data.store_long(referenceOid); - } - - @SuppressWarnings("unchecked") - @Override - public final Lazy.Default create(final Binary data, final PersistenceLoadHandler handler) - { - /* (27.04.2016 TM)NOTE: registering a Lazy instance with a reference manager - * without having the object supplier set yet might cause an inconsistency if the - * LRM iterates lazy references before the update added the supplier reference. - * ON the other hand: the lazy reference instance is not yet completed and whatever - * logic iterates over the LRM's entries shouldn't rely on anything. - */ - final long objectId = data.read_long(0); - - final Lazy.Default newLazy = Lazy.register( - XReflect.invoke(CONSTRUCTOR, null, objectId, null) - ); - return LazyProxyGenerator.generateLazyProxy(newLazy); - } - - @Override - public final void updateState( - final Binary data, - final Lazy.Default instance, - final PersistenceLoadHandler handler - ) - { - /* - * Intentionally no subject lookup here as premature strong referencing - * might defeat the purpose of memory freeing lazy referencing if no - * other strong reference to the subject is present at the moment. - */ - instance.$setLoader(handler.getObjectRetriever()); - } - - @Override - public final void complete( - final Binary data, - final Lazy.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 offset, - final PersistenceReferenceLoader iterator - ) - { - // the lazy reference is not naturally loadable, but special-handled by this handler - } -} 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..970a1ea2 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 @@ -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/copier/DataTypeUtil.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/DataTypeUtil.java index 254fa092..1c56d322 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 @@ -20,7 +20,7 @@ import jakarta.annotation.Nonnull; -import org.eclipse.serializer.reference.Lazy; +import software.xdev.spring.data.eclipse.store.repository.lazy.SpringDataEclipseStoreLazy; public final class DataTypeUtil @@ -47,9 +47,9 @@ public static boolean isObjectArray(final Object obj) return obj instanceof Object[]; } - public static boolean isLazy(final Object obj) + public static boolean isSpringDataEclipseStoreLazy(final Object obj) { - return obj instanceof Lazy; + return obj instanceof SpringDataEclipseStoreLazy; } public static boolean isPrimitiveArray(final Object obj) diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java index 219a1cc0..79acb4c7 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java @@ -20,7 +20,6 @@ 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.Reference; import org.eclipse.serializer.util.X; @@ -37,17 +36,16 @@ public abstract class AbstractRegisteringCopier implements RegisteringObjectCopi public AbstractRegisteringCopier( final SupportedChecker supportedChecker, - final RegisteringWorkingCopyAndOriginal register) + final RegisteringWorkingCopyAndOriginal register, + final PersistenceManagerProvider persistenceManagerProvider) { this.actualCopier = new EclipseSerializerRegisteringCopier( supportedChecker, register, - this.createPersistenceManager() + persistenceManagerProvider.createPersistenceManager(this.createSerializerFoundation()) ); } - protected abstract PersistenceManager createPersistenceManager(); - protected SerializerFoundation createSerializerFoundation() { final SerializerFoundation newFoundation = SerializerFoundation.New(); diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/PersistenceManagerProvider.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/PersistenceManagerProvider.java new file mode 100644 index 00000000..3728da3c --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/PersistenceManagerProvider.java @@ -0,0 +1,12 @@ +package software.xdev.spring.data.eclipse.store.repository.support.copier.copier; + +import org.eclipse.serializer.SerializerFoundation; +import org.eclipse.serializer.persistence.binary.types.Binary; +import org.eclipse.serializer.persistence.types.PersistenceManager; + + +@FunctionalInterface +public interface PersistenceManagerProvider +{ + PersistenceManager createPersistenceManager(SerializerFoundation serializerFoundation); +} diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java index 283b7b04..78bc13e1 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java @@ -15,12 +15,14 @@ */ package software.xdev.spring.data.eclipse.store.repository.support.copier.copier; +import org.eclipse.serializer.SerializerFoundation; import org.eclipse.serializer.persistence.binary.types.Binary; import org.eclipse.serializer.persistence.types.PersistenceManager; +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.lazy.SuperLazyBinaryHandler; +import software.xdev.spring.data.eclipse.store.repository.lazy.SpringDataEclipseStoreLazyBinaryHandler; /** @@ -31,19 +33,22 @@ public class RegisteringStorageToWorkingCopyCopier extends AbstractRegisteringCo { public RegisteringStorageToWorkingCopyCopier( final WorkingCopyRegistry registry, - final SupportedChecker supportedChecker) + final SupportedChecker supportedChecker, + final ObjectSwizzling objectSwizzling) { super( supportedChecker, - (workingCopy, objectToStore) -> registry.register(workingCopy, objectToStore) + (workingCopy, objectToStore) -> registry.register(workingCopy, objectToStore), + (serializerFoundation) -> createPersistenceManager(serializerFoundation, objectSwizzling) ); } - @Override - protected PersistenceManager createPersistenceManager() + private static PersistenceManager createPersistenceManager( + final SerializerFoundation serializerFoundation, + final ObjectSwizzling objectSwizzling) { - return this.createSerializerFoundation() - .registerCustomTypeHandlers(SuperLazyBinaryHandler.New()) + return serializerFoundation + .registerCustomTypeHandlers(new SpringDataEclipseStoreLazyBinaryHandler(objectSwizzling)) .createPersistenceManager(); } } diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java index 39708b45..428c2a81 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java @@ -15,11 +15,14 @@ */ package software.xdev.spring.data.eclipse.store.repository.support.copier.copier; +import org.eclipse.serializer.SerializerFoundation; import org.eclipse.serializer.persistence.binary.types.Binary; import org.eclipse.serializer.persistence.types.PersistenceManager; +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.lazy.SpringDataEclipseStoreLazyBinaryHandler; /** @@ -31,18 +34,22 @@ public class RegisteringWorkingCopyToStorageCopier extends AbstractRegisteringCo public RegisteringWorkingCopyToStorageCopier( final WorkingCopyRegistry registry, - final SupportedChecker supportedChecker) + final SupportedChecker supportedChecker, + final ObjectSwizzling objectSwizzling) { super( supportedChecker, - (workingCopy, objectToStore) -> registry.invertRegister(workingCopy, objectToStore) + (workingCopy, objectToStore) -> registry.invertRegister(workingCopy, objectToStore), + (serializerFoundation) -> createPersistenceManager(serializerFoundation, objectSwizzling) ); } - @Override - protected PersistenceManager createPersistenceManager() + private static PersistenceManager createPersistenceManager( + final SerializerFoundation serializerFoundation, + final ObjectSwizzling objectSwizzling) { - return this.createSerializerFoundation() + return serializerFoundation + .registerCustomTypeHandlers(new SpringDataEclipseStoreLazyBinaryHandler(objectSwizzling)) .createPersistenceManager(); } } 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 76906a2e..49be55e8 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 @@ -27,7 +27,7 @@ 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; @@ -38,7 +38,7 @@ 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.LazyProxyGenerator; +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.copier.RegisteringObjectCopier; import software.xdev.spring.data.eclipse.store.repository.support.copier.copier.RegisteringStorageToWorkingCopyCopier; @@ -50,11 +50,6 @@ */ public class RecursiveWorkingCopier implements WorkingCopier { - public enum MergingDirection - { - STORAGE_TO_WORKING_COPY, - WORKING_COPY_TO_STORAGE - } private static final Logger LOG = LoggerFactory.getLogger(RecursiveWorkingCopier.class); private final RegisteringObjectCopier workingCopyToStorageCopier; private final RegisteringObjectCopier storageToWorkingCopyCopier; @@ -68,12 +63,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.workingCopyToStorageCopier = new RegisteringWorkingCopyToStorageCopier(registry, supportedChecker); - this.storageToWorkingCopyCopier = new RegisteringStorageToWorkingCopyCopier(registry, supportedChecker); + this.workingCopyToStorageCopier = + new RegisteringWorkingCopyToStorageCopier(registry, supportedChecker, objectSwizzling); + this.storageToWorkingCopyCopier = + new RegisteringStorageToWorkingCopyCopier(registry, supportedChecker, objectSwizzling); this.idSetterProvider = idSetterProvider; this.persistableChecker = persistableChecker; } @@ -120,8 +118,7 @@ public WorkingCopierResult mergeBack(final T workingCopy) workingCopy, true, new HashSetMergedTargetsCollector(), - changedObjectCollector, - MergingDirection.WORKING_COPY_TO_STORAGE); + changedObjectCollector); if(LOG.isTraceEnabled()) { LOG.trace("Merging back the working copy object of class {}", workingCopy.getClass().getSimpleName()); @@ -134,8 +131,7 @@ public E getOrCreateObjectForDatastore( final E workingCopy, final boolean mergeValues, final MergedTargetsCollector alreadyMergedTargets, - final ChangedObjectCollector changedCollector, - final MergingDirection mergingDirection) + final ChangedObjectCollector changedCollector) { if(workingCopy == null) { @@ -147,8 +143,7 @@ public E getOrCreateObjectForDatastore( { if(mergeValues) { - this.mergeValues(workingCopy, originalObject, alreadyMergedTargets, changedCollector, - mergingDirection); + this.mergeValues(workingCopy, originalObject, alreadyMergedTargets, changedCollector); } changedCollector.collectChangedObject(originalObject); return originalObject; @@ -159,7 +154,7 @@ public E getOrCreateObjectForDatastore( final E objectForDatastore = this.genericCopy(workingCopy, true); // "Why merging 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, mergingDirection); + this.mergeValues(workingCopy, objectForDatastore, alreadyMergedTargets, changedCollector); changedCollector.collectChangedObject(objectForDatastore); return objectForDatastore; } @@ -174,8 +169,7 @@ private void mergeValues( final E sourceObject, final E targetObject, final MergedTargetsCollector alreadyMergedTargets, - final ChangedObjectCollector changedCollector, - final MergingDirection mergingDirection + final ChangedObjectCollector changedCollector ) { if(sourceObject == targetObject || alreadyMergedTargets.isAlreadyMerged(targetObject) || targetObject == null) @@ -199,8 +193,7 @@ private void mergeValues( targetObject, field, alreadyMergedTargets, - changedCollector, - mergingDirection) + changedCollector) ); } catch(final Exception e) @@ -214,8 +207,7 @@ private void mergeValueOfField( final E targetObject, final Field field, final MergedTargetsCollector alreadyMergedTargets, - final ChangedObjectCollector changedCollector, - final MergingDirection mergingDirection) + final ChangedObjectCollector changedCollector) { try { @@ -261,14 +253,17 @@ else if(DataTypeUtil.isObjectArray(valueOfSourceObject)) valueOfSourceObject.getClass().getComponentType(), (Object[])valueOfSourceObject, alreadyMergedTargets, - changedCollector, - mergingDirection + changedCollector ); fam.writeValueOfField(targetObject, newArray, !targetObjectIsPartOfJavaPackage); } - else if(DataTypeUtil.isLazy(valueOfSourceObject)) + else if(DataTypeUtil.isSpringDataEclipseStoreLazy(valueOfSourceObject)) { - final Lazy newLazy = this.createNewLazy((Lazy)valueOfSourceObject, mergingDirection); + final SpringDataEclipseStoreLazy newLazy = + this.createNewLazy( + (SpringDataEclipseStoreLazy)valueOfSourceObject, + alreadyMergedTargets, + changedCollector); fam.writeValueOfField(targetObject, newLazy, true); } else @@ -280,8 +275,7 @@ else if(DataTypeUtil.isLazy(valueOfSourceObject)) valueOfSourceObject, false, alreadyMergedTargets, - changedCollector, - mergingDirection); + changedCollector); if(valueOfTargetObject != originalValueObjectOfSource) { // If the reference is new, it must be set @@ -305,8 +299,7 @@ else if(DataTypeUtil.isLazy(valueOfSourceObject)) valueOfSourceObject, originalValueObjectOfSource, alreadyMergedTargets, - changedCollector, - mergingDirection); + changedCollector); } } } @@ -318,32 +311,27 @@ else if(DataTypeUtil.isLazy(valueOfSourceObject)) } } - private Lazy createNewLazy( - final Lazy valueOfSourceObject, - final MergingDirection mergingDirection + private SpringDataEclipseStoreLazy createNewLazy( + final SpringDataEclipseStoreLazy oldLazy, + final MergedTargetsCollector alreadyMergedTargets, + final ChangedObjectCollector changedCollector ) { - final Lazy oldLazy = valueOfSourceObject; - final Lazy newLazy; - if(mergingDirection.equals(MergingDirection.STORAGE_TO_WORKING_COPY)) - { - // If this object is generated for a working copy we need a proxy that only loads the actual - // stored lazy if needed and not before. - newLazy = LazyProxyGenerator.generateLazyProxy(oldLazy); - } - else - { - // TODO if(oldLazy.isLoaded()) { - newLazy = Lazy.Reference(oldLazy.get()); + final E copyOfWrappedObject = this.getOrCreateObjectForDatastore( + oldLazy.get(), + true, + alreadyMergedTargets, + changedCollector); + return SpringDataEclipseStoreLazy.build(copyOfWrappedObject); } else { - throw new RuntimeException(""); + // 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)SpringDataEclipseStoreLazy.buildOnlyForStorage(oldLazy.objectId()); } - } - return newLazy; } /** @@ -369,8 +357,7 @@ private E[] createGenericObjectArray( final Class clazz, final Object[] valueOfSourceObjectArray, final MergedTargetsCollector alreadyMergedTargets, - final ChangedObjectCollector changedCollector, - final MergingDirection mergingDirection) + final ChangedObjectCollector changedCollector) { // Create new Array with original objects with merged data final E[] newArray = (E[])Array.newInstance(clazz, valueOfSourceObjectArray.length); @@ -380,8 +367,7 @@ private E[] createGenericObjectArray( (E)valueOfSourceObjectArray[i], true, alreadyMergedTargets, - changedCollector, - mergingDirection); + changedCollector); } return newArray; } 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 b4968828..6c3bed83 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 @@ -47,10 +47,10 @@ 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; 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 @@ -436,12 +436,12 @@ public static Stream generateData() ), new TestArguments<>( LazyRepository.class, - id -> new LazyDaoObject(id, Lazy.Reference("1")), - object -> object.setValue(Lazy.Reference("2")) + id -> new LazyDaoObject(id, SpringDataEclipseStoreLazy.build("1")), + object -> object.setValue(SpringDataEclipseStoreLazy.build("2")) ), new TestArguments<>( LazyRepository.class, - id -> new LazyDaoObject(id, Lazy.Reference("1")), + id -> new LazyDaoObject(id, SpringDataEclipseStoreLazy.build("1")), object -> object.getValue().clear() ), new TestArguments<>( diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopierTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopierTest.java index f870a9b4..a7f44591 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopierTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopierTest.java @@ -37,7 +37,8 @@ void testCopyManyCopiesSingle() try(final RegisteringStorageToWorkingCopyCopier copier = new RegisteringStorageToWorkingCopyCopier( new WorkingCopyRegistry(), - new SupportedChecker.Implementation())) + new SupportedChecker.Implementation(), + o -> null)) { final List originalObjects = IntStream.range(0, 1_000).mapToObj( i -> new DummyData("Data" + i, i) @@ -55,7 +56,8 @@ void testCopyAgainSameObject() try(final RegisteringStorageToWorkingCopyCopier copier = new RegisteringStorageToWorkingCopyCopier( new WorkingCopyRegistry(), - new SupportedChecker.Implementation())) + new SupportedChecker.Implementation(), + o -> null)) { final DummyData originalObject = new DummyData("Test", 1); @@ -72,7 +74,8 @@ void testCopyAgainTheCopy() try(final RegisteringStorageToWorkingCopyCopier copier = new RegisteringStorageToWorkingCopyCopier( new WorkingCopyRegistry(), - new SupportedChecker.Implementation())) + new SupportedChecker.Implementation(), + o -> null)) { final DummyData originalObject = new DummyData("Test", 1); @@ -91,7 +94,8 @@ void testCopyManyCopiesBulk() try(final RegisteringStorageToWorkingCopyCopier copier = new RegisteringStorageToWorkingCopyCopier( new WorkingCopyRegistry(), - new SupportedChecker.Implementation())) + new SupportedChecker.Implementation(), + o -> null)) { final List originalObjects = IntStream.range(0, 100_000).mapToObj( i -> new DummyData("Data" + i, i) @@ -109,7 +113,8 @@ void testCopyEmpty() try(final RegisteringStorageToWorkingCopyCopier copier = new RegisteringStorageToWorkingCopyCopier( new WorkingCopyRegistry(), - new SupportedChecker.Implementation())) + new SupportedChecker.Implementation(), + o -> null)) { Assertions.assertThrows(NullPointerException.class, () -> copier.copy(null)); } From a8f408ff95b967270227e59a619426ed516c9881 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Tue, 12 Mar 2024 11:39:56 +0100 Subject: [PATCH 04/18] Simple Lazy working --- .../BinaryHandlerOnlyForCopyingException.java | 11 -- .../lazy/SpringDataEclipseStoreLazy.java | 24 ++-- ...ringDataEclipseStoreLazyBinaryHandler.java | 5 +- .../data/eclipse/store/helper/TestData.java | 3 + .../isolated/tests/lazy/LazyTest.java | 126 +++++++++++++++++- .../isolated/tests/lazy/ObjectWithLazy.java | 34 +++++ .../tests/lazy/ObjectWithLazyRepository.java | 23 ++++ .../tests/special/types/TypesData.java | 5 - 8 files changed, 202 insertions(+), 29 deletions(-) delete mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/BinaryHandlerOnlyForCopyingException.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazy.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyRepository.java diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/BinaryHandlerOnlyForCopyingException.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/BinaryHandlerOnlyForCopyingException.java deleted file mode 100644 index 96ab9ca3..00000000 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/BinaryHandlerOnlyForCopyingException.java +++ /dev/null @@ -1,11 +0,0 @@ -package software.xdev.spring.data.eclipse.store.exceptions; - -public class BinaryHandlerOnlyForCopyingException extends RuntimeException -{ - public BinaryHandlerOnlyForCopyingException() - { - super( - "This handler should only be used for copying objects one time. It shouldn't be used for anything else, " - + "yet it looks like you are using it for something else."); - } -} 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 index cf9c2487..c033d650 100644 --- 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 @@ -4,6 +4,7 @@ import org.eclipse.serializer.reference.Lazy; import org.eclipse.serializer.reference.ObjectSwizzling; +import org.eclipse.serializer.reference.Swizzling; public interface SpringDataEclipseStoreLazy extends Lazy @@ -13,11 +14,6 @@ static SpringDataEclipseStoreLazy.Default build(final T objectToWrapInLaz return new Default<>(objectToWrapInLazy); } - static SpringDataEclipseStoreLazy.Default buildFromStorage(final long objectId, final ObjectSwizzling loader) - { - return new Default<>(objectId, loader); - } - static SpringDataEclipseStoreLazy.Default buildOnlyForStorage(final long objectId) { return new Default<>(objectId); @@ -28,8 +24,9 @@ static SpringDataEclipseStoreLazy.Default buildOnlyForStorage(final long obje class Default implements SpringDataEclipseStoreLazy { private Lazy wrappedLazy; - private long objectId; - private ObjectSwizzling loader; + private long objectId = Swizzling.notFoundId(); + private transient ObjectSwizzling loader; + private transient boolean isStored = false; private Default(final T wrappedObject) { @@ -80,6 +77,12 @@ public T 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; } @@ -87,7 +90,12 @@ public T clear() @Override public boolean isStored() { - return this.ensureLazy().isStored(); + return this.isStored; + } + + void setStored() + { + this.isStored = true; } @Override 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 index fc04264a..b4bb38cf 100644 --- 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 @@ -12,8 +12,6 @@ import org.eclipse.serializer.reference.ObjectSwizzling; import org.eclipse.serializer.reflect.XReflect; -import software.xdev.spring.data.eclipse.store.exceptions.BinaryHandlerOnlyForCopyingException; - /** * Copied from @@ -55,6 +53,7 @@ public final void store( final long referenceOid = instance.objectId(); data.storeEntityHeader(Binary.referenceBinaryLength(1), this.typeId(), objectId); data.store_long(referenceOid); + instance.setStored(); } @SuppressWarnings("unchecked") @@ -75,7 +74,7 @@ public final void updateState( final PersistenceLoadHandler handler ) { - throw new BinaryHandlerOnlyForCopyingException(); + // no-op } @Override 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..7ab5dddd 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 @@ -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/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 index d05c7b64..b3d15d35 100644 --- 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 @@ -15,15 +15,20 @@ */ package software.xdev.spring.data.eclipse.store.integration.isolated.tests.lazy; +import static software.xdev.spring.data.eclipse.store.helper.TestUtil.restartDatastore; + import org.eclipse.serializer.collections.lazy.LazyArrayList; import org.eclipse.serializer.collections.lazy.LazyList; +import org.eclipse.serializer.reference.Lazy; 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.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 @@ -34,10 +39,10 @@ class LazyTest private LazyTestConfiguration configuration; @Test - void lazyListStore(final ObjectWithLazyListRepository repository) + void lazyListStore(@Autowired final ObjectWithLazyListRepository repository) { final ObjectWithLazyList newList = new ObjectWithLazyList(); - final SimpleObject objectToStore = new SimpleObject("Test"); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); final LazyArrayList lazyArrayList = new LazyArrayList(); lazyArrayList.add(objectToStore); newList.setLazyList(lazyArrayList); @@ -53,4 +58,121 @@ void lazyListStore(final ObjectWithLazyListRepository repository) } ); } + + @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 lazyClearBeforeSave(@Autowired final ObjectWithLazyRepository repository) + { + final ObjectWithLazy newLazy = new ObjectWithLazy(); + final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); + newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); + Assertions.assertThrows(IllegalStateException.class, () -> newLazy.getLazy().clear()); + } + + @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 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/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..8f414c44 --- /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 © 2023 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/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..02bcdd93 --- /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 © 2023 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 +{ +} 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 6c3bed83..cc895af2 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 @@ -439,11 +439,6 @@ public static Stream generateData() id -> new LazyDaoObject(id, SpringDataEclipseStoreLazy.build("1")), object -> object.setValue(SpringDataEclipseStoreLazy.build("2")) ), - new TestArguments<>( - LazyRepository.class, - id -> new LazyDaoObject(id, SpringDataEclipseStoreLazy.build("1")), - object -> object.getValue().clear() - ), new TestArguments<>( MapRepository.class, id -> new MapDaoObject(id, new LazyHashMap<>()), From 93f5e0317489a655f201fcf1253f1601b475bfa0 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Tue, 12 Mar 2024 13:49:37 +0100 Subject: [PATCH 05/18] Cleanup Lazy --- .../repository/lazy/LazyInterceptor.java | 22 --------------- .../repository/lazy/LazyProxyGenerator.java | 18 ------------ .../copier/AbstractRegisteringCopier.java | 28 ++++++++++++++----- .../copier/PersistenceManagerProvider.java | 12 -------- ...RegisteringStorageToWorkingCopyCopier.java | 15 +--------- ...RegisteringWorkingCopyToStorageCopier.java | 15 +--------- .../isolated/tests/lazy/LazyTest.java | 12 ++++++++ 7 files changed, 35 insertions(+), 87 deletions(-) delete mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyInterceptor.java delete mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyProxyGenerator.java delete mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/PersistenceManagerProvider.java diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyInterceptor.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyInterceptor.java deleted file mode 100644 index 9ab1a39e..00000000 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyInterceptor.java +++ /dev/null @@ -1,22 +0,0 @@ -package software.xdev.spring.data.eclipse.store.repository.lazy; - -import org.aopalliance.intercept.ConstructorInterceptor; -import org.aopalliance.intercept.ConstructorInvocation; -import org.eclipse.serializer.reference.Lazy; - - -public class LazyInterceptor implements ConstructorInterceptor -{ - private final Lazy originalLazy; - - public LazyInterceptor(final Lazy originalLazy) - { - this.originalLazy = originalLazy; - } - - @Override - public Lazy construct(final ConstructorInvocation invocation) - { - return Lazy.Reference(this.originalLazy.get()); - } -} diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyProxyGenerator.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyProxyGenerator.java deleted file mode 100644 index f9650a98..00000000 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/LazyProxyGenerator.java +++ /dev/null @@ -1,18 +0,0 @@ -package software.xdev.spring.data.eclipse.store.repository.lazy; - -import org.eclipse.serializer.reference.Lazy; -import org.springframework.aop.framework.ProxyFactory; - - -public final class LazyProxyGenerator -{ - private LazyProxyGenerator() - { - } - - public static Lazy generateLazyProxy(final Lazy lazy) - { - final ProxyFactory f = new ProxyFactory(Lazy.class, new LazyInterceptor<>(lazy)); - return (Lazy)f.getProxy(); - } -} diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java index 79acb4c7..65147ba3 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java @@ -20,10 +20,13 @@ 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; /** @@ -37,25 +40,36 @@ public abstract class AbstractRegisteringCopier implements RegisteringObjectCopi public AbstractRegisteringCopier( final SupportedChecker supportedChecker, final RegisteringWorkingCopyAndOriginal register, - final PersistenceManagerProvider persistenceManagerProvider) + final ObjectSwizzling objectSwizzling) { this.actualCopier = new EclipseSerializerRegisteringCopier( supportedChecker, register, - persistenceManagerProvider.createPersistenceManager(this.createSerializerFoundation()) + this.createPersistenceManager( + this.createSerializerFoundation(), + objectSwizzling + ) ); } + private PersistenceManager createPersistenceManager( + final SerializerFoundation serializerFoundation, + final ObjectSwizzling objectSwizzling) + { + return serializerFoundation + .registerCustomTypeHandler(BinaryHandlerImmutableCollectionsSet12.New()) + .registerCustomTypeHandler(BinaryHandlerImmutableCollectionsList12.New()) + .registerCustomTypeHandlers(new SpringDataEclipseStoreLazyBinaryHandler(objectSwizzling)) + .createPersistenceManager(); + } + protected SerializerFoundation createSerializerFoundation() { - final SerializerFoundation newFoundation = SerializerFoundation.New(); - newFoundation.registerCustomTypeHandler(BinaryHandlerImmutableCollectionsSet12.New()); - newFoundation.registerCustomTypeHandler(BinaryHandlerImmutableCollectionsList12.New()); - final Reference buffer = X.Reference(null); final Serializer.Source source = () -> X.Constant(buffer.get()); final Serializer.Target target = buffer::set; - return newFoundation + + return SerializerFoundation.New() .setPersistenceSource(source) .setPersistenceTarget(target) // Make every type persistable. diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/PersistenceManagerProvider.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/PersistenceManagerProvider.java deleted file mode 100644 index 3728da3c..00000000 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/PersistenceManagerProvider.java +++ /dev/null @@ -1,12 +0,0 @@ -package software.xdev.spring.data.eclipse.store.repository.support.copier.copier; - -import org.eclipse.serializer.SerializerFoundation; -import org.eclipse.serializer.persistence.binary.types.Binary; -import org.eclipse.serializer.persistence.types.PersistenceManager; - - -@FunctionalInterface -public interface PersistenceManagerProvider -{ - PersistenceManager createPersistenceManager(SerializerFoundation serializerFoundation); -} diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java index 78bc13e1..49a55b86 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java @@ -15,14 +15,10 @@ */ package software.xdev.spring.data.eclipse.store.repository.support.copier.copier; -import org.eclipse.serializer.SerializerFoundation; -import org.eclipse.serializer.persistence.binary.types.Binary; -import org.eclipse.serializer.persistence.types.PersistenceManager; 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.lazy.SpringDataEclipseStoreLazyBinaryHandler; /** @@ -39,16 +35,7 @@ public RegisteringStorageToWorkingCopyCopier( super( supportedChecker, (workingCopy, objectToStore) -> registry.register(workingCopy, objectToStore), - (serializerFoundation) -> createPersistenceManager(serializerFoundation, objectSwizzling) + objectSwizzling ); } - - private static PersistenceManager createPersistenceManager( - final SerializerFoundation serializerFoundation, - final ObjectSwizzling objectSwizzling) - { - return serializerFoundation - .registerCustomTypeHandlers(new SpringDataEclipseStoreLazyBinaryHandler(objectSwizzling)) - .createPersistenceManager(); - } } diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java index 428c2a81..fd5f8d5b 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java @@ -15,14 +15,10 @@ */ package software.xdev.spring.data.eclipse.store.repository.support.copier.copier; -import org.eclipse.serializer.SerializerFoundation; -import org.eclipse.serializer.persistence.binary.types.Binary; -import org.eclipse.serializer.persistence.types.PersistenceManager; 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.lazy.SpringDataEclipseStoreLazyBinaryHandler; /** @@ -40,16 +36,7 @@ public RegisteringWorkingCopyToStorageCopier( super( supportedChecker, (workingCopy, objectToStore) -> registry.invertRegister(workingCopy, objectToStore), - (serializerFoundation) -> createPersistenceManager(serializerFoundation, objectSwizzling) + objectSwizzling ); } - - private static PersistenceManager createPersistenceManager( - final SerializerFoundation serializerFoundation, - final ObjectSwizzling objectSwizzling) - { - return serializerFoundation - .registerCustomTypeHandlers(new SpringDataEclipseStoreLazyBinaryHandler(objectSwizzling)) - .createPersistenceManager(); - } } 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 index b3d15d35..a4db2dd7 100644 --- 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 @@ -21,6 +21,7 @@ import org.eclipse.serializer.collections.lazy.LazyList; import org.eclipse.serializer.reference.Lazy; 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; @@ -39,6 +40,7 @@ class LazyTest 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(); @@ -86,6 +88,16 @@ void lazyClearBeforeSave(@Autowired final ObjectWithLazyRepository repository) Assertions.assertThrows(IllegalStateException.class, () -> newLazy.getLazy().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) { From 2e1b83946637393f782abc6045ecd260af560817 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Tue, 12 Mar 2024 14:20:49 +0100 Subject: [PATCH 06/18] Added Copyrights --- .../lazy/SpringDataEclipseStoreLazy.java | 15 +++++++++++++++ .../SpringDataEclipseStoreLazyBinaryHandler.java | 15 +++++++++++++++ .../copier/RegisteringWorkingCopyAndOriginal.java | 15 +++++++++++++++ 3 files changed, 45 insertions(+) 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 index c033d650..a3664867 100644 --- 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 @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 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.util.Objects; 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 index b4bb38cf..ccabf0d6 100644 --- 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 @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 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; diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyAndOriginal.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyAndOriginal.java index 1438d835..b1153bae 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyAndOriginal.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyAndOriginal.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2023 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.copier; @FunctionalInterface From d7a1a0e97781bdb554d2ae9abe8729b85989d27e Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Thu, 14 Mar 2024 09:15:02 +0100 Subject: [PATCH 07/18] Simple Lazy working quite well. More complex lazies are not implemented yet. --- .../lazy/SpringDataEclipseStoreLazy.java | 52 ++++-- ...ringDataEclipseStoreLazyBinaryHandler.java | 95 ++++++++--- .../working/RecursiveWorkingCopier.java | 2 +- .../tests/lazy/ComplexLazyObject.java | 55 +++++++ .../isolated/tests/lazy/LazyTest.java | 69 ++++++-- .../isolated/tests/lazy/ObjectWithLazy.java | 8 +- .../tests/lazy/ObjectWithLazyRepository.java | 2 +- .../tests/special/types/TypesData.java | 152 +++++++++--------- 8 files changed, 307 insertions(+), 128 deletions(-) create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ComplexLazyObject.java 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 index a3664867..efc67f56 100644 --- 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 @@ -22,6 +22,12 @@ import org.eclipse.serializer.reference.Swizzling; +/** + * 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. + */ public interface SpringDataEclipseStoreLazy extends Lazy { static SpringDataEclipseStoreLazy.Default build(final T objectToWrapInLazy) @@ -29,15 +35,19 @@ static SpringDataEclipseStoreLazy.Default build(final T objectToWrapInLaz return new Default<>(objectToWrapInLazy); } - static SpringDataEclipseStoreLazy.Default buildOnlyForStorage(final long objectId) - { - return new Default<>(objectId); - } + SpringDataEclipseStoreLazy copy(); long objectId(); + /** + * This class is very complex and its various membervariables all have their reason to exist. This code is very + * difficult to read due to its the functionality explained in the {@link SpringDataEclipseStoreLazyBinaryHandler}. + * + * @param + */ class Default implements SpringDataEclipseStoreLazy { + private T objectToBeWrapped; private Lazy wrappedLazy; private long objectId = Swizzling.notFoundId(); private transient ObjectSwizzling loader; @@ -45,7 +55,7 @@ class Default implements SpringDataEclipseStoreLazy private Default(final T wrappedObject) { - this.wrappedLazy = Lazy.Reference(wrappedObject); + this.objectToBeWrapped = wrappedObject; } private Default(final long objectId, final ObjectSwizzling loader) @@ -54,11 +64,6 @@ private Default(final long objectId, final ObjectSwizzling loader) this.loader = loader; } - private Default(final long objectId) - { - this.objectId = objectId; - } - private Lazy ensureLazy() { if(this.wrappedLazy == null) @@ -80,6 +85,10 @@ public static final Class> genericType() @Override public T get() { + if(this.objectToBeWrapped != null) + { + return this.objectToBeWrapped; + } return this.ensureLazy().get(); } @@ -116,6 +125,10 @@ void setStored() @Override public boolean isLoaded() { + if(this.objectToBeWrapped != null) + { + return true; + } if(this.wrappedLazy == null) { return false; @@ -148,5 +161,24 @@ public long objectId() } return this.objectId; } + + void setWrappedLazy(final Lazy wrappedLazy) + { + this.wrappedLazy = wrappedLazy; + } + + public T getObjectToBeWrapped() + { + return this.objectToBeWrapped; + } + + @Override + public SpringDataEclipseStoreLazy copy() + { + return new SpringDataEclipseStoreLazy.Default( + this.objectId, + this.loader + ); + } } } 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 index ccabf0d6..7d061f44 100644 --- 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 @@ -18,8 +18,10 @@ 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; @@ -29,14 +31,30 @@ /** - * Copied from - * {@link org.eclipse.serializer.persistence.binary.org.eclipse.serializer.reference.BinaryHandlerLazyDefault}. + * 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.copier.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.copier.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 = XReflect.setAccessible( + static final Constructor CONSTRUCTOR_SURROGATE_LAZY = XReflect.setAccessible( XReflect.getDeclaredConstructor( SpringDataEclipseStoreLazy.Default.class, long.class, @@ -44,52 +62,84 @@ public final class SpringDataEclipseStoreLazyBinaryHandler ) ); - private final ObjectSwizzling objectSwizzling; + public static final int OFFSET_UNWRAPPED_OBJECT = 8; + public static final int OFFSET_LAZY = 0; - public SpringDataEclipseStoreLazyBinaryHandler(final ObjectSwizzling objectSwizzling) + private final ObjectSwizzling originalStoreLoader; + + public SpringDataEclipseStoreLazyBinaryHandler(final ObjectSwizzling originalStoreLoader) { super( SpringDataEclipseStoreLazy.Default.genericType(), CustomFields( - CustomField(Object.class, "subject") + CustomField(Object.class, "lazySubject"), + CustomField(Object.class, "unwrappedSubject") ) ); - this.objectSwizzling = Objects.requireNonNull(objectSwizzling); + this.originalStoreLoader = Objects.requireNonNull(originalStoreLoader); } @Override - public final void store( + public void store( final Binary data, final SpringDataEclipseStoreLazy.Default instance, final long objectId, final PersistenceStoreHandler handler ) { - final long referenceOid = instance.objectId(); - data.storeEntityHeader(Binary.referenceBinaryLength(1), this.typeId(), objectId); - data.store_long(referenceOid); + data.storeEntityHeader(Binary.referenceBinaryLength(2), this.typeId(), objectId); + if(instance.getObjectToBeWrapped() != null) + { + // Store unwrapped Object + final long newObjectId = handler.applyEager(instance.getObjectToBeWrapped()); + data.store_long(OFFSET_UNWRAPPED_OBJECT, newObjectId); + } + else + { + // Store only reference to lazy + data.store_long(OFFSET_LAZY, instance.objectId()); + } instance.setStored(); } @SuppressWarnings("unchecked") @Override - public final SpringDataEclipseStoreLazy.Default create(final Binary data, final PersistenceLoadHandler handler) + public SpringDataEclipseStoreLazy.Default create(final Binary data, final PersistenceLoadHandler handler) { - final long objectId = data.read_long(0); + final long objectIdOfLazy = data.read_long(OFFSET_LAZY); + final long objectIdOfUnwrappedObject = data.read_long(OFFSET_UNWRAPPED_OBJECT); - return Lazy.register( - XReflect.invoke(CONSTRUCTOR, objectId, this.objectSwizzling) - ); + if(objectIdOfUnwrappedObject == 0) + { + return Lazy.register( + XReflect.invoke(CONSTRUCTOR_SURROGATE_LAZY, objectIdOfLazy, this.originalStoreLoader) + ); + } + return XMemory.instantiateBlank(SpringDataEclipseStoreLazy.Default.class); } @Override - public final void updateState( + public void updateState( final Binary data, final SpringDataEclipseStoreLazy.Default instance, final PersistenceLoadHandler handler ) { - // no-op + 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))); + } } @Override @@ -122,10 +172,15 @@ public final boolean hasVaryingPersistedLengthInstances() @Override public final void iterateLoadableReferences( - final Binary offset, + final Binary data, final PersistenceReferenceLoader iterator ) { - // the lazy reference is not naturally loadable, but special-handled by this handler + 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/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 49be55e8..3120009e 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 @@ -330,7 +330,7 @@ private SpringDataEclipseStoreLazy createNewLazy( { // 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)SpringDataEclipseStoreLazy.buildOnlyForStorage(oldLazy.objectId()); + return oldLazy.copy(); } } 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..07b57b68 --- /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 © 2023 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 index a4db2dd7..a088bedb 100644 --- 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 @@ -17,6 +17,9 @@ import static software.xdev.spring.data.eclipse.store.helper.TestUtil.restartDatastore; +import java.util.ArrayList; +import java.util.Arrays; + import org.eclipse.serializer.collections.lazy.LazyArrayList; import org.eclipse.serializer.collections.lazy.LazyList; import org.eclipse.serializer.reference.Lazy; @@ -45,7 +48,7 @@ void lazyListStore(@Autowired final ObjectWithLazyListRepository repository) { final ObjectWithLazyList newList = new ObjectWithLazyList(); final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); - final LazyArrayList lazyArrayList = new LazyArrayList(); + final LazyArrayList lazyArrayList = new LazyArrayList<>(); lazyArrayList.add(objectToStore); newList.setLazyList(lazyArrayList); repository.save(newList); @@ -62,9 +65,9 @@ void lazyListStore(@Autowired final ObjectWithLazyListRepository repository) } @Test - void lazyStore(@Autowired final ObjectWithLazyRepository repository) + void lazyStore(@Autowired final ObjectWithLazyRepository repository) { - final ObjectWithLazy newLazy = new ObjectWithLazy(); + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); repository.save(newLazy); @@ -80,9 +83,43 @@ void lazyStore(@Autowired final ObjectWithLazyRepository repository) } @Test - void lazyClearBeforeSave(@Autowired final ObjectWithLazyRepository repository) + 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 lazyClearBeforeSave() { - final ObjectWithLazy newLazy = new ObjectWithLazy(); + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); Assertions.assertThrows(IllegalStateException.class, () -> newLazy.getLazy().clear()); @@ -90,18 +127,18 @@ void lazyClearBeforeSave(@Autowired final ObjectWithLazyRepository repository) @Test @Disabled("This should work at some point. At least a warning should be displayed.") - void lazyUseEclipseStoreLazy(@Autowired final ObjectWithLazyRepository repository) + void lazyUseEclipseStoreLazy(@Autowired final ObjectWithLazyRepository repository) { - final ObjectWithLazy newLazy = new ObjectWithLazy(); + 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) + void lazyClearAfterSave(@Autowired final ObjectWithLazyRepository repository) { - final ObjectWithLazy newLazy = new ObjectWithLazy(); + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); repository.save(newLazy); @@ -118,9 +155,9 @@ void lazyClearAfterSave(@Autowired final ObjectWithLazyRepository repository) } @Test - void lazyChangeAfterSave(@Autowired final ObjectWithLazyRepository repository) + void lazyChangeAfterSave(@Autowired final ObjectWithLazyRepository repository) { - final ObjectWithLazy newLazy = new ObjectWithLazy(); + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); repository.save(newLazy); @@ -140,9 +177,9 @@ void lazyChangeAfterSave(@Autowired final ObjectWithLazyRepository repository) } @Test - void lazyChangeBeforeSave(@Autowired final ObjectWithLazyRepository repository) + void lazyChangeBeforeSave(@Autowired final ObjectWithLazyRepository repository) { - final ObjectWithLazy newLazy = new ObjectWithLazy(); + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); @@ -161,9 +198,9 @@ void lazyChangeBeforeSave(@Autowired final ObjectWithLazyRepository repository) } @Test - void lazyChangeAfterRestart(@Autowired final ObjectWithLazyRepository repository) + void lazyChangeAfterRestart(@Autowired final ObjectWithLazyRepository repository) { - final ObjectWithLazy newLazy = new ObjectWithLazy(); + final ObjectWithLazy newLazy = new ObjectWithLazy<>(); final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); repository.save(newLazy); @@ -171,7 +208,7 @@ void lazyChangeAfterRestart(@Autowired final ObjectWithLazyRepository repository restartDatastore(this.configuration); Assertions.assertEquals(1, repository.findAll().size()); - final ObjectWithLazy reloadedObjectWithLazy = repository.findAll().get(0); + final ObjectWithLazy reloadedObjectWithLazy = repository.findAll().get(0); Assertions.assertEquals(objectToStore, reloadedObjectWithLazy.getLazy().get()); final SimpleObject objectToStore2 = new SimpleObject(TestData.DUMMY_STRING_ALTERNATIVE); 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 index 8f414c44..88a8eeb8 100644 --- 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 @@ -18,16 +18,16 @@ import org.eclipse.serializer.reference.Lazy; -public class ObjectWithLazy +public class ObjectWithLazy { - private Lazy lazy; + private Lazy lazy; - public Lazy getLazy() + public Lazy getLazy() { return this.lazy; } - public void setLazy(final Lazy 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/ObjectWithLazyRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyRepository.java index 02bcdd93..aab0c595 100644 --- 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 @@ -18,6 +18,6 @@ import org.springframework.data.repository.ListCrudRepository; -public interface ObjectWithLazyRepository extends 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/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 cc895af2..91241667 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 @@ -111,32 +111,6 @@ public static Stream generateData() id -> new SetDaoObject(id, new HashSet<>(List.of("1", "2"))), set -> set.getValue().add("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<>( SetRepository.class, id -> new SetDaoObject(id, new TreeSet<>()), @@ -273,32 +247,6 @@ public static Stream generateData() }, object -> object.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<>( ListRepository.class, id -> new ListDaoObject(id, new ArrayList<>(Set.of("1"))), @@ -438,30 +386,6 @@ public static Stream generateData() LazyRepository.class, id -> new LazyDaoObject(id, SpringDataEclipseStoreLazy.build("1")), object -> object.setValue(SpringDataEclipseStoreLazy.build("2")) - ), - new TestArguments<>( - MapRepository.class, - id -> new MapDaoObject(id, new LazyHashMap<>()), - set -> set.getValue().put("1", "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") ) ) ).toArguments(); @@ -510,6 +434,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(); From 6e1c20ab2e0a262f2d8e7c33f3ddc57837e3c055 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Tue, 19 Mar 2024 10:21:17 +0100 Subject: [PATCH 08/18] Fixed lazy tests --- .../data/eclipse/store/repository/SupportedChecker.java | 8 +++++++- .../isolated/tests/special/types/LazyDaoObject.java | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) 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 832ad604..9f143ab3 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 @@ -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; @@ -51,7 +54,10 @@ class Implementation implements SupportedChecker 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 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 641d8531..ad8f6f8d 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 @@ -39,7 +39,9 @@ public boolean equals(final Object o) return false; } final ComplexObject> that = (ComplexObject>)o; - return Objects.equals(this.getId(), that.getId()) && Objects.equals( + return Objects.equals(this.getId(), that.getId()) && + (this.getValue() == null && that.getValue() == null) || + Objects.equals( this.getValue().get(), that.getValue().get()); } From 10f29b844db57ee81e6c815678bec6d16975cc5d Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Wed, 20 Mar 2024 14:05:32 +0100 Subject: [PATCH 09/18] Added tests for lazy handling --- .../LazyNotUnlinkableException.java | 24 +++ .../store/repository/access/AccessHelper.java | 2 +- .../access/modifier/FieldAccessModifier.java | 2 +- .../lazy/SpringDataEclipseStoreLazy.java | 83 ++++++++- ...ringDataEclipseStoreLazyBinaryHandler.java | 4 +- .../support/SimpleEclipseStoreRepository.java | 6 +- .../support/copier/id/SimpleIdSetter.java | 2 +- .../working/RecursiveWorkingCopier.java | 54 ++++-- .../isolated/tests/lazy/LazyTest.java | 165 ++++++++++++++++++ 9 files changed, 311 insertions(+), 31 deletions(-) create mode 100644 spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/LazyNotUnlinkableException.java 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..8c89e5cc --- /dev/null +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/LazyNotUnlinkableException.java @@ -0,0 +1,24 @@ +/* + * Copyright © 2023 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; + +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/repository/access/AccessHelper.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/access/AccessHelper.java index 29039059..e77ef59f 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 @@ -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..bd56de35 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 @@ -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/lazy/SpringDataEclipseStoreLazy.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazy.java index efc67f56..0a246fa3 100644 --- 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 @@ -15,12 +15,16 @@ */ 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; + /** * This is the Lazy-Wrapper a user of the Spring-Data-Eclipse-Store-Library should use. Please do not use the @@ -35,10 +39,22 @@ static SpringDataEclipseStoreLazy.Default build(final T objectToWrapInLaz return new Default<>(objectToWrapInLazy); } - SpringDataEclipseStoreLazy copy(); + SpringDataEclipseStoreLazy copyOnlyWithReference(); + + void unlink(); long objectId(); + boolean isOriginalObject(); + + interface Internals + { + static SpringDataEclipseStoreLazy.Default build(final Lazy lazySubject) + { + return new Default<>(lazySubject); + } + } + /** * This class is very complex and its various membervariables all have their reason to exist. This code is very * difficult to read due to its the functionality explained in the {@link SpringDataEclipseStoreLazyBinaryHandler}. @@ -53,28 +69,44 @@ class Default implements SpringDataEclipseStoreLazy private transient ObjectSwizzling loader; private transient boolean isStored = false; - private Default(final T wrappedObject) + private Default(final Lazy lazySubject) { - this.objectToBeWrapped = wrappedObject; + this.setWrappedLazy(lazySubject); + } + + private Default(final T objectToBeWrapped) + { + this.objectToBeWrapped = objectToBeWrapped; } private Default(final long objectId, final ObjectSwizzling loader) { this.objectId = objectId; this.loader = loader; + // This object is already stored in the real storage. So it can get cleared. + this.setStored(); } private Lazy ensureLazy() { - if(this.wrappedLazy == null) + if(this.wrappedLazy == null || !this.wrappedLazy.isLoaded()) { - Objects.requireNonNull(this.loader); - Objects.requireNonNull(this.objectId); - this.wrappedLazy = Lazy.Reference((T)this.loader.getObject(this.objectId)); + this.wrappedLazy = this.createNewDefaultLazyWithClearableReference(); } return this.wrappedLazy; } + private Lazy createNewDefaultLazyWithClearableReference() + { + Objects.requireNonNull(this.loader); + Objects.requireNonNull(this.objectId); + return Lazy.New( + (T)this.loader.getObject(this.objectId), + Swizzling.nullId(), + this.loader + ); + } + @SuppressWarnings("all") public static final Class> genericType() { @@ -165,6 +197,8 @@ public long 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() @@ -173,12 +207,43 @@ public T getObjectToBeWrapped() } @Override - public SpringDataEclipseStoreLazy copy() + public SpringDataEclipseStoreLazy copyOnlyWithReference() { return new SpringDataEclipseStoreLazy.Default( - this.objectId, + this.objectId(), this.loader ); } + + // TODO is this necessary? + @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)) + { + 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 index 7d061f44..163dd1bd 100644 --- 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 @@ -88,7 +88,7 @@ public void store( ) { data.storeEntityHeader(Binary.referenceBinaryLength(2), this.typeId(), objectId); - if(instance.getObjectToBeWrapped() != null) + if(instance.isOriginalObject()) { // Store unwrapped Object final long newObjectId = handler.applyEager(instance.getObjectToBeWrapped()); @@ -139,6 +139,8 @@ private void updateStateT( if(objectIdOfUnwrappedObject != 0) { instance.setWrappedLazy(Lazy.Reference((T)handler.lookupObject(objectIdOfUnwrappedObject))); + // Is already stored in the main storage. + instance.setStored(); } } 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..2672f9d9 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 @@ -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/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..4be7128d 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 @@ -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/working/RecursiveWorkingCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/working/RecursiveWorkingCopier.java index 3120009e..8bc48a43 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 @@ -27,6 +27,7 @@ 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; @@ -152,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); @@ -217,7 +218,7 @@ private void mergeValueOfField( return; } - try(final FieldAccessModifier fam = FieldAccessModifier.makeFieldReadable( + try(final FieldAccessModifier fam = FieldAccessModifier.prepareForField( field, sourceObject)) { @@ -262,6 +263,7 @@ else if(DataTypeUtil.isSpringDataEclipseStoreLazy(valueOfSourceObject)) final SpringDataEclipseStoreLazy newLazy = this.createNewLazy( (SpringDataEclipseStoreLazy)valueOfSourceObject, + (SpringDataEclipseStoreLazy)valueOfTargetObject, alreadyMergedTargets, changedCollector); fam.writeValueOfField(targetObject, newLazy, true); @@ -313,25 +315,47 @@ else if(DataTypeUtil.isSpringDataEclipseStoreLazy(valueOfSourceObject)) private SpringDataEclipseStoreLazy createNewLazy( final SpringDataEclipseStoreLazy oldLazy, + final SpringDataEclipseStoreLazy newLazy, final MergedTargetsCollector alreadyMergedTargets, final ChangedObjectCollector changedCollector ) { - if(oldLazy.isLoaded()) - { - final E copyOfWrappedObject = this.getOrCreateObjectForDatastore( - oldLazy.get(), - true, - alreadyMergedTargets, - changedCollector); - return SpringDataEclipseStoreLazy.build(copyOfWrappedObject); - } - else + if(oldLazy.isLoaded()) + { + if(oldLazy.isOriginalObject()) { - // This lazy should never be used again! - // It is though of as a temporary copy to merge back into the original-storage-data. - return oldLazy.copy(); + // 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 + { + final Lazy newLazyForBuilding = Lazy.Reference(oldLazy.get()); + oldLazy.unlink(); + newLazy.unlink(); + // This object is already stored but the new version must get overwritten. + return SpringDataEclipseStoreLazy.Internals.build(newLazyForBuilding); + } } + 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.copyOnlyWithReference(); + } } /** 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 index a088bedb..2b36e26e 100644 --- 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 @@ -19,10 +19,12 @@ 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; @@ -82,6 +84,107 @@ void lazyStore(@Autowired final ObjectWithLazyRepository repositor ); } + @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) { @@ -116,6 +219,55 @@ 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); + + 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 lazyClearBeforeSave() { @@ -154,6 +306,19 @@ void lazyClearAfterSave(@Autowired final ObjectWithLazyRepository ); } + @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) { From 6b8f038eaba707d872ae88ac5cbcf9d11a9fb5f7 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Wed, 17 Apr 2024 12:53:24 +0200 Subject: [PATCH 10/18] Most tests for lazy working --- .../store/repository/WorkingCopyRegistry.java | 3 +++ .../repository/lazy/SpringDataEclipseStoreLazy.java | 11 ++++++++--- .../SpringDataEclipseStoreLazyBinaryHandler.java | 13 ++++++++++--- .../copier/copier/AbstractRegisteringCopier.java | 2 +- 4 files changed, 22 insertions(+), 7 deletions(-) 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..9674fdb7 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 @@ -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/lazy/SpringDataEclipseStoreLazy.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazy.java index 0a246fa3..37f04934 100644 --- 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 @@ -24,6 +24,7 @@ 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.copier.RegisteringObjectCopier; /** @@ -67,6 +68,7 @@ class Default implements SpringDataEclipseStoreLazy private Lazy wrappedLazy; private long objectId = Swizzling.notFoundId(); private transient ObjectSwizzling loader; + private transient RegisteringObjectCopier copier; private transient boolean isStored = false; private Default(final Lazy lazySubject) @@ -79,10 +81,11 @@ private Default(final T objectToBeWrapped) this.objectToBeWrapped = objectToBeWrapped; } - private Default(final long objectId, final ObjectSwizzling loader) + private Default(final long objectId, final ObjectSwizzling loader, final RegisteringObjectCopier 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(); } @@ -100,8 +103,9 @@ private Lazy createNewDefaultLazyWithClearableReference() { Objects.requireNonNull(this.loader); Objects.requireNonNull(this.objectId); + Objects.requireNonNull(this.copier); return Lazy.New( - (T)this.loader.getObject(this.objectId), + (T)this.copier.copy(this.loader.getObject(this.objectId)), Swizzling.nullId(), this.loader ); @@ -211,7 +215,8 @@ public SpringDataEclipseStoreLazy copyOnlyWithReference() { return new SpringDataEclipseStoreLazy.Default( this.objectId(), - this.loader + this.loader, + this.copier ); } 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 index 163dd1bd..d591e5dc 100644 --- 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 @@ -29,6 +29,8 @@ import org.eclipse.serializer.reference.ObjectSwizzling; import org.eclipse.serializer.reflect.XReflect; +import software.xdev.spring.data.eclipse.store.repository.support.copier.copier.RegisteringObjectCopier; + /** * This is a complicated one. First off: this handler should only be used for WorkingCopies (see @@ -58,7 +60,8 @@ public final class SpringDataEclipseStoreLazyBinaryHandler XReflect.getDeclaredConstructor( SpringDataEclipseStoreLazy.Default.class, long.class, - ObjectSwizzling.class + ObjectSwizzling.class, + RegisteringObjectCopier.class ) ); @@ -66,8 +69,11 @@ public final class SpringDataEclipseStoreLazyBinaryHandler public static final int OFFSET_LAZY = 0; private final ObjectSwizzling originalStoreLoader; + private final RegisteringObjectCopier copier; - public SpringDataEclipseStoreLazyBinaryHandler(final ObjectSwizzling originalStoreLoader) + public SpringDataEclipseStoreLazyBinaryHandler( + final ObjectSwizzling originalStoreLoader, + final RegisteringObjectCopier copier) { super( SpringDataEclipseStoreLazy.Default.genericType(), @@ -77,6 +83,7 @@ public SpringDataEclipseStoreLazyBinaryHandler(final ObjectSwizzling originalSto ) ); this.originalStoreLoader = Objects.requireNonNull(originalStoreLoader); + this.copier = copier; } @Override @@ -112,7 +119,7 @@ public SpringDataEclipseStoreLazy.Default create(final Binary data, final Per if(objectIdOfUnwrappedObject == 0) { return Lazy.register( - XReflect.invoke(CONSTRUCTOR_SURROGATE_LAZY, objectIdOfLazy, this.originalStoreLoader) + XReflect.invoke(CONSTRUCTOR_SURROGATE_LAZY, objectIdOfLazy, this.originalStoreLoader, this.copier) ); } return XMemory.instantiateBlank(SpringDataEclipseStoreLazy.Default.class); diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java index 65147ba3..945ef8e6 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java @@ -59,7 +59,7 @@ private PersistenceManager createPersistenceManager( return serializerFoundation .registerCustomTypeHandler(BinaryHandlerImmutableCollectionsSet12.New()) .registerCustomTypeHandler(BinaryHandlerImmutableCollectionsList12.New()) - .registerCustomTypeHandlers(new SpringDataEclipseStoreLazyBinaryHandler(objectSwizzling)) + .registerCustomTypeHandlers(new SpringDataEclipseStoreLazyBinaryHandler(objectSwizzling, this)) .createPersistenceManager(); } From 5335fac88c90bd54eff58ef21af10f48abe02933 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Thu, 18 Apr 2024 15:06:06 +0200 Subject: [PATCH 11/18] Lazy working with tests --- .../store/repository/EclipseStoreStorage.java | 2 + .../lazy/SpringDataEclipseStoreLazy.java | 24 ++++++---- ...ringDataEclipseStoreLazyBinaryHandler.java | 8 ++-- .../copier/AbstractRegisteringCopier.java | 12 +++-- ...RegisteringStorageToWorkingCopyCopier.java | 7 ++- ...RegisteringWorkingCopyToStorageCopier.java | 7 ++- .../working/RecursiveWorkingCopier.java | 27 ++++++++---- .../support/copier/working/WorkingCopier.java | 2 + .../store/helper/DummyWorkingCopier.java | 6 +++ .../isolated/tests/lazy/LazyTest.java | 44 +++++++++++++++++++ ...steringStorageToWorkingCopyCopierTest.java | 15 ++++--- 11 files changed, 120 insertions(+), 34 deletions(-) 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 07b06e8a..b4d8145f 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 @@ -26,6 +26,7 @@ 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; @@ -273,6 +274,7 @@ public synchronized void stop() this.registry.reset(); this.entityClassToIdSetter.clear(); LOG.info("Stopped storage."); + LazyReferenceManager.get().stop(); } else { 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 index 37f04934..fef25ac7 100644 --- 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 @@ -24,7 +24,7 @@ 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.copier.RegisteringObjectCopier; +import software.xdev.spring.data.eclipse.store.repository.support.copier.working.WorkingCopier; /** @@ -40,7 +40,7 @@ static SpringDataEclipseStoreLazy.Default build(final T objectToWrapInLaz return new Default<>(objectToWrapInLazy); } - SpringDataEclipseStoreLazy copyOnlyWithReference(); + SpringDataEclipseStoreLazy copyWithReference(); void unlink(); @@ -50,7 +50,7 @@ static SpringDataEclipseStoreLazy.Default build(final T objectToWrapInLaz interface Internals { - static SpringDataEclipseStoreLazy.Default build(final Lazy lazySubject) + static SpringDataEclipseStoreLazy.Default buildWithLazy(final Lazy lazySubject) { return new Default<>(lazySubject); } @@ -68,7 +68,7 @@ class Default implements SpringDataEclipseStoreLazy private Lazy wrappedLazy; private long objectId = Swizzling.notFoundId(); private transient ObjectSwizzling loader; - private transient RegisteringObjectCopier copier; + private transient WorkingCopier copier; private transient boolean isStored = false; private Default(final Lazy lazySubject) @@ -81,7 +81,7 @@ private Default(final T objectToBeWrapped) this.objectToBeWrapped = objectToBeWrapped; } - private Default(final long objectId, final ObjectSwizzling loader, final RegisteringObjectCopier copier) + private Default(final long objectId, final ObjectSwizzling loader, final WorkingCopier copier) { this.objectId = objectId; this.loader = loader; @@ -104,8 +104,12 @@ private Lazy createNewDefaultLazyWithClearableReference() Objects.requireNonNull(this.loader); Objects.requireNonNull(this.objectId); Objects.requireNonNull(this.copier); + + final T originalInstance = (T)this.loader.getObject(this.objectId); + final T copiedInstance = this.copier.onlyCreateCopy(originalInstance, false); + return Lazy.New( - (T)this.copier.copy(this.loader.getObject(this.objectId)), + copiedInstance, Swizzling.nullId(), this.loader ); @@ -211,13 +215,15 @@ public T getObjectToBeWrapped() } @Override - public SpringDataEclipseStoreLazy copyOnlyWithReference() + public SpringDataEclipseStoreLazy copyWithReference() { - return new SpringDataEclipseStoreLazy.Default( + final SpringDataEclipseStoreLazy.Default newLazy = new SpringDataEclipseStoreLazy.Default( this.objectId(), this.loader, this.copier ); + newLazy.wrappedLazy = this.wrappedLazy; + return newLazy; } // TODO is this necessary? @@ -235,6 +241,8 @@ public void unlink() 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); } } 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 index d591e5dc..13324385 100644 --- 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 @@ -29,7 +29,7 @@ import org.eclipse.serializer.reference.ObjectSwizzling; import org.eclipse.serializer.reflect.XReflect; -import software.xdev.spring.data.eclipse.store.repository.support.copier.copier.RegisteringObjectCopier; +import software.xdev.spring.data.eclipse.store.repository.support.copier.working.WorkingCopier; /** @@ -61,7 +61,7 @@ public final class SpringDataEclipseStoreLazyBinaryHandler SpringDataEclipseStoreLazy.Default.class, long.class, ObjectSwizzling.class, - RegisteringObjectCopier.class + WorkingCopier.class ) ); @@ -69,11 +69,11 @@ public final class SpringDataEclipseStoreLazyBinaryHandler public static final int OFFSET_LAZY = 0; private final ObjectSwizzling originalStoreLoader; - private final RegisteringObjectCopier copier; + private final WorkingCopier copier; public SpringDataEclipseStoreLazyBinaryHandler( final ObjectSwizzling originalStoreLoader, - final RegisteringObjectCopier copier) + final WorkingCopier copier) { super( SpringDataEclipseStoreLazy.Default.genericType(), diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java index 945ef8e6..51ef272e 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java @@ -27,6 +27,7 @@ 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; /** @@ -40,26 +41,29 @@ public abstract class AbstractRegisteringCopier implements RegisteringObjectCopi public AbstractRegisteringCopier( final SupportedChecker supportedChecker, final RegisteringWorkingCopyAndOriginal register, - final ObjectSwizzling objectSwizzling) + final ObjectSwizzling objectSwizzling, + final WorkingCopier copier) { this.actualCopier = new EclipseSerializerRegisteringCopier( supportedChecker, register, this.createPersistenceManager( this.createSerializerFoundation(), - objectSwizzling + objectSwizzling, + copier ) ); } private PersistenceManager createPersistenceManager( final SerializerFoundation serializerFoundation, - final ObjectSwizzling objectSwizzling) + final ObjectSwizzling objectSwizzling, + final WorkingCopier copier) { return serializerFoundation .registerCustomTypeHandler(BinaryHandlerImmutableCollectionsSet12.New()) .registerCustomTypeHandler(BinaryHandlerImmutableCollectionsList12.New()) - .registerCustomTypeHandlers(new SpringDataEclipseStoreLazyBinaryHandler(objectSwizzling, this)) + .registerCustomTypeHandlers(new SpringDataEclipseStoreLazyBinaryHandler(objectSwizzling, copier)) .createPersistenceManager(); } diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java index 49a55b86..11084ac4 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java @@ -19,6 +19,7 @@ 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; /** @@ -30,12 +31,14 @@ public class RegisteringStorageToWorkingCopyCopier extends AbstractRegisteringCo public RegisteringStorageToWorkingCopyCopier( final WorkingCopyRegistry registry, final SupportedChecker supportedChecker, - final ObjectSwizzling objectSwizzling) + final ObjectSwizzling objectSwizzling, + final WorkingCopier copier) { super( supportedChecker, (workingCopy, objectToStore) -> registry.register(workingCopy, objectToStore), - objectSwizzling + objectSwizzling, + copier ); } } diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java index fd5f8d5b..e137ff5c 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java @@ -19,6 +19,7 @@ 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; /** @@ -31,12 +32,14 @@ public class RegisteringWorkingCopyToStorageCopier extends AbstractRegisteringCo public RegisteringWorkingCopyToStorageCopier( final WorkingCopyRegistry registry, final SupportedChecker supportedChecker, - final ObjectSwizzling objectSwizzling) + final ObjectSwizzling objectSwizzling, + final WorkingCopier copier) { super( supportedChecker, (workingCopy, objectToStore) -> registry.invertRegister(workingCopy, objectToStore), - objectSwizzling + objectSwizzling, + copier ); } } 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 8bc48a43..25279520 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 @@ -70,9 +70,9 @@ public RecursiveWorkingCopier( this.domainClass = domainClass; this.registry = registry; this.workingCopyToStorageCopier = - new RegisteringWorkingCopyToStorageCopier(registry, supportedChecker, objectSwizzling); + new RegisteringWorkingCopyToStorageCopier(registry, supportedChecker, objectSwizzling, this); this.storageToWorkingCopyCopier = - new RegisteringStorageToWorkingCopyCopier(registry, supportedChecker, objectSwizzling); + new RegisteringStorageToWorkingCopyCopier(registry, supportedChecker, objectSwizzling, this); this.idSetterProvider = idSetterProvider; this.persistableChecker = persistableChecker; } @@ -182,12 +182,14 @@ 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, @@ -333,11 +335,17 @@ private SpringDataEclipseStoreLazy createNewLazy( } else { - final Lazy newLazyForBuilding = Lazy.Reference(oldLazy.get()); + // 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(); - // This object is already stored but the new version must get overwritten. - return SpringDataEclipseStoreLazy.Internals.build(newLazyForBuilding); + + return SpringDataEclipseStoreLazy.Internals.buildWithLazy(Lazy.Reference(copyOfWrappedObject)); } } final E copyOfWrappedObject = this.getOrCreateObjectForDatastore( @@ -354,7 +362,7 @@ private SpringDataEclipseStoreLazy createNewLazy( 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.copyOnlyWithReference(); + return (SpringDataEclipseStoreLazy)newLazy.copyWithReference(); } } @@ -396,7 +404,8 @@ private E[] createGenericObjectArray( return newArray; } - private E onlyCreateCopy(final E objectToCopy, final boolean invertRegistry) + @Override + public E onlyCreateCopy(final E objectToCopy, final boolean invertRegistry) { if(invertRegistry) { 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..43a8f928 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 @@ -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/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..2875144c 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 @@ -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/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 index 2b36e26e..dd1ce194 100644 --- 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 @@ -268,6 +268,50 @@ 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); + 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() { diff --git a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopierTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopierTest.java index a7f44591..d0e3a72f 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopierTest.java +++ b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopierTest.java @@ -38,7 +38,8 @@ void testCopyManyCopiesSingle() new RegisteringStorageToWorkingCopyCopier( new WorkingCopyRegistry(), new SupportedChecker.Implementation(), - o -> null)) + o -> null, + null)) { final List originalObjects = IntStream.range(0, 1_000).mapToObj( i -> new DummyData("Data" + i, i) @@ -57,7 +58,8 @@ void testCopyAgainSameObject() new RegisteringStorageToWorkingCopyCopier( new WorkingCopyRegistry(), new SupportedChecker.Implementation(), - o -> null)) + o -> null, + null)) { final DummyData originalObject = new DummyData("Test", 1); @@ -75,7 +77,8 @@ void testCopyAgainTheCopy() new RegisteringStorageToWorkingCopyCopier( new WorkingCopyRegistry(), new SupportedChecker.Implementation(), - o -> null)) + o -> null, + null)) { final DummyData originalObject = new DummyData("Test", 1); @@ -95,7 +98,8 @@ void testCopyManyCopiesBulk() new RegisteringStorageToWorkingCopyCopier( new WorkingCopyRegistry(), new SupportedChecker.Implementation(), - o -> null)) + o -> null, + null)) { final List originalObjects = IntStream.range(0, 100_000).mapToObj( i -> new DummyData("Data" + i, i) @@ -114,7 +118,8 @@ void testCopyEmpty() new RegisteringStorageToWorkingCopyCopier( new WorkingCopyRegistry(), new SupportedChecker.Implementation(), - o -> null)) + o -> null, + null)) { Assertions.assertThrows(NullPointerException.class, () -> copier.copy(null)); } From 6f9f53cf0d4fd605a051729ea0d6f24266c43061 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Mon, 22 Apr 2024 09:07:59 +0200 Subject: [PATCH 12/18] Added docs and demos for lazy --- CHANGELOG.md | 1 + docs/modules/ROOT/nav.adoc | 1 + docs/modules/ROOT/pages/known-issues.adoc | 8 ---- docs/modules/ROOT/pages/lazies.adoc | 40 +++++++++++++++++++ .../demo/complex/ComplexDemoApplication.java | 11 +++++ .../store/demo/complex/owner/Owner.java | 11 ++++- .../demo/complex/owner/OwnerRepository.java | 4 ++ .../lazy/SpringDataEclipseStoreLazy.java | 29 ++++++-------- ...ringDataEclipseStoreLazyBinaryHandler.java | 2 +- 9 files changed, 79 insertions(+), 28 deletions(-) create mode 100644 docs/modules/ROOT/pages/lazies.adoc diff --git a/CHANGELOG.md b/CHANGELOG.md index 96797abe..a11d28d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # 1.0.4 * Added possibility to use multiple storages +* Added Lazy support # 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..f568afee --- /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. +All Lazy References would be resolved and loaded into memory anyway. + +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/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 index fef25ac7..56d3aa7b 100644 --- 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 @@ -32,6 +32,8 @@ * {@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 { @@ -57,11 +59,12 @@ static SpringDataEclipseStoreLazy.Default buildWithLazy(final Lazy laz } /** - * This class is very complex and its various membervariables all have their reason to exist. This code is very + * 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 + * @param the type of the lazily referenced element */ + @SuppressWarnings({"java:S2065", "checkstyle:FinalClass"}) class Default implements SpringDataEclipseStoreLazy { private T objectToBeWrapped; @@ -69,7 +72,7 @@ class Default implements SpringDataEclipseStoreLazy private long objectId = Swizzling.notFoundId(); private transient ObjectSwizzling loader; private transient WorkingCopier copier; - private transient boolean isStored = false; + private transient boolean isStored; private Default(final Lazy lazySubject) { @@ -99,10 +102,10 @@ private Lazy ensureLazy() return this.wrappedLazy; } + @SuppressWarnings("unchecked") private Lazy createNewDefaultLazyWithClearableReference() { Objects.requireNonNull(this.loader); - Objects.requireNonNull(this.objectId); Objects.requireNonNull(this.copier); final T originalInstance = (T)this.loader.getObject(this.objectId); @@ -115,13 +118,6 @@ private Lazy createNewDefaultLazyWithClearableReference() ); } - @SuppressWarnings("all") - public static final Class> genericType() - { - // no idea how to get ".class" to work otherwise in conjunction with generics. - return (Class)SpringDataEclipseStoreLazy.Default.class; - } - @Override public T get() { @@ -195,9 +191,9 @@ public boolean clear(final ClearingEvaluator clearingEvaluator) @Override public long objectId() { - if(this.wrappedLazy != null && this.wrappedLazy instanceof Lazy.Default) + if(this.wrappedLazy != null && this.wrappedLazy instanceof final Lazy.Default wrappedTypedLazy) { - return ((Lazy.Default)this.wrappedLazy).objectId(); + return wrappedTypedLazy.objectId(); } return this.objectId; } @@ -217,7 +213,7 @@ public T getObjectToBeWrapped() @Override public SpringDataEclipseStoreLazy copyWithReference() { - final SpringDataEclipseStoreLazy.Default newLazy = new SpringDataEclipseStoreLazy.Default( + final SpringDataEclipseStoreLazy.Default newLazy = new SpringDataEclipseStoreLazy.Default<>( this.objectId(), this.loader, this.copier @@ -226,7 +222,6 @@ public SpringDataEclipseStoreLazy copyWithReference() return newLazy; } - // TODO is this necessary? @Override public void unlink() { @@ -234,10 +229,10 @@ public void unlink() { if(this.wrappedLazy != null) { - final Lazy.Default wrappedDefaultLazy = (Lazy.Default)this.wrappedLazy; + final Lazy.Default wrappedDefaultLazy = (Lazy.Default)this.wrappedLazy; wrappedDefaultLazy.$unlink(); final Field objectIdField = Lazy.Default.class.getDeclaredField("objectId"); - try(final FieldAccessModifier fam = FieldAccessModifier.prepareForField( + try(final FieldAccessModifier> fam = FieldAccessModifier.prepareForField( objectIdField, wrappedDefaultLazy)) { 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 index 13324385..95073f53 100644 --- 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 @@ -76,7 +76,7 @@ public SpringDataEclipseStoreLazyBinaryHandler( final WorkingCopier copier) { super( - SpringDataEclipseStoreLazy.Default.genericType(), + (Class)SpringDataEclipseStoreLazy.Default.class, CustomFields( CustomField(Object.class, "lazySubject"), CustomField(Object.class, "unwrappedSubject") From 7a6eec28f72da0fe7f5332c6041e7881a30d17b8 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Mon, 22 Apr 2024 09:14:03 +0200 Subject: [PATCH 13/18] Fix some checkstyle warnings --- .../PersonToTestInEclipseStoreRepository.java | 3 ++- .../store/helper/StorageDirectoryNameProvider.java | 8 ++++++-- .../isolated/tests/special/types/LazyDaoObject.java | 12 +++++++++--- .../isolated/tests/special/types/TypesData.java | 4 ++++ 4 files changed, 21 insertions(+), 6 deletions(-) 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/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..e63305fb 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 @@ -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/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 ad8f6f8d..f10223c8 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 @@ -27,6 +27,12 @@ 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) { @@ -39,9 +45,9 @@ public boolean equals(final Object o) return false; } final ComplexObject> that = (ComplexObject>)o; - return Objects.equals(this.getId(), that.getId()) && - (this.getValue() == null && that.getValue() == null) || - Objects.equals( + 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/TypesData.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/special/types/TypesData.java index 91241667..52cedb2d 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 @@ -55,6 +55,10 @@ final class TypesData { + private TypesData() + { + } + public record ListOfTestArguments(List> testArguments) { public Stream toArguments() From e8cbefb3e6135e5d663252788411aade1effd832 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Mon, 22 Apr 2024 11:06:13 +0200 Subject: [PATCH 14/18] Refactoring --- CHANGELOG.md | 1 + docs/modules/ROOT/pages/lazies.adoc | 4 +- spring-data-eclipse-store/pom.xml | 1 + .../store/aot/EclipseStoreRuntimeHints.java | 2 +- .../data/eclipse/store/core/IdentitySet.java | 2 +- .../AlreadyRegisteredException.java | 2 +- .../DataTypeNotSupportedException.java | 2 +- .../exceptions/DifferentClassesException.java | 2 +- .../FieldAccessReflectionException.java | 2 +- .../exceptions/IdFieldFinalException.java | 2 +- .../IdGeneratorNotSupportedException.java | 2 +- .../LazyNotUnlinkableException.java | 9 +- .../exceptions/MergeFailedException.java | 2 +- .../exceptions/NoIdFieldFoundException.java | 2 +- .../NoPageableObjectFoundException.java | 2 +- .../exceptions/NotComparableException.java | 2 +- .../exceptions/StringBlankException.java | 2 +- .../importer/EclipseStoreDataImporter.java | 2 +- .../EclipseStoreDataImporterComponent.java | 3 +- .../store/repository/EclipseStoreStorage.java | 2 +- .../store/repository/EntityListProvider.java | 2 +- .../store/repository/EntitySetCollector.java | 2 +- .../store/repository/IdSetterProvider.java | 2 +- .../store/repository/PersistableChecker.java | 2 +- .../data/eclipse/store/repository/Query.java | 2 +- .../repository/RelayedPersistenceChecker.java | 2 +- .../data/eclipse/store/repository/Root.java | 2 +- .../store/repository/SupportedChecker.java | 4 +- .../store/repository/WorkingCopyRegistry.java | 2 +- .../store/repository/access/AccessHelper.java | 2 +- .../access/modifier/FieldAccessModifier.java | 2 +- .../access/modifier/FieldAccessibleMaker.java | 2 +- ...efaultEclipseStoreClientConfiguration.java | 2 +- .../EclipseStoreClientConfiguration.java | 2 +- .../EclipseStoreRepositoriesRegistrar.java | 2 +- ...StoreRepositoryConfigNamespaceHandler.java | 2 +- ...StoreRepositoryConfigurationExtension.java | 2 +- ...EclipseStoreStorageFoundationProvider.java | 3 +- .../EnableEclipseStoreRepositories.java | 5 +- .../EclipseStoreCrudRepository.java | 2 +- .../EclipseStoreCustomRepository.java | 2 +- .../EclipseStoreListCrudRepository.java | 2 +- ...tPagingAndSortingRepositoryRepository.java | 2 +- ...ePagingAndSortingRepositoryRepository.java | 2 +- .../interfaces/EclipseStoreRepository.java | 2 +- .../lazy/SpringDataEclipseStoreLazy.java | 2 +- ...ringDataEclipseStoreLazyBinaryHandler.java | 16 ++-- .../query/EclipseStoreQueryCreator.java | 2 +- .../FindAllEclipseStoreQueryProvider.java | 2 +- .../repository/query/ReflectedField.java | 2 +- .../StringBasedEclipseStoreQueryProvider.java | 2 +- .../query/criteria/AbstractCriteriaNode.java | 2 +- .../repository/query/criteria/Criteria.java | 2 +- .../query/criteria/CriteriaAndNode.java | 2 +- .../query/criteria/CriteriaOrNode.java | 2 +- .../query/criteria/CriteriaSingleNode.java | 2 +- .../query/executors/EntitySorter.java | 2 +- .../query/executors/ListQueryExecutor.java | 2 +- .../executors/PageableQueryExecutor.java | 2 +- .../PageableSortableCollectionQuerier.java | 2 +- .../query/executors/QueryExecutor.java | 2 +- .../query/executors/QueryExecutorCreator.java | 2 +- .../SingleOptionalQueryExecutor.java | 2 +- .../query/executors/SingleQueryExecutor.java | 2 +- .../EclipseStoreQueryLookupStrategy.java | 2 +- .../EclipseStoreRepositoryFactory.java | 2 +- .../EclipseStoreRepositoryFactoryBean.java | 2 +- .../repository/support/IdFieldFinder.java | 2 +- .../support/SimpleEclipseStoreRepository.java | 2 +- .../support/copier/DataTypeUtil.java | 2 +- .../support/copier/id/IdSetter.java | 2 +- .../support/copier/id/NotSettingIdSetter.java | 2 +- .../support/copier/id/SimpleIdSetter.java | 2 +- .../support/copier/id/strategy/IdFinder.java | 2 +- .../strategy/auto/AbstractAutoIdFinder.java | 2 +- .../id/strategy/auto/AutoIntegerIdFinder.java | 2 +- .../id/strategy/auto/AutoLongIdFinder.java | 2 +- .../id/strategy/auto/AutoStringIdFinder.java | 2 +- .../AbstractRegisteringCopier.java | 7 +- .../EclipseSerializerRegisteringCopier.java | 4 +- .../RegisteringObjectCopier.java | 4 +- ...RegisteringStorageToWorkingCopyCopier.java | 6 +- .../RegisteringWorkingCopyAndOriginal.java | 4 +- ...RegisteringWorkingCopyToStorageCopier.java | 6 +- .../working/ChangedObjectCollector.java | 2 +- .../HashSetChangedObjectCollector.java | 2 +- .../HashSetMergedTargetsCollector.java | 2 +- .../working/MergedTargetsCollector.java | 2 +- .../working/RecursiveWorkingCopier.java | 89 +++++++++++-------- .../support/copier/working/WorkingCopier.java | 2 +- .../copier/working/WorkingCopierCreator.java | 2 +- .../copier/working/WorkingCopierResult.java | 2 +- .../reposyncer/RepositorySynchronizer.java | 2 +- .../SimpleRepositorySynchronizer.java | 2 +- .../store/util/GenericObjectComparer.java | 2 +- .../data/eclipse/store/util/StringUtil.java | 2 +- .../store/helper/DummyWorkingCopier.java | 2 +- .../helper/StorageDirectoryNameProvider.java | 2 +- .../data/eclipse/store/helper/TestData.java | 2 +- .../data/eclipse/store/helper/TestUtil.java | 2 +- .../store/integration/TestConfiguration.java | 2 +- .../isolated/IsolatedTestAnnotations.java | 2 +- .../integration/isolated/package-info.java | 2 +- .../isolated/tests/keywords/KeywordsTest.java | 2 +- .../keywords/KeywordsTestConfiguration.java | 2 +- .../tests/keywords/MinimalDaoObject.java | 2 +- .../tests/keywords/MinimalRepository.java | 2 +- .../tests/lazy/ComplexLazyObject.java | 2 +- .../isolated/tests/lazy/LazyTest.java | 5 +- .../tests/lazy/LazyTestConfiguration.java | 2 +- .../isolated/tests/lazy/ObjectWithLazy.java | 2 +- .../tests/lazy/ObjectWithLazyHashMap.java | 2 +- .../lazy/ObjectWithLazyHashMapRepository.java | 2 +- .../tests/lazy/ObjectWithLazyHashSet.java | 2 +- .../lazy/ObjectWithLazyHashSetRepository.java | 2 +- .../tests/lazy/ObjectWithLazyList.java | 2 +- .../lazy/ObjectWithLazyListRepository.java | 2 +- .../tests/lazy/ObjectWithLazyRepository.java | 2 +- .../lazy/ObjectWithLazySimpleObject.java | 2 +- .../ObjectWithLazySimpleObjectRepository.java | 2 +- .../isolated/tests/lazy/SimpleObject.java | 2 +- .../special/types/BigDecimalDaoObject.java | 2 +- .../special/types/BigDecimalRepository.java | 2 +- .../special/types/BigIntegerDaoObject.java | 2 +- .../special/types/BigIntegerRepository.java | 2 +- .../special/types/CalendarDaoObject.java | 2 +- .../special/types/CalendarRepository.java | 2 +- .../tests/special/types/ComplexObject.java | 2 +- .../tests/special/types/DateDaoObject.java | 2 +- .../tests/special/types/DateRepository.java | 2 +- .../tests/special/types/EnumMapDaoObject.java | 2 +- .../special/types/EnumMapRepository.java | 2 +- .../tests/special/types/EnumSetDaoObject.java | 2 +- .../special/types/EnumSetRepository.java | 2 +- .../tests/special/types/LazyDaoObject.java | 2 +- .../tests/special/types/LazyRepository.java | 2 +- .../tests/special/types/ListDaoObject.java | 2 +- .../tests/special/types/ListRepository.java | 2 +- .../special/types/LocalDateDaoObject.java | 2 +- .../special/types/LocalDateRepository.java | 2 +- .../special/types/LocalDateTimeDaoObject.java | 2 +- .../types/LocalDateTimeRepository.java | 2 +- .../special/types/LocalTimeDaoObject.java | 2 +- .../special/types/LocalTimeRepository.java | 2 +- .../tests/special/types/MapDaoObject.java | 2 +- .../tests/special/types/MapRepository.java | 2 +- .../special/types/OptionalDaoObject.java | 2 +- .../special/types/OptionalRepository.java | 2 +- .../tests/special/types/SetDaoObject.java | 2 +- .../tests/special/types/SetRepository.java | 2 +- .../types/SpecialTypesTestConfiguration.java | 2 +- .../tests/special/types/TypesData.java | 2 +- .../tests/special/types/TypesTest.java | 2 +- .../shared/DefaultTestAnnotations.java | 2 +- .../shared/SharedTestConfiguration.java | 2 +- .../integration/shared/package-info.java | 2 +- .../shared/repositories/Child.java | 2 +- .../shared/repositories/ChildCustomer.java | 2 +- .../repositories/ChildCustomerRepository.java | 2 +- .../shared/repositories/Customer.java | 2 +- .../shared/repositories/CustomerAsRecord.java | 2 +- .../CustomerAsRecordRepository.java | 2 +- .../shared/repositories/CustomerNotCrud.java | 2 +- .../CustomerNotCrudRepository.java | 2 +- .../repositories/CustomerRepository.java | 2 +- .../CustomerRepositoryWithHashSet.java | 2 +- ...CustomerRepositoryWithNonFinalHashSet.java | 2 +- .../CustomerRepositoryWithQuery.java | 2 +- .../repositories/CustomerWithChild.java | 2 +- .../CustomerWithChildRepository.java | 2 +- .../repositories/CustomerWithHashSet.java | 2 +- .../CustomerWithNonFinalHashSet.java | 2 +- .../repositories/CustomerWithQuery.java | 2 +- .../integration/shared/repositories/Node.java | 2 +- .../shared/repositories/NodeRepository.java | 2 +- .../shared/repositories/Owner.java | 2 +- .../shared/repositories/OwnerRepository.java | 2 +- .../shared/repositories/ParentCustomer.java | 2 +- .../ParentCustomerRepository.java | 2 +- .../shared/repositories/SubCustomer.java | 2 +- .../repositories/SubCustomerRepository.java | 2 +- .../repositories/id/CustomerWithIdInt.java | 2 +- .../id/CustomerWithIdIntRepository.java | 2 +- .../id/CustomerWithIdInteger.java | 2 +- .../CustomerWithIdIntegerNoAutoGenerate.java | 2 +- ...WithIdIntegerNoAutoGenerateRepository.java | 2 +- .../id/CustomerWithIdIntegerRepository.java | 2 +- .../repositories/id/CustomerWithIdLong.java | 2 +- .../id/CustomerWithIdLongRepository.java | 2 +- .../repositories/id/CustomerWithIdString.java | 2 +- .../id/CustomerWithIdStringRepository.java | 2 +- .../repositories/id/CustomerWithPurchase.java | 2 +- .../id/CustomerWithPurchaseRepository.java | 2 +- .../shared/repositories/id/Purchase.java | 2 +- .../immutables/CustomerWithFinal.java | 2 +- .../immutables/CustomerWithFinalChild.java | 2 +- .../CustomerWithFinalChildRepository.java | 2 +- .../immutables/CustomerWithFinalId.java | 2 +- .../CustomerWithFinalIdRepository.java | 2 +- .../CustomerWithFinalRepository.java | 2 +- .../repositories/interfaces/CustomerCrud.java | 2 +- .../CustomerEclipseStoreCrudRepository.java | 2 +- ...ustomerEclipseStoreListCrudRepository.java | 2 +- ...seStoreListPagingAndSortingRepository.java | 2 +- ...clipseStorePagingAndSortingRepository.java | 2 +- .../CustomerEclipseStoreRepository.java | 2 +- .../interfaces/CustomerListCrud.java | 2 +- .../CustomerListPagingAndSorting.java | 2 +- .../interfaces/CustomerPagingAndSorting.java | 2 +- .../interfaces/CustomerSimple.java | 2 +- .../real/life/example/Article.java | 2 +- .../real/life/example/ArticleGroup.java | 2 +- .../real/life/example/Invoice.java | 2 +- .../real/life/example/InvoiceRepository.java | 2 +- .../real/life/example/Position.java | 2 +- .../real/life/example/PositionRepository.java | 2 +- .../real/life/example/Warehouse.java | 2 +- .../shared/tests/ChangeRootTests.java | 2 +- .../shared/tests/ConcurrencyTest.java | 2 +- .../integration/shared/tests/FinalTest.java | 2 +- .../integration/shared/tests/HashSetTest.java | 2 +- .../integration/shared/tests/IdTest.java | 2 +- .../shared/tests/InheritanceTest.java | 2 +- .../shared/tests/JpaCompatibilityTest.java | 2 +- .../integration/shared/tests/QueryTest.java | 2 +- .../shared/tests/RealLifeTests.java | 2 +- .../shared/tests/SimpleMultipleTest.java | 2 +- .../shared/tests/SimpleSingleTest.java | 2 +- .../shared/tests/SpecificInterfacesTest.java | 2 +- .../integration/shared/tests/StressTest.java | 2 +- .../shared/tests/WorkingCopyTests.java | 2 +- .../EclipseStoreQueryCreatorAndOrTest.java | 2 +- .../EclipseStoreQueryCreatorBooleanTest.java | 2 +- ...clipseStoreQueryCreatorCollectionTest.java | 2 +- ...lipseStoreQueryCreatorGreaterLessTest.java | 2 +- .../EclipseStoreQueryCreatorIsIsNotTest.java | 2 +- .../EclipseStoreQueryCreatorStringTest.java | 2 +- .../repository/query/QueryCreatorUtil.java | 2 +- ...PageableSortableCollectionQuerierTest.java | 2 +- .../support/copier/DataTypeUtilTest.java | 2 +- ...steringStorageToWorkingCopyCopierTest.java | 15 ++-- 241 files changed, 333 insertions(+), 299 deletions(-) rename spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/{copier => registering}/AbstractRegisteringCopier.java (95%) rename spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/{copier => registering}/EclipseSerializerRegisteringCopier.java (98%) rename spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/{copier => registering}/RegisteringObjectCopier.java (89%) rename spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/{copier => registering}/RegisteringStorageToWorkingCopyCopier.java (90%) rename spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/{copier => registering}/RegisteringWorkingCopyAndOriginal.java (90%) rename spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/{copier => registering}/RegisteringWorkingCopyToStorageCopier.java (89%) rename spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/{copier => registering}/RegisteringStorageToWorkingCopyCopierTest.java (91%) diff --git a/CHANGELOG.md b/CHANGELOG.md index a11d28d0..5a255ec2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * 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/pages/lazies.adoc b/docs/modules/ROOT/pages/lazies.adoc index f568afee..55f93cbc 100644 --- a/docs/modules/ROOT/pages/lazies.adoc +++ b/docs/modules/ROOT/pages/lazies.adoc @@ -5,8 +5,8 @@ The basic mechanism is best explained in the https://docs.eclipsestore.io/manual 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. -All Lazy References would be resolved and loaded into memory anyway. +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. 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 index 8c89e5cc..4bb9978f 100644 --- 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 @@ -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,13 @@ */ 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) 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 b21fc73c..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. 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 b4d8145f..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. 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 9f143ab3..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. @@ -63,7 +63,7 @@ class Implementation implements SupportedChecker @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 9674fdb7..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. 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 e77ef59f..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. 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 bd56de35..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. 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 index 56d3aa7b..5e9fdf72 100644 --- 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 @@ -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/SpringDataEclipseStoreLazyBinaryHandler.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/lazy/SpringDataEclipseStoreLazyBinaryHandler.java index 95073f53..dfd6700a 100644 --- 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 @@ -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. @@ -34,7 +34,7 @@ /** * 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.copier.EclipseSerializerRegisteringCopier})! + * {@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. @@ -45,7 +45,7 @@ * 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.copier.EclipseSerializerRegisteringCopier}). + * {@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 @@ -65,8 +65,8 @@ public final class SpringDataEclipseStoreLazyBinaryHandler ) ); - public static final int OFFSET_UNWRAPPED_OBJECT = 8; - public static final int OFFSET_LAZY = 0; + private static final int OFFSET_UNWRAPPED_OBJECT = 8; + private static final int OFFSET_LAZY = 0; private final ObjectSwizzling originalStoreLoader; private final WorkingCopier copier; @@ -76,6 +76,7 @@ public SpringDataEclipseStoreLazyBinaryHandler( final WorkingCopier copier) { super( + // Cast is necessary for the compiler (Class)SpringDataEclipseStoreLazy.Default.class, CustomFields( CustomField(Object.class, "lazySubject"), @@ -83,7 +84,7 @@ public SpringDataEclipseStoreLazyBinaryHandler( ) ); this.originalStoreLoader = Objects.requireNonNull(originalStoreLoader); - this.copier = copier; + this.copier = Objects.requireNonNull(copier); } @Override @@ -98,8 +99,7 @@ public void store( if(instance.isOriginalObject()) { // Store unwrapped Object - final long newObjectId = handler.applyEager(instance.getObjectToBeWrapped()); - data.store_long(OFFSET_UNWRAPPED_OBJECT, newObjectId); + data.store_long(OFFSET_UNWRAPPED_OBJECT, handler.applyEager(instance.getObjectToBeWrapped())); } else { 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 970a1ea2..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. 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 2672f9d9..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. 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 1c56d322..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. 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 4be7128d..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. 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/copier/AbstractRegisteringCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/AbstractRegisteringCopier.java similarity index 95% rename from spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java rename to spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/AbstractRegisteringCopier.java index 51ef272e..d5bc900d 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/AbstractRegisteringCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/AbstractRegisteringCopier.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.copier; +package software.xdev.spring.data.eclipse.store.repository.support.copier.registering; import org.eclipse.serializer.Serializer; import org.eclipse.serializer.SerializerFoundation; @@ -38,7 +38,7 @@ public abstract class AbstractRegisteringCopier implements RegisteringObjectCopi { private final EclipseSerializerRegisteringCopier actualCopier; - public AbstractRegisteringCopier( + protected AbstractRegisteringCopier( final SupportedChecker supportedChecker, final RegisteringWorkingCopyAndOriginal register, final ObjectSwizzling objectSwizzling, @@ -67,6 +67,7 @@ private PersistenceManager createPersistenceManager( .createPersistenceManager(); } + @SuppressWarnings("java:S1452") protected SerializerFoundation createSerializerFoundation() { final Reference buffer = X.Reference(null); diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/EclipseSerializerRegisteringCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/EclipseSerializerRegisteringCopier.java similarity index 98% rename from spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/EclipseSerializerRegisteringCopier.java rename to spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/EclipseSerializerRegisteringCopier.java index 4420a5a4..5ec09598 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/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,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.copier; +package software.xdev.spring.data.eclipse.store.repository.support.copier.registering; import java.util.HashMap; import java.util.Map; diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringObjectCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringObjectCopier.java similarity index 89% rename from spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringObjectCopier.java rename to spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringObjectCopier.java index e111941e..146cd700 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/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,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.copier; +package software.xdev.spring.data.eclipse.store.repository.support.copier.registering; public interface RegisteringObjectCopier extends AutoCloseable { diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringStorageToWorkingCopyCopier.java similarity index 90% rename from spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java rename to spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringStorageToWorkingCopyCopier.java index 11084ac4..df11886e 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringStorageToWorkingCopyCopier.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.copier; +package software.xdev.spring.data.eclipse.store.repository.support.copier.registering; import org.eclipse.serializer.reference.ObjectSwizzling; @@ -36,7 +36,7 @@ public RegisteringStorageToWorkingCopyCopier( { super( supportedChecker, - (workingCopy, objectToStore) -> registry.register(workingCopy, objectToStore), + registry::register, objectSwizzling, copier ); diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyAndOriginal.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringWorkingCopyAndOriginal.java similarity index 90% rename from spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyAndOriginal.java rename to spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringWorkingCopyAndOriginal.java index b1153bae..3a9ca24d 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyAndOriginal.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringWorkingCopyAndOriginal.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.copier; +package software.xdev.spring.data.eclipse.store.repository.support.copier.registering; @FunctionalInterface public interface RegisteringWorkingCopyAndOriginal diff --git a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringWorkingCopyToStorageCopier.java similarity index 89% rename from spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java rename to spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringWorkingCopyToStorageCopier.java index e137ff5c..9fdc45f7 100644 --- a/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringWorkingCopyToStorageCopier.java +++ b/spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringWorkingCopyToStorageCopier.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.copier; +package software.xdev.spring.data.eclipse.store.repository.support.copier.registering; import org.eclipse.serializer.reference.ObjectSwizzling; @@ -37,7 +37,7 @@ public RegisteringWorkingCopyToStorageCopier( { super( supportedChecker, - (workingCopy, objectToStore) -> registry.invertRegister(workingCopy, objectToStore), + 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 25279520..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. @@ -41,9 +41,9 @@ 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.copier.RegisteringObjectCopier; -import software.xdev.spring.data.eclipse.store.repository.support.copier.copier.RegisteringStorageToWorkingCopyCopier; -import software.xdev.spring.data.eclipse.store.repository.support.copier.copier.RegisteringWorkingCopyToStorageCopier; +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; /** @@ -274,37 +274,14 @@ else if(DataTypeUtil.isSpringDataEclipseStoreLazy(valueOfSourceObject)) { // "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); } } } @@ -315,6 +292,48 @@ else if(DataTypeUtil.isSpringDataEclipseStoreLazy(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, 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 43a8f928..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. 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 2875144c..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. 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 e63305fb..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. 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 7ab5dddd..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. 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/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 index 07b57b68..02413a96 100644 --- 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 @@ -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/LazyTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/LazyTest.java index dd1ce194..a9b5c3ff 100644 --- 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 @@ -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. @@ -318,7 +318,8 @@ void lazyClearBeforeSave() final ObjectWithLazy newLazy = new ObjectWithLazy<>(); final SimpleObject objectToStore = new SimpleObject(TestData.DUMMY_STRING); newLazy.setLazy(SpringDataEclipseStoreLazy.build(objectToStore)); - Assertions.assertThrows(IllegalStateException.class, () -> newLazy.getLazy().clear()); + final Lazy lazy = newLazy.getLazy(); + Assertions.assertThrows(IllegalStateException.class, () -> lazy.clear()); } @Test 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 index 625c98da..75dcafa4 100644 --- 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 @@ -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/ObjectWithLazy.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazy.java index 88a8eeb8..f670d298 100644 --- 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 @@ -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/ObjectWithLazyHashMap.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashMap.java index 3ea0d2fd..10b2f430 100644 --- 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 @@ -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/ObjectWithLazyHashMapRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashMapRepository.java index 7389aebb..3a4f8857 100644 --- 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 @@ -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/ObjectWithLazyHashSet.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashSet.java index 7a366f72..2f8b0cd4 100644 --- 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 @@ -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/ObjectWithLazyHashSetRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyHashSetRepository.java index cffb92aa..070ff4b8 100644 --- 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 @@ -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/ObjectWithLazyList.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyList.java index dc608f8e..e15783c0 100644 --- 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 @@ -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/ObjectWithLazyListRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyListRepository.java index 964f6117..773e1d0d 100644 --- 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 @@ -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/ObjectWithLazyRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazyRepository.java index aab0c595..a0e4164f 100644 --- 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 @@ -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/ObjectWithLazySimpleObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazySimpleObject.java index 3ae4c2b8..75dbfb07 100644 --- 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 @@ -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/ObjectWithLazySimpleObjectRepository.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/ObjectWithLazySimpleObjectRepository.java index 9d413d7f..4bd550a6 100644 --- 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 @@ -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/SimpleObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/lazy/SimpleObject.java index 96d53b3e..f09879e4 100644 --- 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 @@ -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/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 f10223c8..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. 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 52cedb2d..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. 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/copier/RegisteringStorageToWorkingCopyCopierTest.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringStorageToWorkingCopyCopierTest.java similarity index 91% rename from spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopierTest.java rename to spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/registering/RegisteringStorageToWorkingCopyCopierTest.java index d0e3a72f..2c54b385 100644 --- a/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/repository/support/copier/copier/RegisteringStorageToWorkingCopyCopierTest.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.copier; +package software.xdev.spring.data.eclipse.store.repository.support.copier.registering; import java.util.List; import java.util.stream.IntStream; @@ -21,6 +21,7 @@ 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; @@ -39,7 +40,7 @@ void testCopyManyCopiesSingle() new WorkingCopyRegistry(), new SupportedChecker.Implementation(), o -> null, - null)) + new DummyWorkingCopier())) { final List originalObjects = IntStream.range(0, 1_000).mapToObj( i -> new DummyData("Data" + i, i) @@ -59,7 +60,7 @@ void testCopyAgainSameObject() new WorkingCopyRegistry(), new SupportedChecker.Implementation(), o -> null, - null)) + new DummyWorkingCopier())) { final DummyData originalObject = new DummyData("Test", 1); @@ -78,7 +79,7 @@ void testCopyAgainTheCopy() new WorkingCopyRegistry(), new SupportedChecker.Implementation(), o -> null, - null)) + new DummyWorkingCopier())) { final DummyData originalObject = new DummyData("Test", 1); @@ -99,7 +100,7 @@ void testCopyManyCopiesBulk() new WorkingCopyRegistry(), new SupportedChecker.Implementation(), o -> null, - null)) + new DummyWorkingCopier())) { final List originalObjects = IntStream.range(0, 100_000).mapToObj( i -> new DummyData("Data" + i, i) @@ -119,7 +120,7 @@ void testCopyEmpty() new WorkingCopyRegistry(), new SupportedChecker.Implementation(), o -> null, - null)) + new DummyWorkingCopier())) { Assertions.assertThrows(NullPointerException.class, () -> copier.copy(null)); } From 58c8fde49e45de23c829a2bb3ce07dd48e6e2158 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Mon, 22 Apr 2024 12:50:28 +0200 Subject: [PATCH 15/18] Update SpringDataEclipseStoreLazyBinaryHandler.java --- .../lazy/SpringDataEclipseStoreLazyBinaryHandler.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 index dfd6700a..d505c10c 100644 --- 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 @@ -34,18 +34,20 @@ /** * 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})! + * {@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}). + * {@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 From 01f45da9c0e276da383014132e0fabf15c0bade6 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Mon, 22 Apr 2024 13:20:24 +0200 Subject: [PATCH 16/18] Added deletion test --- ...ringDataEclipseStoreLazyBinaryHandler.java | 2 +- .../isolated/tests/deletion/DeletionTest.java | 66 +++++++++++++++++++ .../deletion/DeletionTestConfiguration.java | 28 ++++++++ .../tests/deletion/ReferencedDaoObject.java | 20 ++++++ .../tests/deletion/ReferencedRepository.java | 23 +++++++ .../tests/deletion/ReferencingDaoObject.java | 20 ++++++ .../tests/deletion/ReferencingRepository.java | 23 +++++++ 7 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/DeletionTest.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/DeletionTestConfiguration.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencedDaoObject.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencedRepository.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencingDaoObject.java create mode 100644 spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencingRepository.java 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 index d505c10c..a6223a84 100644 --- 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 @@ -41,7 +41,7 @@ * 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 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..b48f120d --- /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,66 @@ +/* + * 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 simpleStoreAndRead( + final ReferencedRepository referencedRepository, + 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).value()); + } + ); + } +} 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..6b2bb51b --- /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,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.deletion; + +public record ReferencedDaoObject(String 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..8be86d5a --- /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,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.deletion; + +public record ReferencingDaoObject(ReferencedDaoObject 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 +{ +} From 7dcd74f31edb1948aa583e8d829138879d033f9f Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Mon, 22 Apr 2024 13:36:05 +0200 Subject: [PATCH 17/18] Update DeletionTest.java --- .../integration/isolated/tests/deletion/DeletionTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 index b48f120d..082f8bda 100644 --- 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 @@ -40,8 +40,8 @@ class DeletionTest @Test void simpleStoreAndRead( - final ReferencedRepository referencedRepository, - final ReferencingRepository referencingRepository) + @Autowired final ReferencedRepository referencedRepository, + @Autowired final ReferencingRepository referencingRepository) { final ReferencedDaoObject referencedObject = new ReferencedDaoObject("someValue"); final ReferencingDaoObject referencingDaoObject = new ReferencingDaoObject(referencedObject); From 578640486082f15ba27734506f132eb71468e8dc Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Mon, 22 Apr 2024 15:36:11 +0200 Subject: [PATCH 18/18] Added more deletion tests --- .../isolated/tests/deletion/DeletionTest.java | 25 +++++++++++++++++-- .../tests/deletion/ReferencedDaoObject.java | 18 ++++++++++++- .../tests/deletion/ReferencingDaoObject.java | 18 ++++++++++++- 3 files changed, 57 insertions(+), 4 deletions(-) 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 index 082f8bda..da5a3827 100644 --- 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 @@ -39,7 +39,7 @@ class DeletionTest private DeletionTestConfiguration configuration; @Test - void simpleStoreAndRead( + void deleteReferencedObject( @Autowired final ReferencedRepository referencedRepository, @Autowired final ReferencingRepository referencingRepository) { @@ -59,7 +59,28 @@ void simpleStoreAndRead( final List referencingDaoObjects = TestUtil.iterableToList(referencingRepository.findAll()); Assertions.assertEquals(1, referencingDaoObjects.size()); - Assertions.assertNotNull(referencingDaoObjects.get(0).value()); + 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/ReferencedDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencedDaoObject.java index 6b2bb51b..94577218 100644 --- 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 @@ -15,6 +15,22 @@ */ package software.xdev.spring.data.eclipse.store.integration.isolated.tests.deletion; -public record ReferencedDaoObject(String value) +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/ReferencingDaoObject.java b/spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/deletion/ReferencingDaoObject.java index 8be86d5a..15d4cf5a 100644 --- 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 @@ -15,6 +15,22 @@ */ package software.xdev.spring.data.eclipse.store.integration.isolated.tests.deletion; -public record ReferencingDaoObject(ReferencedDaoObject value) +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; + } }