You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2026/05/22 20:34:25 UTC
(cayenne) 02/03: CAY-2947 Merge "cayenne-commitlog" into the core
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git
commit 4b41594dfa045ab20fdd871b6be89c56eb857d3b
Author: Andrus Adamchik <an...@objectstyle.com>
AuthorDate: Fri May 22 16:12:51 2026 -0400
CAY-2947 Merge "cayenne-commitlog" into the core
---
UPGRADE.txt | 22 +-
cayenne-commitlog/pom.xml | 87 ------
.../apache/cayenne/commitlog/CommitLogModule.java | 49 ---
.../cayenne/commitlog/CommitLogModuleExtender.java | 91 ------
.../cayenne/commitlog/CommitLogModuleProvider.java | 50 ---
...he.cayenne.runtime.CayenneRuntimeModuleProvider | 20 --
.../cayenne/commitlog/CommitLogFilterIT.java | 335 ---------------------
.../commitlog/CommitLogFilter_All_FlattenedIT.java | 132 --------
.../commitlog/CommitLogFilter_FilteredIT.java | 286 ------------------
.../CommitLogFilter_ListenerInducedChangesIT.java | 239 ---------------
.../commitlog/CommitLogFilter_OutsideTxIT.java | 82 -----
.../commitlog/CommitLogFilter_PreUpdate_IT.java | 101 -------
.../CommitLogFilter_PreUpdate_OutsideTxIT.java | 101 -------
.../cayenne/commitlog/CommitLogFilter_TxIT.java | 79 -----
.../commitlog/CommitLogModuleBuilderTest.java | 67 -----
.../commitlog/CommitLogModuleProviderTest.java | 32 --
.../org/apache/cayenne/commitlog/db/AuditLog.java | 27 --
.../apache/cayenne/commitlog/db/Auditable1.java | 29 --
.../apache/cayenne/commitlog/db/Auditable2.java | 29 --
.../apache/cayenne/commitlog/db/Auditable3.java | 29 --
.../apache/cayenne/commitlog/db/Auditable4.java | 29 --
.../apache/cayenne/commitlog/db/Auditable5.java | 30 --
.../cayenne/commitlog/db/AuditableChild1.java | 27 --
.../cayenne/commitlog/db/AuditableChild1x.java | 27 --
.../cayenne/commitlog/db/AuditableChild3.java | 25 --
.../cayenne/commitlog/db/AuditableChild5.java | 30 --
.../java/org/apache/cayenne/commitlog/db/E1.java | 25 --
.../java/org/apache/cayenne/commitlog/db/E2.java | 25 --
.../java/org/apache/cayenne/commitlog/db/E3.java | 27 --
.../java/org/apache/cayenne/commitlog/db/E4.java | 27 --
.../apache/cayenne/commitlog/db/LifecycleMap.java | 36 ---
.../cayenne/commitlog/db/auto/_AuditLog.java | 91 ------
.../cayenne/commitlog/db/auto/_Auditable1.java | 116 -------
.../cayenne/commitlog/db/auto/_Auditable2.java | 135 ---------
.../cayenne/commitlog/db/auto/_Auditable3.java | 135 ---------
.../cayenne/commitlog/db/auto/_Auditable4.java | 129 --------
.../cayenne/commitlog/db/auto/_Auditable5.java | 116 -------
.../commitlog/db/auto/_AuditableChild1.java | 110 -------
.../commitlog/db/auto/_AuditableChild1x.java | 110 -------
.../commitlog/db/auto/_AuditableChild3.java | 129 --------
.../commitlog/db/auto/_AuditableChild5.java | 110 -------
.../org/apache/cayenne/commitlog/db/auto/_E1.java | 71 -----
.../org/apache/cayenne/commitlog/db/auto/_E2.java | 71 -----
.../org/apache/cayenne/commitlog/db/auto/_E3.java | 96 ------
.../org/apache/cayenne/commitlog/db/auto/_E4.java | 96 ------
.../cayenne/commitlog/db/auto/_LifecycleMap.java | 12 -
.../commitlog/unit/AuditableRuntimeCase.java | 101 -------
.../commitlog/unit/FlattenedRuntimeCase.java | 62 ----
.../src/test/resources/cayenne-lifecycle.xml | 18 --
.../src/test/resources/lifecycle-map.map.xml | 179 -----------
pom.xml | 3 +-
51 files changed, 11 insertions(+), 4074 deletions(-)
diff --git a/UPGRADE.txt b/UPGRADE.txt
index 8ac2292f2..9630b62fe 100644
--- a/UPGRADE.txt
+++ b/UPGRADE.txt
@@ -7,20 +7,18 @@ IMPORTANT: be sure to read all notes for the intermediate releases between your
UPGRADING TO 5.0.M2
-* Per CAY-2947 commit log support has moved from the separate `cayenne-commitlog` artifact into the core
-`cayenne` artifact. No extra dependency is needed. Replace:
+* Per CAY-2947 the `cayenne-commitlog` artifact has been removed. Commit log support is now part of the
+core `cayenne` artifact — no extra dependency needed. Migrate as follows:
+ - Remove the `cayenne-commitlog` dependency from your build.
+ - Replace `CommitLogModule.extend(binder).addListener(l)` with:
```
-binder -> CommitLogModule.extend(binder).addListener(myListener)
+CoreModule.extend(binder).addCommitLogListener(l)
```
-with:
-```
-binder -> CoreModule.extend(binder).addCommitLogListener(myListener)
-```
-The `excludeFromTransaction()` method is now `excludeCommitLogFromTransaction()` on `CoreModuleExtender`.
-The `@CommitLog` annotation has moved to `org.apache.cayenne.annotation.CommitLog`. The old
-`org.apache.cayenne.commitlog.CommitLog` is deprecated and still recognized at runtime, but will log a
-warning for each entity class that uses it.
-The `cayenne-commitlog` artifact is retained with deprecated shim classes for backward compatibility.
+ - `excludeFromTransaction()` is now `excludeCommitLogFromTransaction()` on `CoreModuleExtender`.
+ - Replace `@org.apache.cayenne.commitlog.CommitLog` on entity classes with
+`@org.apache.cayenne.annotation.CommitLog`.
+ - The `CommitLogListener`, `ChangeMap`, `ObjectChange` and related model classes remain in the
+`org.apache.cayenne.commitlog` package (now part of the core artifact).
* Per CAY-2935 Minimum required Java version for Apache Cayenne 5.0 is 21
diff --git a/cayenne-commitlog/pom.xml b/cayenne-commitlog/pom.xml
deleted file mode 100644
index d5929394c..000000000
--- a/cayenne-commitlog/pom.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you 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
- ~
- ~ https://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.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>cayenne-parent</artifactId>
- <groupId>org.apache.cayenne</groupId>
- <version>5.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>cayenne-commitlog</artifactId>
- <name>cayenne-commitlog: Cayenne Commit Log Module</name>
- <packaging>jar</packaging>
-
- <dependencies>
- <!-- Compile dependencies -->
- <dependency>
- <groupId>org.apache.cayenne</groupId>
- <artifactId>cayenne</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <!-- Test dependencies -->
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
- <scope>test</scope>
- </dependency>
-<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.cayenne.build-tools</groupId>
- <artifactId>cayenne-test-utilities</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.cayenne</groupId>
- <artifactId>cayenne</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <!-- This ensures LICENSE and NOTICE inclusion in all jars -->
- <plugin>
- <artifactId>maven-remote-resources-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>process</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
\ No newline at end of file
diff --git a/cayenne-commitlog/src/main/java/org/apache/cayenne/commitlog/CommitLogModule.java b/cayenne-commitlog/src/main/java/org/apache/cayenne/commitlog/CommitLogModule.java
deleted file mode 100644
index 0ff7f4793..000000000
--- a/cayenne-commitlog/src/main/java/org/apache/cayenne/commitlog/CommitLogModule.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog;
-
-import org.apache.cayenne.configuration.runtime.CoreModule;
-import org.apache.cayenne.di.Binder;
-import org.apache.cayenne.di.Module;
-
-/**
- * Commit log support is now part of the core {@code cayenne} module. This class is retained for backward
- * compatibility only. Replace usages with {@link CoreModule#extend(Binder)} and its
- * {@code addCommitLogListener} / {@code commitLogAnnotationEntitiesOnly} methods.
- *
- * @deprecated use {@link CoreModule#extend(Binder)} commit log methods.
- * @since 4.0
- */
-@Deprecated(since = "5.0")
-public class CommitLogModule implements Module {
-
- /**
- * @deprecated use {@link CoreModule#extend(Binder)} commit log methods.
- */
- @Deprecated(since = "5.0")
- public static CommitLogModuleExtender extend(Binder binder) {
- return new CommitLogModuleExtender(CoreModule.extend(binder));
- }
-
- @Override
- public void configure(Binder binder) {
- // no-op: commit log support is now wired by CoreModule
- }
-}
diff --git a/cayenne-commitlog/src/main/java/org/apache/cayenne/commitlog/CommitLogModuleExtender.java b/cayenne-commitlog/src/main/java/org/apache/cayenne/commitlog/CommitLogModuleExtender.java
deleted file mode 100644
index c687e7d83..000000000
--- a/cayenne-commitlog/src/main/java/org/apache/cayenne/commitlog/CommitLogModuleExtender.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog;
-
-import org.apache.cayenne.commitlog.meta.CommitLogEntityFactory;
-import org.apache.cayenne.configuration.runtime.CoreModuleExtender;
-
-/**
- * @deprecated use {@link CoreModuleExtender} commitlog methods directly via {@link org.apache.cayenne.configuration.runtime.CoreModule#extend(org.apache.cayenne.di.Binder)}.
- * @since 4.0
- */
-@Deprecated(since = "5.0")
-public class CommitLogModuleExtender {
-
- private final CoreModuleExtender coreExtender;
-
- CommitLogModuleExtender(CoreModuleExtender coreExtender) {
- this.coreExtender = coreExtender;
- }
-
- /**
- * @deprecated use {@link CoreModuleExtender#addCommitLogListener(CommitLogListener)}
- */
- @Deprecated(since = "5.0")
- public CommitLogModuleExtender addListener(CommitLogListener instance) {
- coreExtender.addCommitLogListener(instance);
- return this;
- }
-
- /**
- * @deprecated use {@link CoreModuleExtender#addCommitLogListener(Class)}
- */
- @Deprecated(since = "5.0")
- public CommitLogModuleExtender addListener(Class<? extends CommitLogListener> type) {
- coreExtender.addCommitLogListener(type);
- return this;
- }
-
- /**
- * @deprecated use {@link CoreModuleExtender#excludeCommitLogFromTransaction()}
- */
- @Deprecated(since = "5.0")
- public CommitLogModuleExtender excludeFromTransaction() {
- coreExtender.excludeCommitLogFromTransaction();
- return this;
- }
-
- /**
- * No-op. Commit log listeners are now included in the transaction by default.
- *
- * @deprecated the default behavior is now to include in the transaction
- */
- @Deprecated(since = "5.0")
- public CommitLogModuleExtender includeInTransaction() {
- return this;
- }
-
- /**
- * @deprecated use {@link CoreModuleExtender#commitLogAnnotationEntitiesOnly()}
- */
- @Deprecated(since = "5.0")
- public CommitLogModuleExtender commitLogAnnotationEntitiesOnly() {
- coreExtender.commitLogAnnotationEntitiesOnly();
- return this;
- }
-
- /**
- * @deprecated use {@link CoreModuleExtender#commitLogEntityFactory(Class)}
- */
- @Deprecated(since = "5.0")
- public CommitLogModuleExtender entityFactory(Class<? extends CommitLogEntityFactory> entityFactoryType) {
- coreExtender.commitLogEntityFactory(entityFactoryType);
- return this;
- }
-}
diff --git a/cayenne-commitlog/src/main/java/org/apache/cayenne/commitlog/CommitLogModuleProvider.java b/cayenne-commitlog/src/main/java/org/apache/cayenne/commitlog/CommitLogModuleProvider.java
deleted file mode 100644
index beb8b872a..000000000
--- a/cayenne-commitlog/src/main/java/org/apache/cayenne/commitlog/CommitLogModuleProvider.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog;
-
-import java.util.Collection;
-import java.util.Collections;
-
-import org.apache.cayenne.runtime.CayenneRuntimeModuleProvider;
-import org.apache.cayenne.configuration.runtime.CoreModule;
-import org.apache.cayenne.di.Module;
-
-/**
- * @deprecated the commit log module is now part of core Cayenne; this provider is a no-op.
- * @since 4.0
- */
-@Deprecated(since = "5.0")
-public class CommitLogModuleProvider implements CayenneRuntimeModuleProvider {
-
- @Override
- public Module module() {
- return new CommitLogModule();
- }
-
- @Override
- public Class<? extends Module> moduleType() {
- return CommitLogModule.class;
- }
-
- @Override
- public Collection<Class<? extends Module>> overrides() {
- return Collections.singletonList(CoreModule.class);
- }
-}
diff --git a/cayenne-commitlog/src/main/resources/META-INF/services/org.apache.cayenne.runtime.CayenneRuntimeModuleProvider b/cayenne-commitlog/src/main/resources/META-INF/services/org.apache.cayenne.runtime.CayenneRuntimeModuleProvider
deleted file mode 100644
index f434cbc96..000000000
--- a/cayenne-commitlog/src/main/resources/META-INF/services/org.apache.cayenne.runtime.CayenneRuntimeModuleProvider
+++ /dev/null
@@ -1,20 +0,0 @@
-##################################################################
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you 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
-#
-# https://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.
-##################################################################
-
-org.apache.cayenne.commitlog.CommitLogModuleProvider
\ No newline at end of file
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilterIT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilterIT.java
deleted file mode 100644
index b1e52e33e..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilterIT.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog;
-
-import org.apache.cayenne.ObjectContext;
-import org.apache.cayenne.ObjectId;
-import org.apache.cayenne.commitlog.db.Auditable1;
-import org.apache.cayenne.commitlog.db.AuditableChild1;
-import org.apache.cayenne.commitlog.db.AuditableChild1x;
-import org.apache.cayenne.commitlog.model.*;
-import org.apache.cayenne.commitlog.unit.AuditableRuntimeCase;
-import org.apache.cayenne.query.SelectById;
-import org.apache.cayenne.runtime.CayenneRuntimeBuilder;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.mockito.ArgumentCaptor;
-
-import java.sql.SQLException;
-
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.*;
-
-public class CommitLogFilterIT extends AuditableRuntimeCase {
-
- protected ObjectContext context;
- protected CommitLogListener mockListener;
-
- @Override
- protected CayenneRuntimeBuilder configureCayenne() {
- this.mockListener = mock(CommitLogListener.class);
- return super.configureCayenne()
- .addModule(b -> CommitLogModule.extend(b).addListener(mockListener));
- }
-
- @BeforeEach
- public void before() {
- context = runtime.newContext();
- }
-
- @Test
- public void postCommit_Insert() {
-
- Auditable1 a1 = context.newObject(Auditable1.class);
- a1.setCharProperty1("yy");
- ObjectId preCommitId = a1.getObjectId();
-
- context.commitChanges();
-
- ArgumentCaptor<ChangeMap> changeMap = ArgumentCaptor.forClass(ChangeMap.class);
- verify(mockListener).onPostCommit(any(ObjectContext.class), changeMap.capture());
-
- assertNotNull(changeMap.getValue());
- assertEquals(2, changeMap.getValue().getChanges().size());
- assertEquals(1, changeMap.getValue().getUniqueChanges().size());
-
- ObjectChange c = changeMap.getValue().getUniqueChanges().iterator().next();
- assertNotNull(c);
- assertEquals(ObjectChangeType.INSERT, c.getType());
- assertEquals(1, c.getAttributeChanges().size());
- assertEquals("yy", c.getAttributeChanges().get(Auditable1.CHAR_PROPERTY1.getName()).getNewValue());
-
- assertNotEquals(preCommitId, a1.getObjectId());
- assertEquals(preCommitId, c.getPreCommitId());
- assertEquals(a1.getObjectId(), c.getPostCommitId());
- }
-
- @Test
- public void postCommit_Update() throws SQLException {
-
- auditable1.insert(1, "xx");
-
- Auditable1 a1 = SelectById.query(Auditable1.class, 1).selectOne(context);
- a1.setCharProperty1("yy");
-
- ObjectId preCommitId = a1.getObjectId();
-
- context.commitChanges();
-
- ArgumentCaptor<ChangeMap> changeMap = ArgumentCaptor.forClass(ChangeMap.class);
- verify(mockListener).onPostCommit(any(ObjectContext.class), changeMap.capture());
-
- assertNotNull(changeMap.getValue());
- assertEquals(1, changeMap.getValue().getUniqueChanges().size());
-
- ObjectChange c = changeMap.getValue().getChanges().get(ObjectId.of("Auditable1", Auditable1.ID_PK_COLUMN, 1));
- assertNotNull(c);
- assertEquals(ObjectChangeType.UPDATE, c.getType());
- assertEquals(1, c.getAttributeChanges().size());
- AttributeChange pc = c.getAttributeChanges().get(Auditable1.CHAR_PROPERTY1.getName());
- assertNotNull(pc);
- assertEquals("xx", pc.getOldValue());
- assertEquals("yy", pc.getNewValue());
-
- assertEquals(preCommitId, a1.getObjectId());
- assertEquals(preCommitId, c.getPreCommitId());
- assertEquals(preCommitId, c.getPostCommitId());
- }
-
- @Test
- public void postCommit_Delete() throws SQLException {
- auditable1.insert(1, "xx");
- auditableChild1.insert(1, 1, "cc1");
- auditableChild1.insert(2, 1, "cc2");
-
- Auditable1 a1 = SelectById.query(Auditable1.class, 1).selectOne(context);
- context.deleteObjects(a1.getChildren1());
- context.deleteObject(a1);
- context.commitChanges();
-
- ArgumentCaptor<ChangeMap> changeMap = ArgumentCaptor.forClass(ChangeMap.class);
- verify(mockListener).onPostCommit(any(ObjectContext.class), changeMap.capture());
-
- assertNotNull(changeMap.getValue());
- assertEquals(3, changeMap.getValue().getUniqueChanges().size());
-
- // check from the perspective of the master object
- ObjectChange masterChange = changeMap.getValue().getChanges().get(ObjectId.of("Auditable1", Auditable1.ID_PK_COLUMN, 1));
- assertNotNull(masterChange);
- assertEquals(ObjectChangeType.DELETE, masterChange.getType());
-
- assertEquals(1, masterChange.getAttributeChanges().size());
- assertEquals("xx", masterChange.getAttributeChanges().get(Auditable1.CHAR_PROPERTY1.getName()).getOldValue());
- assertNull(masterChange.getAttributeChanges().get(Auditable1.CHAR_PROPERTY1.getName()).getNewValue());
-
- assertEquals(1, masterChange.getToManyRelationshipChanges().size(),
- "1..N was explicitly unset as a part of delete. Expected to be recorded in changes");
- assertTrue(masterChange.getToOneRelationshipChanges().isEmpty(), "No N..1 relationships in the entity");
-
- // check from the perspective of the child object
- ObjectChange childChange = changeMap.getValue().getChanges().get(ObjectId.of("AuditableChild1", AuditableChild1.ID_PK_COLUMN, 2));
- assertNotNull(childChange);
- assertEquals(ObjectChangeType.DELETE, childChange.getType());
-
- assertEquals(1, childChange.getAttributeChanges().size());
- assertEquals("cc2", childChange.getAttributeChanges().get(AuditableChild1.CHAR_PROPERTY1.getName()).getOldValue());
- assertNull(childChange.getAttributeChanges().get(AuditableChild1.CHAR_PROPERTY1.getName()).getNewValue());
-
- assertTrue(childChange.getToManyRelationshipChanges().isEmpty(), "No 1..N relationships in the entity");
- assertEquals(1, childChange.getToOneRelationshipChanges().size(),
- "N..1 was explicitly unset as a part of delete. Expected to be recorded in changes");
- }
-
- @Test
- public void postCommit_Delete_ToOneNullify() throws SQLException {
- auditable1.insert(1, "xx");
- auditableChild1.insert(1, 1, "cc1");
- auditableChild1.insert(2, 1, "cc2");
-
- AuditableChild1 ac1 = SelectById.query(AuditableChild1.class, 2).selectOne(context);
- context.deleteObject(ac1);
- context.commitChanges();
-
- ArgumentCaptor<ChangeMap> changeMap = ArgumentCaptor.forClass(ChangeMap.class);
- verify(mockListener).onPostCommit(any(ObjectContext.class), changeMap.capture());
-
- assertNotNull(changeMap.getValue());
- assertEquals(2, changeMap.getValue().getUniqueChanges().size());
-
- ObjectChange change = changeMap.getValue().getChanges().get(ObjectId.of("AuditableChild1", AuditableChild1.ID_PK_COLUMN, 2));
- assertNotNull(change);
- assertEquals(ObjectChangeType.DELETE, change.getType());
-
- assertEquals(1, change.getAttributeChanges().size());
- assertEquals("cc2", change.getAttributeChanges().get(AuditableChild1.CHAR_PROPERTY1.getName()).getOldValue());
- assertNull(change.getAttributeChanges().get(AuditableChild1.CHAR_PROPERTY1.getName()).getNewValue());
-
- assertTrue(change.getToManyRelationshipChanges().isEmpty(), "No 1..N relationships in the entity");
- assertEquals(1, change.getToOneRelationshipChanges().size(), "N..1 state was not captured");
- assertEquals(ObjectId.of("Auditable1", Auditable1.ID_PK_COLUMN, 1),
- change.getToOneRelationshipChanges().get(AuditableChild1.PARENT.getName()).getOldValue());
- }
-
- @Test
- public void postCommit_Delete_ToOne_OneWay() throws SQLException {
- auditable1.insert(1, "xx");
- auditableChild1x.insert(1, 1, "cc1");
- auditableChild1x.insert(2, 1, "cc2");
-
- AuditableChild1x ac1 = SelectById.query(AuditableChild1x.class, 2).selectOne(context);
- context.deleteObject(ac1);
- context.commitChanges();
-
- ArgumentCaptor<ChangeMap> changeMap = ArgumentCaptor.forClass(ChangeMap.class);
- verify(mockListener).onPostCommit(any(ObjectContext.class), changeMap.capture());
-
- assertNotNull(changeMap.getValue());
- assertEquals(1, changeMap.getValue().getUniqueChanges().size());
-
- ObjectChange change = changeMap.getValue().getChanges().get(ObjectId.of("AuditableChild1x", AuditableChild1x.ID_PK_COLUMN, 2));
- assertNotNull(change);
- assertEquals(ObjectChangeType.DELETE, change.getType());
-
- assertEquals(1, change.getAttributeChanges().size());
- assertEquals("cc2", change.getAttributeChanges().get(AuditableChild1x.CHAR_PROPERTY1.getName()).getOldValue());
- assertNull(change.getAttributeChanges().get(AuditableChild1x.CHAR_PROPERTY1.getName()).getNewValue());
-
- assertTrue(change.getToManyRelationshipChanges().isEmpty(), "No 1..N relationships in the entity");
- assertEquals(1, change.getToOneRelationshipChanges().size(), "N..1 state was not captured");
- assertEquals(ObjectId.of("Auditable1", Auditable1.ID_PK_COLUMN, 1),
- change.getToOneRelationshipChanges().get(AuditableChild1x.PARENT.getName()).getOldValue());
- }
-
-
- @Test
- public void postCommit_UpdateToOne() throws SQLException {
- auditable1.insert(1, "xx");
- auditable1.insert(2, "yy");
-
- auditableChild1.insert(1, 1, "cc1");
- auditableChild1.insert(2, 2, "cc2");
- auditableChild1.insert(3, null, "cc3");
-
- AuditableChild1 ac1 = SelectById.query(AuditableChild1.class, 1).selectOne(context);
- AuditableChild1 ac2 = SelectById.query(AuditableChild1.class, 2).selectOne(context);
- AuditableChild1 ac3 = SelectById.query(AuditableChild1.class, 3).selectOne(context);
-
- Auditable1 a1 = SelectById.query(Auditable1.class, 1).selectOne(context);
- Auditable1 a2 = SelectById.query(Auditable1.class, 2).selectOne(context);
-
- a1.removeFromChildren1(ac1);
- a1.addToChildren1(ac2);
- a1.addToChildren1(ac3);
-
- context.commitChanges();
-
- ArgumentCaptor<ChangeMap> changeMap = ArgumentCaptor.forClass(ChangeMap.class);
- verify(mockListener).onPostCommit(any(ObjectContext.class), changeMap.capture());
-
- assertNotNull(changeMap.getValue());
- assertEquals(5, changeMap.getValue().getUniqueChanges().size());
-
- ObjectChange a1c = changeMap.getValue().getChanges().get(
- ObjectId.of("Auditable1", Auditable1.ID_PK_COLUMN, 1));
- assertNotNull(a1c);
- assertEquals(ObjectChangeType.UPDATE, a1c.getType());
- ToManyRelationshipChange a1c1 = a1c.getToManyRelationshipChanges().get(Auditable1.CHILDREN1.getName());
- assertEquals(2, a1c1.getAdded().size());
- assertEquals(1, a1c1.getRemoved().size());
-
- ObjectChange a2c = changeMap.getValue().getChanges().get(
- ObjectId.of("Auditable1", Auditable1.ID_PK_COLUMN, 2));
- assertNotNull(a2c);
- assertEquals(ObjectChangeType.UPDATE, a2c.getType());
- ToManyRelationshipChange a2c1 = a2c.getToManyRelationshipChanges().get(Auditable1.CHILDREN1.getName());
- assertEquals(0, a2c1.getAdded().size());
- assertEquals(1, a2c1.getRemoved().size());
-
- ObjectChange ac1c = changeMap.getValue().getChanges().get(
- ObjectId.of("AuditableChild1", AuditableChild1.ID_PK_COLUMN, 1));
- assertNotNull(ac1c);
- assertEquals(ObjectChangeType.UPDATE, ac1c.getType());
- ToOneRelationshipChange ac1c1 = ac1c.getToOneRelationshipChanges().get(AuditableChild1.PARENT.getName());
- assertEquals(a1.getObjectId(), ac1c1.getOldValue());
- assertNull(ac1c1.getNewValue());
-
- ObjectChange ac2c = changeMap.getValue().getChanges().get(
- ObjectId.of("AuditableChild1", AuditableChild1.ID_PK_COLUMN, 2));
- assertNotNull(ac2c);
- assertEquals(ObjectChangeType.UPDATE, ac2c.getType());
- ToOneRelationshipChange ac2c1 = ac2c.getToOneRelationshipChanges()
- .get(AuditableChild1.PARENT.getName());
- assertEquals(a2.getObjectId(), ac2c1.getOldValue());
- assertEquals(a1.getObjectId(), ac2c1.getNewValue());
-
- ObjectChange ac3c = changeMap.getValue().getChanges().get(
- ObjectId.of("AuditableChild1", AuditableChild1.ID_PK_COLUMN, 3));
- assertNotNull(ac3c);
- assertEquals(ObjectChangeType.UPDATE, ac3c.getType());
- ToOneRelationshipChange ac3c1 = ac3c.getToOneRelationshipChanges()
- .get(AuditableChild1.PARENT.getName());
- assertNull(ac3c1.getOldValue());
- assertEquals(a1.getObjectId(), ac3c1.getNewValue());
- }
-
- @Test
- public void postCommit_UpdateToMany() throws SQLException {
- auditable1.insert(1, "xx");
- auditableChild1.insert(1, 1, "cc1");
- auditableChild1.insert(2, null, "cc2");
- auditableChild1.insert(3, null, "cc3");
-
- AuditableChild1 ac1 = SelectById.query(AuditableChild1.class, 1).selectOne(context);
- AuditableChild1 ac2 = SelectById.query(AuditableChild1.class, 2).selectOne(context);
- AuditableChild1 ac3 = SelectById.query(AuditableChild1.class, 3).selectOne(context);
-
- Auditable1 a1 = SelectById.query(Auditable1.class, 1).selectOne(context);
-
- a1.removeFromChildren1(ac1);
- a1.addToChildren1(ac2);
- a1.addToChildren1(ac3);
-
- context.commitChanges();
-
- ArgumentCaptor<ChangeMap> changeMap = ArgumentCaptor.forClass(ChangeMap.class);
- verify(mockListener).onPostCommit(any(ObjectContext.class), changeMap.capture());
-
- assertNotNull(changeMap.getValue());
- assertEquals(4, changeMap.getValue().getUniqueChanges().size());
-
- ObjectChange a1c = changeMap.getValue().getChanges().get(ObjectId.of("Auditable1", Auditable1.ID_PK_COLUMN, 1));
- assertNotNull(a1c);
- assertEquals(ObjectChangeType.UPDATE, a1c.getType());
- assertEquals(0, a1c.getAttributeChanges().size());
-
- assertEquals(1, a1c.getToManyRelationshipChanges().size());
-
- ToManyRelationshipChange a1c1 = a1c.getToManyRelationshipChanges().get(Auditable1.CHILDREN1.getName());
- assertNotNull(a1c1);
-
- assertEquals(2, a1c1.getAdded().size());
- assertTrue(a1c1.getAdded().contains(ac2.getObjectId()));
- assertTrue(a1c1.getAdded().contains(ac3.getObjectId()));
-
- assertEquals(1, a1c1.getRemoved().size());
- assertTrue(a1c1.getRemoved().contains(ac1.getObjectId()));
-
- }
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_All_FlattenedIT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_All_FlattenedIT.java
deleted file mode 100644
index 63f4cfe94..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_All_FlattenedIT.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog;
-
-import org.apache.cayenne.ObjectContext;
-import org.apache.cayenne.ObjectId;
-import org.apache.cayenne.commitlog.db.E3;
-import org.apache.cayenne.commitlog.db.E4;
-import org.apache.cayenne.commitlog.model.ChangeMap;
-import org.apache.cayenne.commitlog.model.ObjectChange;
-import org.apache.cayenne.commitlog.model.ObjectChangeType;
-import org.apache.cayenne.commitlog.model.ToManyRelationshipChange;
-import org.apache.cayenne.commitlog.unit.FlattenedRuntimeCase;
-import org.apache.cayenne.query.SelectById;
-import org.apache.cayenne.runtime.CayenneRuntimeBuilder;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.mockito.stubbing.Answer;
-
-import java.sql.SQLException;
-
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.*;
-
-public class CommitLogFilter_All_FlattenedIT extends FlattenedRuntimeCase {
-
- protected ObjectContext context;
- protected CommitLogListener mockListener;
-
- @Override
- protected CayenneRuntimeBuilder configureCayenne() {
- this.mockListener = mock(CommitLogListener.class);
- return super.configureCayenne()
- .addModule(b -> CommitLogModule.extend(b).addListener(mockListener));
- }
-
- @BeforeEach
- public void before() {
- context = runtime.newContext();
- }
-
- @Test
- public void postCommit_UpdateToMany() throws SQLException {
- e3.insert(1);
- e4.insert(11);
- e4.insert(12);
- e34.insert(1, 11);
-
- E3 e3 = SelectById.query(E3.class, 1).selectOne(context);
- E4 e4_1 = SelectById.query(E4.class, 11).selectOne(context);
- E4 e4_2 = SelectById.query(E4.class, 12).selectOne(context);
-
- doAnswer((Answer<Object>) invocation -> {
-
- assertSame(context, invocation.getArguments()[0]);
-
- ChangeMap changes = (ChangeMap) invocation.getArguments()[1];
- assertNotNull(changes);
- assertEquals(3, changes.getUniqueChanges().size());
-
- ObjectChange e3c = changes.getChanges().get(ObjectId.of("E3", E3.ID_PK_COLUMN, 1));
- assertNotNull(e3c);
- assertEquals(ObjectChangeType.UPDATE, e3c.getType());
- assertEquals(0, e3c.getAttributeChanges().size());
- assertEquals(1, e3c.getToManyRelationshipChanges().size());
-
- ToManyRelationshipChange e3c1 = e3c.getToManyRelationshipChanges().get(E3.E4S.getName());
- assertNotNull(e3c1);
-
- assertEquals(1, e3c1.getAdded().size());
- assertTrue(e3c1.getAdded().contains(e4_2.getObjectId()));
-
- assertEquals(1, e3c1.getRemoved().size());
- assertTrue(e3c1.getRemoved().contains(e4_1.getObjectId()));
-
- ObjectChange e41c = changes.getChanges().get(ObjectId.of("E4", E4.ID_PK_COLUMN, 11));
- assertNotNull(e41c);
- assertEquals(ObjectChangeType.UPDATE, e41c.getType());
- assertEquals(0, e41c.getAttributeChanges().size());
- assertEquals(1, e41c.getToManyRelationshipChanges().size());
-
- ToManyRelationshipChange e41c1 = e41c.getToManyRelationshipChanges().get(E4.E3S.getName());
- assertNotNull(e41c);
-
- assertEquals(0, e41c1.getAdded().size());
-
- assertEquals(1, e41c1.getRemoved().size());
- assertTrue(e41c1.getRemoved().contains(e3.getObjectId()));
-
- ObjectChange e42c = changes.getChanges().get(ObjectId.of("E4", E4.ID_PK_COLUMN, 12));
- assertNotNull(e42c);
- assertEquals(ObjectChangeType.UPDATE, e42c.getType());
- assertEquals(0, e42c.getAttributeChanges().size());
- assertEquals(1, e42c.getToManyRelationshipChanges().size());
-
- ToManyRelationshipChange e42c1 = e42c.getToManyRelationshipChanges().get(E4.E3S.getName());
- assertNotNull(e42c);
-
- assertEquals(0, e42c1.getRemoved().size());
-
- assertEquals(1, e42c1.getAdded().size());
- assertTrue(e42c1.getAdded().contains(e3.getObjectId()));
-
- return null;
- }).when(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
-
- e3.removeFromE4s(e4_1);
- e3.addToE4s(e4_2);
-
- context.commitChanges();
-
- verify(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_FilteredIT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_FilteredIT.java
deleted file mode 100644
index 803283539..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_FilteredIT.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog;
-
-import org.apache.cayenne.ObjectContext;
-import org.apache.cayenne.ObjectId;
-import org.apache.cayenne.commitlog.db.Auditable1;
-import org.apache.cayenne.commitlog.db.Auditable2;
-import org.apache.cayenne.commitlog.db.Auditable3;
-import org.apache.cayenne.commitlog.db.Auditable4;
-import org.apache.cayenne.commitlog.db.AuditableChild1;
-import org.apache.cayenne.commitlog.model.AttributeChange;
-import org.apache.cayenne.commitlog.model.ChangeMap;
-import org.apache.cayenne.commitlog.model.ObjectChange;
-import org.apache.cayenne.commitlog.model.ObjectChangeType;
-import org.apache.cayenne.commitlog.model.ToManyRelationshipChange;
-import org.apache.cayenne.commitlog.unit.AuditableRuntimeCase;
-import org.apache.cayenne.query.SelectById;
-import org.apache.cayenne.runtime.CayenneRuntimeBuilder;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.mockito.stubbing.Answer;
-
-import java.sql.SQLException;
-
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.*;
-
-public class CommitLogFilter_FilteredIT extends AuditableRuntimeCase {
-
- protected ObjectContext context;
- protected CommitLogListener mockListener;
-
- @Override
- protected CayenneRuntimeBuilder configureCayenne() {
- this.mockListener = mock(CommitLogListener.class);
- return super.configureCayenne().addModule(
- b -> CommitLogModule.extend(b).commitLogAnnotationEntitiesOnly().addListener(mockListener));
- }
-
- @BeforeEach
- public void before() {
- context = runtime.newContext();
- }
-
- @Test
- public void postCommit_Insert() {
-
- doAnswer((Answer<Object>) invocation -> {
-
- assertSame(context, invocation.getArguments()[0]);
-
- ChangeMap changes = (ChangeMap) invocation.getArguments()[1];
- assertNotNull(changes);
- assertEquals(2, changes.getChanges().size());
- assertEquals(1, changes.getUniqueChanges().size());
-
- ObjectChange c = changes.getUniqueChanges().iterator().next();
- assertNotNull(c);
- assertEquals(ObjectChangeType.INSERT, c.getType());
- assertEquals(1, c.getAttributeChanges().size());
-
- assertEquals(Confidential.getInstance(),
- c.getAttributeChanges().get(Auditable2.CHAR_PROPERTY2.getName()).getNewValue());
-
- return null;
- }).when(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
-
- Auditable2 a1 = context.newObject(Auditable2.class);
- a1.setCharProperty1("yy");
- a1.setCharProperty2("zz");
- context.commitChanges();
-
- verify(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
- }
-
- @Test
- public void postCommit_Update() throws SQLException {
- auditable2.insert(1, "P1_1", "P2_1");
-
- doAnswer((Answer<Object>) invocation -> {
-
- assertSame(context, invocation.getArguments()[0]);
-
- ChangeMap changes = (ChangeMap) invocation.getArguments()[1];
- assertNotNull(changes);
- assertEquals(1, changes.getUniqueChanges().size());
-
- ObjectChange c = changes.getChanges().get(ObjectId.of("Auditable2", Auditable2.ID_PK_COLUMN, 1));
- assertNotNull(c);
- assertEquals(ObjectChangeType.UPDATE, c.getType());
- assertEquals(1, c.getAttributeChanges().size());
- AttributeChange pc = c.getAttributeChanges().get(Auditable2.CHAR_PROPERTY2.getName());
- assertNotNull(pc);
- assertEquals(Confidential.getInstance(), pc.getOldValue());
- assertEquals(Confidential.getInstance(), pc.getNewValue());
-
- return null;
- }).when(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
-
- Auditable2 a1 = SelectById.query(Auditable2.class, 1).selectOne(context);
- a1.setCharProperty1("P1_2");
- a1.setCharProperty2("P2_2");
- context.commitChanges();
-
- verify(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
- }
-
- @Test
- public void postCommit_Delete() throws SQLException {
- auditable2.insert(1, "P1_1", "P2_1");
-
- doAnswer((Answer<Object>) invocation -> {
-
- assertSame(context, invocation.getArguments()[0]);
-
- ChangeMap changes = (ChangeMap) invocation.getArguments()[1];
- assertNotNull(changes);
- assertEquals(1, changes.getUniqueChanges().size());
-
- ObjectChange c = changes.getChanges().get(ObjectId.of("Auditable2", Auditable2.ID_PK_COLUMN, 1));
- assertNotNull(c);
- assertEquals(ObjectChangeType.DELETE, c.getType());
- assertEquals(1, c.getAttributeChanges().size());
- assertEquals(Confidential.getInstance(),
- c.getAttributeChanges().get(Auditable2.CHAR_PROPERTY2.getName()).getOldValue());
-
- return null;
- }).when(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
-
- Auditable2 a1 = SelectById.query(Auditable2.class, 1).selectOne(context);
- context.deleteObject(a1);
- context.commitChanges();
-
- verify(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
- }
-
- @Test
- public void postCommit_UpdateToMany() throws SQLException {
- auditable1.insert(1, "xx");
- auditableChild1.insert(1, 1, "cc1");
- auditableChild1.insert(2, null, "cc2");
- auditableChild1.insert(3, null, "cc3");
-
- final AuditableChild1 ac1 = SelectById.query(AuditableChild1.class, 1).selectOne(context);
- final AuditableChild1 ac2 = SelectById.query(AuditableChild1.class, 2).selectOne(context);
- final AuditableChild1 ac3 = SelectById.query(AuditableChild1.class, 3).selectOne(context);
-
- final Auditable1 a1 = SelectById.query(Auditable1.class, 1).selectOne(context);
-
- doAnswer((Answer<Object>) invocation -> {
-
- assertSame(context, invocation.getArguments()[0]);
-
- ChangeMap changes = (ChangeMap) invocation.getArguments()[1];
- assertNotNull(changes);
- assertEquals(1, changes.getUniqueChanges().size());
-
- ObjectChange a1c = changes.getChanges().get(ObjectId.of("Auditable1", Auditable1.ID_PK_COLUMN, 1));
- assertNotNull(a1c);
- assertEquals(ObjectChangeType.UPDATE, a1c.getType());
- assertEquals(0, a1c.getAttributeChanges().size());
-
- assertEquals(1, a1c.getToManyRelationshipChanges().size());
-
- ToManyRelationshipChange a1c1 = a1c.getToManyRelationshipChanges().get(Auditable1.CHILDREN1.getName());
- assertNotNull(a1c1);
-
- assertEquals(2, a1c1.getAdded().size());
- assertTrue(a1c1.getAdded().contains(ac2.getObjectId()));
- assertTrue(a1c1.getAdded().contains(ac3.getObjectId()));
-
- assertEquals(1, a1c1.getRemoved().size());
- assertTrue(a1c1.getRemoved().contains(ac1.getObjectId()));
-
- return null;
- }).when(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
-
- a1.removeFromChildren1(ac1);
- a1.addToChildren1(ac2);
- a1.addToChildren1(ac3);
-
- context.commitChanges();
-
- verify(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
- }
-
- @Test
- public void postCommit_IgnoreAttributes() throws SQLException {
-
- auditable3.insert(1, "31", "32");
-
- final Auditable3 a3 = SelectById.query(Auditable3.class, 1).selectOne(context);
-
- doAnswer((Answer<Object>) invocation -> {
-
- assertSame(context, invocation.getArguments()[0]);
-
- ChangeMap changes = (ChangeMap) invocation.getArguments()[1];
- assertNull(changes.getChanges().get(ObjectId.of("Auditable3", Auditable3.ID_PK_COLUMN, 1)));
-
- return null;
- }).when(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
-
- a3.setCharProperty1("33");
- a3.setCharProperty2("34");
-
- context.commitChanges();
-
- verify(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
- }
-
- @Test
- public void postCommit_IgnoreToMany() throws SQLException {
-
- auditable3.insert(1, "31", "32");
- auditable4.insert(11, "41", "42", 1);
- auditable4.insert(12, "43", "44", 1);
-
- final Auditable3 a3 = SelectById.query(Auditable3.class, 1).selectOne(context);
- final Auditable4 a41 = SelectById.query(Auditable4.class, 11).selectOne(context);
- final Auditable4 a42 = SelectById.query(Auditable4.class, 12).selectOne(context);
-
- doAnswer((Answer<Object>) invocation -> {
-
- assertSame(context, invocation.getArguments()[0]);
-
- ChangeMap changes = (ChangeMap) invocation.getArguments()[1];
- assertNull(changes.getChanges().get(ObjectId.of("Auditable3", Auditable3.ID_PK_COLUMN, 1)));
-
- return null;
- }).when(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
-
- a3.removeFromAuditable4s(a41);
- a3.addToAuditable4s(a42);
-
- context.commitChanges();
-
- verify(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
- }
-
- @Test
- public void postCommit_IgnoreToOne() throws SQLException {
-
- auditable3.insert(1, "31", "32");
- auditable3.insert(2, "33", "34");
- auditable4.insert(11, "41", "41", 1);
-
- final Auditable3 a32 = SelectById.query(Auditable3.class, 2).selectOne(context);
-
- final Auditable4 a4 = SelectById.query(Auditable4.class, 11).selectOne(context);
-
- doAnswer((Answer<Object>) invocation -> {
-
- assertSame(context, invocation.getArguments()[0]);
-
- ChangeMap changes = (ChangeMap) invocation.getArguments()[1];
- assertNull(changes.getChanges().get(ObjectId.of("Auditable4", Auditable4.ID_PK_COLUMN, 11)));
-
- return null;
- }).when(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
-
- a4.setAuditable3(a32);
-
- context.commitChanges();
-
- verify(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
- }
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_ListenerInducedChangesIT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_ListenerInducedChangesIT.java
deleted file mode 100644
index ec583efa5..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_ListenerInducedChangesIT.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog;
-
-import org.apache.cayenne.ObjectContext;
-import org.apache.cayenne.annotation.PrePersist;
-import org.apache.cayenne.annotation.PreUpdate;
-import org.apache.cayenne.commitlog.db.Auditable1;
-import org.apache.cayenne.commitlog.db.AuditableChild1;
-import org.apache.cayenne.commitlog.model.AttributeChange;
-import org.apache.cayenne.commitlog.model.ChangeMap;
-import org.apache.cayenne.commitlog.model.ObjectChange;
-import org.apache.cayenne.commitlog.model.ObjectChangeType;
-import org.apache.cayenne.commitlog.unit.AuditableRuntimeCase;
-import org.apache.cayenne.query.SelectById;
-import org.apache.cayenne.runtime.CayenneRuntimeBuilder;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.*;
-
-/**
- * Testing capturing changes introduced by the pre-commit listeners.
- */
-public class CommitLogFilter_ListenerInducedChangesIT extends AuditableRuntimeCase {
-
- protected ObjectContext context;
- protected CommitLogListener mockListener;
-
- @Override
- protected CayenneRuntimeBuilder configureCayenne() {
- this.mockListener = mock(CommitLogListener.class);
- return super.configureCayenne().addModule(
- b -> CommitLogModule.extend(b).addListener(mockListener));
- }
-
- @BeforeEach
- public void before() {
- context = runtime.newContext();
- }
-
- @Test
- public void postCommit_Insert() {
-
- final InsertListener listener = new InsertListener();
- runtime.getDataDomain().addListener(listener);
-
- final Auditable1 a1 = context.newObject(Auditable1.class);
- a1.setCharProperty1("yy");
-
- doAnswer((Answer<Object>) invocation -> {
-
- assertNotNull(listener.c);
-
- List<ObjectChange> sortedChanges = sortedChanges(invocation);
-
- assertEquals(2, sortedChanges.size());
-
- assertEquals(a1.getObjectId(), sortedChanges.get(0).getPostCommitId());
- assertEquals(ObjectChangeType.INSERT, sortedChanges.get(0).getType());
-
- assertEquals(listener.c.getObjectId(), sortedChanges.get(1).getPostCommitId());
- assertEquals(ObjectChangeType.INSERT, sortedChanges.get(1).getType());
-
- AttributeChange listenerInducedChange = sortedChanges.get(1).getAttributeChanges()
- .get(AuditableChild1.CHAR_PROPERTY1.getName());
- assertNotNull(listenerInducedChange);
- assertEquals("c1", listenerInducedChange.getNewValue());
-
- return null;
- }).when(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
-
- context.commitChanges();
-
- verify(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
- }
-
- @Test
- public void postCommit_Delete() throws SQLException {
-
- auditable1.insert(1, "yy");
- auditableChild1.insert(31, 1, "yyc");
-
- final DeleteListener listener = new DeleteListener();
- runtime.getDataDomain().addListener(listener);
-
- final Auditable1 a1 = SelectById.query(Auditable1.class, 1).prefetch(Auditable1.CHILDREN1.joint())
- .selectFirst(context);
- a1.setCharProperty1("zz");
-
- doAnswer((Answer<Object>) invocation -> {
-
- assertNotNull(listener.toDelete);
- assertEquals(1, listener.toDelete.size());
-
- List<ObjectChange> sortedChanges = sortedChanges(invocation);
-
- assertEquals(2, sortedChanges.size());
-
- assertEquals(ObjectChangeType.UPDATE, sortedChanges.get(0).getType());
- assertEquals(a1.getObjectId(), sortedChanges.get(0).getPostCommitId());
-
- assertEquals(ObjectChangeType.DELETE, sortedChanges.get(1).getType());
- assertEquals(listener.toDelete.get(0).getObjectId(), sortedChanges.get(1).getPostCommitId());
-
- AttributeChange listenerInducedChange = sortedChanges.get(1).getAttributeChanges()
- .get(AuditableChild1.CHAR_PROPERTY1.getName());
- assertNotNull(listenerInducedChange);
- assertEquals("yyc", listenerInducedChange.getOldValue());
-
- return null;
- }).when(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
-
- context.commitChanges();
-
- verify(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
- }
-
- @Test
- public void postCommit_Update() throws SQLException {
-
- auditable1.insert(1, "yy");
- auditableChild1.insert(31, 1, "yyc");
-
- final UpdateListener listener = new UpdateListener();
- runtime.getDataDomain().addListener(listener);
-
- final Auditable1 a1 = SelectById.query(Auditable1.class, 1).prefetch(Auditable1.CHILDREN1.joint())
- .selectFirst(context);
- a1.setCharProperty1("zz");
-
- doAnswer((Answer<Object>) invocation -> {
-
- assertNotNull(listener.toUpdate);
- assertEquals(1, listener.toUpdate.size());
-
- List<ObjectChange> sortedChanges = sortedChanges(invocation);
-
- assertEquals(2, sortedChanges.size());
-
- assertEquals(ObjectChangeType.UPDATE, sortedChanges.get(0).getType());
- assertEquals(a1.getObjectId(), sortedChanges.get(0).getPostCommitId());
-
- assertEquals(ObjectChangeType.UPDATE, sortedChanges.get(1).getType());
- assertEquals(listener.toUpdate.get(0).getObjectId(), sortedChanges.get(1).getPostCommitId());
-
- AttributeChange listenerInducedChange = sortedChanges.get(1).getAttributeChanges()
- .get(AuditableChild1.CHAR_PROPERTY1.getName());
- assertNotNull(listenerInducedChange);
- assertEquals("yyc", listenerInducedChange.getOldValue());
- assertEquals("yyc_", listenerInducedChange.getNewValue());
-
- return null;
- }).when(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
-
- context.commitChanges();
-
- verify(mockListener).onPostCommit(any(ObjectContext.class), any(ChangeMap.class));
- }
-
- private List<ObjectChange> sortedChanges(InvocationOnMock invocation) {
- assertSame(context, invocation.getArguments()[0]);
-
- ChangeMap changes = (ChangeMap) invocation.getArguments()[1];
-
- List<ObjectChange> sortedChanges = new ArrayList<>(changes.getUniqueChanges());
- sortedChanges.sort(Comparator.comparing(o -> o.getPostCommitId().getEntityName()));
-
- return sortedChanges;
- }
-
- static class InsertListener {
-
- private AuditableChild1 c;
-
- @PrePersist(Auditable1.class)
- public void prePersist(Auditable1 a) {
-
- c = a.getObjectContext().newObject(AuditableChild1.class);
- c.setCharProperty1("c1");
- c.setParent(a);
- }
- }
-
- static class DeleteListener {
-
- private List<AuditableChild1> toDelete;
-
- @PreUpdate(Auditable1.class)
- public void prePersist(Auditable1 a) {
-
- toDelete = new ArrayList<>(a.getChildren1());
- for (AuditableChild1 c : toDelete) {
- c.getObjectContext().deleteObject(c);
- }
- }
- }
-
- static class UpdateListener {
-
- private List<AuditableChild1> toUpdate;
-
- @PreUpdate(Auditable1.class)
- public void prePersist(Auditable1 a) {
-
- toUpdate = new ArrayList<>(a.getChildren1());
- for (AuditableChild1 c : toUpdate) {
- c.setCharProperty1(c.getCharProperty1() + "_");
- }
- }
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_OutsideTxIT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_OutsideTxIT.java
deleted file mode 100644
index b67b19099..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_OutsideTxIT.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog;
-
-import org.apache.cayenne.ObjectContext;
-import org.apache.cayenne.commitlog.db.AuditLog;
-import org.apache.cayenne.commitlog.db.Auditable2;
-import org.apache.cayenne.commitlog.model.ObjectChange;
-import org.apache.cayenne.commitlog.unit.AuditableRuntimeCase;
-import org.apache.cayenne.runtime.CayenneRuntimeBuilder;
-import org.apache.cayenne.tx.BaseTransaction;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import java.sql.SQLException;
-import java.util.List;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNull;
-
-public class CommitLogFilter_OutsideTxIT extends AuditableRuntimeCase {
-
- protected ObjectContext context;
- protected CommitLogListener listener;
-
- @Override
- protected CayenneRuntimeBuilder configureCayenne() {
- this.listener = (originatingContext, changes) -> {
-
- // assert we are inside transaction
- assertNull(BaseTransaction.getThreadTransaction());
-
- for (ObjectChange c : changes.getUniqueChanges()) {
- AuditLog log = runtime.newContext().newObject(AuditLog.class);
- log.setLog("DONE: " + c.getPostCommitId());
- log.getObjectContext().commitChanges();
- }
- };
- return super.configureCayenne()
- .addModule(b -> CommitLogModule.extend(b)
- .commitLogAnnotationEntitiesOnly()
- .excludeFromTransaction()
- .addListener(listener));
- }
-
- @BeforeEach
- public void before() {
- this.context = runtime.newContext();
- }
-
- @Test
- public void commitLog() throws SQLException {
- Auditable2 a1 = context.newObject(Auditable2.class);
- a1.setCharProperty1("yy");
- a1.setCharProperty2("zz");
-
- Auditable2 a2 = context.newObject(Auditable2.class);
- a2.setCharProperty1("yy");
- a2.setCharProperty2("zz");
- context.commitChanges();
-
- List<Object[]> logs = auditLog.selectAll();
- assertEquals(2, logs.size());
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_PreUpdate_IT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_PreUpdate_IT.java
deleted file mode 100644
index a503bebdb..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_PreUpdate_IT.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog;
-
-import org.apache.cayenne.ObjectContext;
-import org.apache.cayenne.annotation.PreUpdate;
-import org.apache.cayenne.commitlog.db.AuditLog;
-import org.apache.cayenne.commitlog.db.AuditableChild5;
-import org.apache.cayenne.commitlog.model.ObjectChange;
-import org.apache.cayenne.commitlog.unit.AuditableRuntimeCase;
-import org.apache.cayenne.configuration.runtime.CoreModule;
-import org.apache.cayenne.query.ObjectSelect;
-import org.apache.cayenne.runtime.CayenneRuntimeBuilder;
-import org.apache.cayenne.tx.BaseTransaction;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import java.sql.SQLException;
-import java.util.List;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-
-public class CommitLogFilter_PreUpdate_IT extends AuditableRuntimeCase {
-
- protected ObjectContext context;
- protected CommitLogListener listener;
-
- @Override
- protected CayenneRuntimeBuilder configureCayenne() {
- this.listener = (originatingContext, changes) -> {
- // assert we are not inside a transaction
- assertNotNull(BaseTransaction.getThreadTransaction());
-
- for (ObjectChange c : changes.getUniqueChanges()) {
- AuditLog log = runtime.newContext().newObject(AuditLog.class);
- log.setLog("DONE: " + c.getPostCommitId());
- log.getObjectContext().commitChanges();
- }
- };
-
- return super.configureCayenne()
- .addModule(binder ->
- CoreModule.extend(binder)
- .addListenerType(MyPreUpdateListener.class)
- )
- .addModule(binder ->
- CommitLogModule.extend(binder)
- .commitLogAnnotationEntitiesOnly()
- .addListener(listener)
- );
- }
-
- @BeforeEach
- public void before() throws Exception {
- context = runtime.newContext();
- auditable5.insert(1, "yy");
- auditableChild5.insert(1, 1, "zz");
- }
-
- @Test
- public void commitLog() throws SQLException {
-
- AuditableChild5 auditableChild = ObjectSelect.query(AuditableChild5.class)
- .selectOne(context);
- assertEquals("zz", auditableChild.getCharProperty1());
-
- auditableChild.setCharProperty1("xx");
-
- context.commitChanges();
-
- List<Object[]> logs = auditLog.selectAll();
- assertEquals(2, logs.size());
- }
-
- public static class MyPreUpdateListener {
-
- @PreUpdate({ AuditableChild5.class })
- public void preUpdate( AuditableChild5 child ) {
- child.getParent().setCharProperty1("zz");
- }
- }
-
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_PreUpdate_OutsideTxIT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_PreUpdate_OutsideTxIT.java
deleted file mode 100644
index 9dddc997b..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_PreUpdate_OutsideTxIT.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog;
-
-import org.apache.cayenne.ObjectContext;
-import org.apache.cayenne.annotation.PreUpdate;
-import org.apache.cayenne.commitlog.db.AuditLog;
-import org.apache.cayenne.commitlog.db.AuditableChild5;
-import org.apache.cayenne.commitlog.model.ObjectChange;
-import org.apache.cayenne.commitlog.unit.AuditableRuntimeCase;
-import org.apache.cayenne.configuration.runtime.CoreModule;
-import org.apache.cayenne.query.ObjectSelect;
-import org.apache.cayenne.runtime.CayenneRuntimeBuilder;
-import org.apache.cayenne.tx.BaseTransaction;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import java.sql.SQLException;
-import java.util.List;
-
-import static org.junit.jupiter.api.Assertions.*;
-
-public class CommitLogFilter_PreUpdate_OutsideTxIT extends AuditableRuntimeCase {
-
- protected ObjectContext context;
- protected CommitLogListener listener;
-
- @Override
- protected CayenneRuntimeBuilder configureCayenne() {
- this.listener = (originatingContext, changes) -> {
- // assert we are not inside a transaction
- assertNull(BaseTransaction.getThreadTransaction());
-
- for (ObjectChange c : changes.getUniqueChanges()) {
- AuditLog log = runtime.newContext().newObject(AuditLog.class);
- log.setLog("DONE: " + c.getPostCommitId());
- log.getObjectContext().commitChanges();
- }
- };
-
- return super.configureCayenne()
- .addModule(binder ->
- CoreModule.extend(binder)
- .addListenerType(MyPreUpdateListener.class)
- )
- .addModule(
- b -> CommitLogModule.extend(b)
- .commitLogAnnotationEntitiesOnly()
- .excludeFromTransaction()
- .addListener(listener)
- );
- }
-
- @BeforeEach
- public void before() throws Exception {
- context = runtime.newContext();
- auditable5.insert(1, "yy");
- auditableChild5.insert(1, 1, "zz");
- }
-
- @Test
- public void commitLog() throws SQLException {
-
- AuditableChild5 auditableChild = ObjectSelect.query(AuditableChild5.class)
- .selectOne(context);
- assertEquals("zz", auditableChild.getCharProperty1());
-
- auditableChild.setCharProperty1("xx");
-
- context.commitChanges();
-
- List<Object[]> logs = auditLog.selectAll();
- assertEquals(2, logs.size());
- }
-
- public static class MyPreUpdateListener {
-
- @PreUpdate({ AuditableChild5.class })
- public void preUpdate( AuditableChild5 child ) {
- child.getParent().setCharProperty1("zz");
- }
- }
-
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_TxIT.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_TxIT.java
deleted file mode 100644
index bba671c78..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogFilter_TxIT.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog;
-
-import org.apache.cayenne.ObjectContext;
-import org.apache.cayenne.commitlog.db.AuditLog;
-import org.apache.cayenne.commitlog.db.Auditable2;
-import org.apache.cayenne.commitlog.model.ObjectChange;
-import org.apache.cayenne.commitlog.unit.AuditableRuntimeCase;
-import org.apache.cayenne.runtime.CayenneRuntimeBuilder;
-import org.apache.cayenne.tx.BaseTransaction;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import java.sql.SQLException;
-import java.util.List;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-
-public class CommitLogFilter_TxIT extends AuditableRuntimeCase {
-
- protected ObjectContext context;
- protected CommitLogListener listener;
-
- @Override
- protected CayenneRuntimeBuilder configureCayenne() {
- this.listener = (originatingContext, changes) -> {
-
- // assert we are inside transaction
- assertNotNull(BaseTransaction.getThreadTransaction());
-
- for (ObjectChange c : changes.getUniqueChanges()) {
- AuditLog log = runtime.newContext().newObject(AuditLog.class);
- log.setLog("DONE: " + c.getPostCommitId());
- log.getObjectContext().commitChanges();
- }
- };
- return super.configureCayenne().
- addModule(b -> CommitLogModule.extend(b).commitLogAnnotationEntitiesOnly().addListener(listener));
- }
-
- @BeforeEach
- public void before() {
- this.context = runtime.newContext();
- }
-
- @Test
- public void commitLog() throws SQLException {
- Auditable2 a1 = context.newObject(Auditable2.class);
- a1.setCharProperty1("yy");
- a1.setCharProperty2("zz");
-
- Auditable2 a2 = context.newObject(Auditable2.class);
- a2.setCharProperty1("yy");
- a2.setCharProperty2("zz");
- context.commitChanges();
-
- List<Object[]> logs = auditLog.selectAll();
- assertEquals(2, logs.size());
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogModuleBuilderTest.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogModuleBuilderTest.java
deleted file mode 100644
index 30eb21afc..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogModuleBuilderTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog;
-
-import org.apache.cayenne.ObjectContext;
-import org.apache.cayenne.commitlog.model.ChangeMap;
-import org.apache.cayenne.di.DIBootstrap;
-import org.apache.cayenne.di.Injector;
-import org.apache.cayenne.di.Key;
-import org.apache.cayenne.di.Module;
-import org.junit.jupiter.api.Test;
-
-import java.util.List;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class CommitLogModuleBuilderTest {
-
- @Test
- public void listener_Object() {
-
- L listener = new L();
- Module m = b -> CommitLogModule.extend(b).addListener(listener);
-
- Injector i = DIBootstrap.createInjector(m);
- List<CommitLogListener> listeners = i.getInstance(Key.getListOf(CommitLogListener.class));
- assertEquals(1, listeners.size());
- assertTrue(listeners.contains(listener));
- }
-
- @Test
- public void listener_Class() {
-
- Module m = b -> CommitLogModule.extend(b).addListener(L.class);
-
- Injector i = DIBootstrap.createInjector(m);
- List<CommitLogListener> listeners = i.getInstance(Key.getListOf(CommitLogListener.class));
- assertEquals(1, listeners.size());
- assertTrue(listeners.get(0) instanceof L);
- }
-
- public static class L implements CommitLogListener {
-
- @Override
- public void onPostCommit(ObjectContext originatingContext, ChangeMap changes) {
- // do nothing.
- }
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogModuleProviderTest.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogModuleProviderTest.java
deleted file mode 100644
index 0784d46d4..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/CommitLogModuleProviderTest.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog;
-
-import org.apache.cayenne.runtime.CayenneRuntimeModuleProvider;
-import org.apache.cayenne.unit.ModuleProviderChecker;
-import org.junit.jupiter.api.Test;
-
-public class CommitLogModuleProviderTest {
-
- @Test
- public void autoLoadable() {
- ModuleProviderChecker.testProviderPresent(CommitLogModuleProvider.class, CayenneRuntimeModuleProvider.class);
- }
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/AuditLog.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/AuditLog.java
deleted file mode 100644
index 477da260f..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/AuditLog.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.db;
-
-import org.apache.cayenne.commitlog.db.auto._AuditLog;
-
-public class AuditLog extends _AuditLog {
-
- private static final long serialVersionUID = 1L;
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/Auditable1.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/Auditable1.java
deleted file mode 100644
index b47cd04e8..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/Auditable1.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.db;
-
-import org.apache.cayenne.commitlog.CommitLog;
-import org.apache.cayenne.commitlog.db.auto._Auditable1;
-
-@CommitLog
-public class Auditable1 extends _Auditable1 {
-
- private static final long serialVersionUID = 8458581370578140962L;
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/Auditable2.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/Auditable2.java
deleted file mode 100644
index 6be1a43c3..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/Auditable2.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.db;
-
-import org.apache.cayenne.commitlog.CommitLog;
-import org.apache.cayenne.commitlog.db.auto._Auditable2;
-
-@CommitLog(ignoredProperties = "charProperty1", confidential = "charProperty2")
-public class Auditable2 extends _Auditable2 {
-
- private static final long serialVersionUID = 5203324250911707978L;
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/Auditable3.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/Auditable3.java
deleted file mode 100644
index 3eb128e87..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/Auditable3.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.db;
-
-import org.apache.cayenne.commitlog.CommitLog;
-import org.apache.cayenne.commitlog.db.auto._Auditable3;
-
-@CommitLog(ignoreAttributes = true, ignoreToManyRelationships = true)
-public class Auditable3 extends _Auditable3 {
-
- private static final long serialVersionUID = 1L;
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/Auditable4.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/Auditable4.java
deleted file mode 100644
index 382f234ee..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/Auditable4.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.db;
-
-import org.apache.cayenne.commitlog.CommitLog;
-import org.apache.cayenne.commitlog.db.auto._Auditable4;
-
-@CommitLog(ignoreToOneRelationships = true)
-public class Auditable4 extends _Auditable4 {
-
- private static final long serialVersionUID = 1L;
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/Auditable5.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/Auditable5.java
deleted file mode 100644
index ed13e0b34..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/Auditable5.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.db;
-
-import org.apache.cayenne.commitlog.CommitLog;
-import org.apache.cayenne.commitlog.db.auto._Auditable5;
-
-@CommitLog
-public class Auditable5 extends _Auditable5 {
-
- private static final long serialVersionUID = 1L;
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/AuditableChild1.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/AuditableChild1.java
deleted file mode 100644
index dcc2e4894..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/AuditableChild1.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.db;
-
-import org.apache.cayenne.commitlog.db.auto._AuditableChild1;
-
-public class AuditableChild1 extends _AuditableChild1 {
-
- private static final long serialVersionUID = 7967782239405764614L;
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/AuditableChild1x.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/AuditableChild1x.java
deleted file mode 100644
index baeae14ec..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/AuditableChild1x.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.db;
-
-import org.apache.cayenne.commitlog.db.auto._AuditableChild1x;
-
-public class AuditableChild1x extends _AuditableChild1x {
-
- private static final long serialVersionUID = 1L;
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/AuditableChild3.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/AuditableChild3.java
deleted file mode 100644
index 971f302b0..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/AuditableChild3.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.db;
-
-import org.apache.cayenne.commitlog.db.auto._AuditableChild3;
-
-public class AuditableChild3 extends _AuditableChild3 {
- private static final long serialVersionUID = 1L;
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/AuditableChild5.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/AuditableChild5.java
deleted file mode 100644
index 5e8c44564..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/AuditableChild5.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.db;
-
-import org.apache.cayenne.commitlog.CommitLog;
-import org.apache.cayenne.commitlog.db.auto._AuditableChild5;
-
-@CommitLog
-public class AuditableChild5 extends _AuditableChild5 {
-
- private static final long serialVersionUID = 1L;
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/E1.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/E1.java
deleted file mode 100644
index 56b53fa9e..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/E1.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.db;
-
-import org.apache.cayenne.commitlog.db.auto._E1;
-
-public class E1 extends _E1 {
- private static final long serialVersionUID = 1L;
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/E2.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/E2.java
deleted file mode 100644
index 8da1dc26d..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/E2.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.db;
-
-import org.apache.cayenne.commitlog.db.auto._E2;
-
-public class E2 extends _E2 {
- private static final long serialVersionUID = 1L;
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/E3.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/E3.java
deleted file mode 100644
index 4f37e825f..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/E3.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.db;
-
-import org.apache.cayenne.commitlog.db.auto._E3;
-
-public class E3 extends _E3 {
-
- private static final long serialVersionUID = 1L;
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/E4.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/E4.java
deleted file mode 100644
index 61e5a8f81..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/E4.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.db;
-
-import org.apache.cayenne.commitlog.db.auto._E4;
-
-public class E4 extends _E4 {
-
- private static final long serialVersionUID = 1L;
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/LifecycleMap.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/LifecycleMap.java
deleted file mode 100644
index dc1f263a5..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/LifecycleMap.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.db;
-
-import org.apache.cayenne.commitlog.db.auto._LifecycleMap;
-
-public class LifecycleMap extends _LifecycleMap {
-
- private static LifecycleMap instance;
-
- private LifecycleMap() {}
-
- public static LifecycleMap getInstance() {
- if(instance == null) {
- instance = new LifecycleMap();
- }
-
- return instance;
- }
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_AuditLog.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_AuditLog.java
deleted file mode 100644
index 9893d7157..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_AuditLog.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package org.apache.cayenne.commitlog.db.auto;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.apache.cayenne.PersistentObject;
-import org.apache.cayenne.commitlog.db.AuditLog;
-import org.apache.cayenne.exp.property.PropertyFactory;
-import org.apache.cayenne.exp.property.SelfProperty;
-import org.apache.cayenne.exp.property.StringProperty;
-
-/**
- * Class _AuditLog was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public abstract class _AuditLog extends PersistentObject {
-
- private static final long serialVersionUID = 1L;
-
- public static final SelfProperty<AuditLog> SELF = PropertyFactory.createSelf(AuditLog.class);
-
- public static final String ID_PK_COLUMN = "ID";
-
- public static final StringProperty<String> LOG = PropertyFactory.createString("log", String.class);
-
- protected String log;
-
-
- public void setLog(String log) {
- beforePropertyWrite("log", this.log, log);
- this.log = log;
- }
-
- public String getLog() {
- beforePropertyRead("log");
- return this.log;
- }
-
- @Override
- public Object readPropertyDirectly(String propName) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch(propName) {
- case "log":
- return this.log;
- default:
- return super.readPropertyDirectly(propName);
- }
- }
-
- @Override
- public void writePropertyDirectly(String propName, Object val) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch (propName) {
- case "log":
- this.log = (String)val;
- break;
- default:
- super.writePropertyDirectly(propName, val);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- writeSerialized(out);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- readSerialized(in);
- }
-
- @Override
- protected void writeState(ObjectOutputStream out) throws IOException {
- super.writeState(out);
- out.writeObject(this.log);
- }
-
- @Override
- protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
- super.readState(in);
- this.log = (String)in.readObject();
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_Auditable1.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_Auditable1.java
deleted file mode 100644
index 714cdb14e..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_Auditable1.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package org.apache.cayenne.commitlog.db.auto;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.List;
-
-import org.apache.cayenne.PersistentObject;
-import org.apache.cayenne.commitlog.db.Auditable1;
-import org.apache.cayenne.commitlog.db.AuditableChild1;
-import org.apache.cayenne.exp.property.ListProperty;
-import org.apache.cayenne.exp.property.PropertyFactory;
-import org.apache.cayenne.exp.property.SelfProperty;
-import org.apache.cayenne.exp.property.StringProperty;
-
-/**
- * Class _Auditable1 was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public abstract class _Auditable1 extends PersistentObject {
-
- private static final long serialVersionUID = 1L;
-
- public static final SelfProperty<Auditable1> SELF = PropertyFactory.createSelf(Auditable1.class);
-
- public static final String ID_PK_COLUMN = "ID";
-
- public static final StringProperty<String> CHAR_PROPERTY1 = PropertyFactory.createString("charProperty1", String.class);
- public static final ListProperty<AuditableChild1> CHILDREN1 = PropertyFactory.createList("children1", AuditableChild1.class);
-
- protected String charProperty1;
-
- protected Object children1;
-
- public void setCharProperty1(String charProperty1) {
- beforePropertyWrite("charProperty1", this.charProperty1, charProperty1);
- this.charProperty1 = charProperty1;
- }
-
- public String getCharProperty1() {
- beforePropertyRead("charProperty1");
- return this.charProperty1;
- }
-
- public void addToChildren1(AuditableChild1 obj) {
- addToManyTarget("children1", obj, true);
- }
-
- public void removeFromChildren1(AuditableChild1 obj) {
- removeToManyTarget("children1", obj, true);
- }
-
- @SuppressWarnings("unchecked")
- public List<AuditableChild1> getChildren1() {
- return (List<AuditableChild1>)readProperty("children1");
- }
-
- @Override
- public Object readPropertyDirectly(String propName) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch(propName) {
- case "charProperty1":
- return this.charProperty1;
- case "children1":
- return this.children1;
- default:
- return super.readPropertyDirectly(propName);
- }
- }
-
- @Override
- public void writePropertyDirectly(String propName, Object val) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch (propName) {
- case "charProperty1":
- this.charProperty1 = (String)val;
- break;
- case "children1":
- this.children1 = val;
- break;
- default:
- super.writePropertyDirectly(propName, val);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- writeSerialized(out);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- readSerialized(in);
- }
-
- @Override
- protected void writeState(ObjectOutputStream out) throws IOException {
- super.writeState(out);
- out.writeObject(this.charProperty1);
- out.writeObject(this.children1);
- }
-
- @Override
- protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
- super.readState(in);
- this.charProperty1 = (String)in.readObject();
- this.children1 = in.readObject();
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_Auditable2.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_Auditable2.java
deleted file mode 100644
index 9e5a20ed5..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_Auditable2.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package org.apache.cayenne.commitlog.db.auto;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.List;
-
-import org.apache.cayenne.PersistentObject;
-import org.apache.cayenne.commitlog.db.Auditable2;
-import org.apache.cayenne.commitlog.db.AuditableChild3;
-import org.apache.cayenne.exp.property.ListProperty;
-import org.apache.cayenne.exp.property.PropertyFactory;
-import org.apache.cayenne.exp.property.SelfProperty;
-import org.apache.cayenne.exp.property.StringProperty;
-
-/**
- * Class _Auditable2 was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public abstract class _Auditable2 extends PersistentObject {
-
- private static final long serialVersionUID = 1L;
-
- public static final SelfProperty<Auditable2> SELF = PropertyFactory.createSelf(Auditable2.class);
-
- public static final String ID_PK_COLUMN = "ID";
-
- public static final StringProperty<String> CHAR_PROPERTY1 = PropertyFactory.createString("charProperty1", String.class);
- public static final StringProperty<String> CHAR_PROPERTY2 = PropertyFactory.createString("charProperty2", String.class);
- public static final ListProperty<AuditableChild3> CHILDREN = PropertyFactory.createList("children", AuditableChild3.class);
-
- protected String charProperty1;
- protected String charProperty2;
-
- protected Object children;
-
- public void setCharProperty1(String charProperty1) {
- beforePropertyWrite("charProperty1", this.charProperty1, charProperty1);
- this.charProperty1 = charProperty1;
- }
-
- public String getCharProperty1() {
- beforePropertyRead("charProperty1");
- return this.charProperty1;
- }
-
- public void setCharProperty2(String charProperty2) {
- beforePropertyWrite("charProperty2", this.charProperty2, charProperty2);
- this.charProperty2 = charProperty2;
- }
-
- public String getCharProperty2() {
- beforePropertyRead("charProperty2");
- return this.charProperty2;
- }
-
- public void addToChildren(AuditableChild3 obj) {
- addToManyTarget("children", obj, true);
- }
-
- public void removeFromChildren(AuditableChild3 obj) {
- removeToManyTarget("children", obj, true);
- }
-
- @SuppressWarnings("unchecked")
- public List<AuditableChild3> getChildren() {
- return (List<AuditableChild3>)readProperty("children");
- }
-
- @Override
- public Object readPropertyDirectly(String propName) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch(propName) {
- case "charProperty1":
- return this.charProperty1;
- case "charProperty2":
- return this.charProperty2;
- case "children":
- return this.children;
- default:
- return super.readPropertyDirectly(propName);
- }
- }
-
- @Override
- public void writePropertyDirectly(String propName, Object val) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch (propName) {
- case "charProperty1":
- this.charProperty1 = (String)val;
- break;
- case "charProperty2":
- this.charProperty2 = (String)val;
- break;
- case "children":
- this.children = val;
- break;
- default:
- super.writePropertyDirectly(propName, val);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- writeSerialized(out);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- readSerialized(in);
- }
-
- @Override
- protected void writeState(ObjectOutputStream out) throws IOException {
- super.writeState(out);
- out.writeObject(this.charProperty1);
- out.writeObject(this.charProperty2);
- out.writeObject(this.children);
- }
-
- @Override
- protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
- super.readState(in);
- this.charProperty1 = (String)in.readObject();
- this.charProperty2 = (String)in.readObject();
- this.children = in.readObject();
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_Auditable3.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_Auditable3.java
deleted file mode 100644
index edbede352..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_Auditable3.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package org.apache.cayenne.commitlog.db.auto;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.List;
-
-import org.apache.cayenne.PersistentObject;
-import org.apache.cayenne.commitlog.db.Auditable3;
-import org.apache.cayenne.commitlog.db.Auditable4;
-import org.apache.cayenne.exp.property.ListProperty;
-import org.apache.cayenne.exp.property.PropertyFactory;
-import org.apache.cayenne.exp.property.SelfProperty;
-import org.apache.cayenne.exp.property.StringProperty;
-
-/**
- * Class _Auditable3 was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public abstract class _Auditable3 extends PersistentObject {
-
- private static final long serialVersionUID = 1L;
-
- public static final SelfProperty<Auditable3> SELF = PropertyFactory.createSelf(Auditable3.class);
-
- public static final String ID_PK_COLUMN = "ID";
-
- public static final StringProperty<String> CHAR_PROPERTY1 = PropertyFactory.createString("charProperty1", String.class);
- public static final StringProperty<String> CHAR_PROPERTY2 = PropertyFactory.createString("charProperty2", String.class);
- public static final ListProperty<Auditable4> AUDITABLE4S = PropertyFactory.createList("auditable4s", Auditable4.class);
-
- protected String charProperty1;
- protected String charProperty2;
-
- protected Object auditable4s;
-
- public void setCharProperty1(String charProperty1) {
- beforePropertyWrite("charProperty1", this.charProperty1, charProperty1);
- this.charProperty1 = charProperty1;
- }
-
- public String getCharProperty1() {
- beforePropertyRead("charProperty1");
- return this.charProperty1;
- }
-
- public void setCharProperty2(String charProperty2) {
- beforePropertyWrite("charProperty2", this.charProperty2, charProperty2);
- this.charProperty2 = charProperty2;
- }
-
- public String getCharProperty2() {
- beforePropertyRead("charProperty2");
- return this.charProperty2;
- }
-
- public void addToAuditable4s(Auditable4 obj) {
- addToManyTarget("auditable4s", obj, true);
- }
-
- public void removeFromAuditable4s(Auditable4 obj) {
- removeToManyTarget("auditable4s", obj, true);
- }
-
- @SuppressWarnings("unchecked")
- public List<Auditable4> getAuditable4s() {
- return (List<Auditable4>)readProperty("auditable4s");
- }
-
- @Override
- public Object readPropertyDirectly(String propName) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch(propName) {
- case "charProperty1":
- return this.charProperty1;
- case "charProperty2":
- return this.charProperty2;
- case "auditable4s":
- return this.auditable4s;
- default:
- return super.readPropertyDirectly(propName);
- }
- }
-
- @Override
- public void writePropertyDirectly(String propName, Object val) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch (propName) {
- case "charProperty1":
- this.charProperty1 = (String)val;
- break;
- case "charProperty2":
- this.charProperty2 = (String)val;
- break;
- case "auditable4s":
- this.auditable4s = val;
- break;
- default:
- super.writePropertyDirectly(propName, val);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- writeSerialized(out);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- readSerialized(in);
- }
-
- @Override
- protected void writeState(ObjectOutputStream out) throws IOException {
- super.writeState(out);
- out.writeObject(this.charProperty1);
- out.writeObject(this.charProperty2);
- out.writeObject(this.auditable4s);
- }
-
- @Override
- protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
- super.readState(in);
- this.charProperty1 = (String)in.readObject();
- this.charProperty2 = (String)in.readObject();
- this.auditable4s = in.readObject();
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_Auditable4.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_Auditable4.java
deleted file mode 100644
index 83cf03db1..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_Auditable4.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package org.apache.cayenne.commitlog.db.auto;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.apache.cayenne.PersistentObject;
-import org.apache.cayenne.commitlog.db.Auditable3;
-import org.apache.cayenne.commitlog.db.Auditable4;
-import org.apache.cayenne.exp.property.EntityProperty;
-import org.apache.cayenne.exp.property.PropertyFactory;
-import org.apache.cayenne.exp.property.SelfProperty;
-import org.apache.cayenne.exp.property.StringProperty;
-
-/**
- * Class _Auditable4 was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public abstract class _Auditable4 extends PersistentObject {
-
- private static final long serialVersionUID = 1L;
-
- public static final SelfProperty<Auditable4> SELF = PropertyFactory.createSelf(Auditable4.class);
-
- public static final String ID_PK_COLUMN = "ID";
-
- public static final StringProperty<String> CHAR_PROPERTY1 = PropertyFactory.createString("charProperty1", String.class);
- public static final StringProperty<String> CHAR_PROPERTY2 = PropertyFactory.createString("charProperty2", String.class);
- public static final EntityProperty<Auditable3> AUDITABLE3 = PropertyFactory.createEntity("auditable3", Auditable3.class);
-
- protected String charProperty1;
- protected String charProperty2;
-
- protected Object auditable3;
-
- public void setCharProperty1(String charProperty1) {
- beforePropertyWrite("charProperty1", this.charProperty1, charProperty1);
- this.charProperty1 = charProperty1;
- }
-
- public String getCharProperty1() {
- beforePropertyRead("charProperty1");
- return this.charProperty1;
- }
-
- public void setCharProperty2(String charProperty2) {
- beforePropertyWrite("charProperty2", this.charProperty2, charProperty2);
- this.charProperty2 = charProperty2;
- }
-
- public String getCharProperty2() {
- beforePropertyRead("charProperty2");
- return this.charProperty2;
- }
-
- public void setAuditable3(Auditable3 auditable3) {
- setToOneTarget("auditable3", auditable3, true);
- }
-
- public Auditable3 getAuditable3() {
- return (Auditable3)readProperty("auditable3");
- }
-
- @Override
- public Object readPropertyDirectly(String propName) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch(propName) {
- case "charProperty1":
- return this.charProperty1;
- case "charProperty2":
- return this.charProperty2;
- case "auditable3":
- return this.auditable3;
- default:
- return super.readPropertyDirectly(propName);
- }
- }
-
- @Override
- public void writePropertyDirectly(String propName, Object val) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch (propName) {
- case "charProperty1":
- this.charProperty1 = (String)val;
- break;
- case "charProperty2":
- this.charProperty2 = (String)val;
- break;
- case "auditable3":
- this.auditable3 = val;
- break;
- default:
- super.writePropertyDirectly(propName, val);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- writeSerialized(out);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- readSerialized(in);
- }
-
- @Override
- protected void writeState(ObjectOutputStream out) throws IOException {
- super.writeState(out);
- out.writeObject(this.charProperty1);
- out.writeObject(this.charProperty2);
- out.writeObject(this.auditable3);
- }
-
- @Override
- protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
- super.readState(in);
- this.charProperty1 = (String)in.readObject();
- this.charProperty2 = (String)in.readObject();
- this.auditable3 = in.readObject();
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_Auditable5.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_Auditable5.java
deleted file mode 100644
index 242db2a21..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_Auditable5.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package org.apache.cayenne.commitlog.db.auto;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.List;
-
-import org.apache.cayenne.PersistentObject;
-import org.apache.cayenne.commitlog.db.Auditable5;
-import org.apache.cayenne.commitlog.db.AuditableChild5;
-import org.apache.cayenne.exp.property.ListProperty;
-import org.apache.cayenne.exp.property.PropertyFactory;
-import org.apache.cayenne.exp.property.SelfProperty;
-import org.apache.cayenne.exp.property.StringProperty;
-
-/**
- * Class _Auditable5 was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public abstract class _Auditable5 extends PersistentObject {
-
- private static final long serialVersionUID = 1L;
-
- public static final SelfProperty<Auditable5> SELF = PropertyFactory.createSelf(Auditable5.class);
-
- public static final String ID_PK_COLUMN = "ID";
-
- public static final StringProperty<String> CHAR_PROPERTY1 = PropertyFactory.createString("charProperty1", String.class);
- public static final ListProperty<AuditableChild5> CHILDREN = PropertyFactory.createList("children", AuditableChild5.class);
-
- protected String charProperty1;
-
- protected Object children;
-
- public void setCharProperty1(String charProperty1) {
- beforePropertyWrite("charProperty1", this.charProperty1, charProperty1);
- this.charProperty1 = charProperty1;
- }
-
- public String getCharProperty1() {
- beforePropertyRead("charProperty1");
- return this.charProperty1;
- }
-
- public void addToChildren(AuditableChild5 obj) {
- addToManyTarget("children", obj, true);
- }
-
- public void removeFromChildren(AuditableChild5 obj) {
- removeToManyTarget("children", obj, true);
- }
-
- @SuppressWarnings("unchecked")
- public List<AuditableChild5> getChildren() {
- return (List<AuditableChild5>)readProperty("children");
- }
-
- @Override
- public Object readPropertyDirectly(String propName) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch(propName) {
- case "charProperty1":
- return this.charProperty1;
- case "children":
- return this.children;
- default:
- return super.readPropertyDirectly(propName);
- }
- }
-
- @Override
- public void writePropertyDirectly(String propName, Object val) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch (propName) {
- case "charProperty1":
- this.charProperty1 = (String)val;
- break;
- case "children":
- this.children = val;
- break;
- default:
- super.writePropertyDirectly(propName, val);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- writeSerialized(out);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- readSerialized(in);
- }
-
- @Override
- protected void writeState(ObjectOutputStream out) throws IOException {
- super.writeState(out);
- out.writeObject(this.charProperty1);
- out.writeObject(this.children);
- }
-
- @Override
- protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
- super.readState(in);
- this.charProperty1 = (String)in.readObject();
- this.children = in.readObject();
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_AuditableChild1.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_AuditableChild1.java
deleted file mode 100644
index 390cc8219..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_AuditableChild1.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package org.apache.cayenne.commitlog.db.auto;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.apache.cayenne.PersistentObject;
-import org.apache.cayenne.commitlog.db.Auditable1;
-import org.apache.cayenne.commitlog.db.AuditableChild1;
-import org.apache.cayenne.exp.property.EntityProperty;
-import org.apache.cayenne.exp.property.PropertyFactory;
-import org.apache.cayenne.exp.property.SelfProperty;
-import org.apache.cayenne.exp.property.StringProperty;
-
-/**
- * Class _AuditableChild1 was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public abstract class _AuditableChild1 extends PersistentObject {
-
- private static final long serialVersionUID = 1L;
-
- public static final SelfProperty<AuditableChild1> SELF = PropertyFactory.createSelf(AuditableChild1.class);
-
- public static final String ID_PK_COLUMN = "ID";
-
- public static final StringProperty<String> CHAR_PROPERTY1 = PropertyFactory.createString("charProperty1", String.class);
- public static final EntityProperty<Auditable1> PARENT = PropertyFactory.createEntity("parent", Auditable1.class);
-
- protected String charProperty1;
-
- protected Object parent;
-
- public void setCharProperty1(String charProperty1) {
- beforePropertyWrite("charProperty1", this.charProperty1, charProperty1);
- this.charProperty1 = charProperty1;
- }
-
- public String getCharProperty1() {
- beforePropertyRead("charProperty1");
- return this.charProperty1;
- }
-
- public void setParent(Auditable1 parent) {
- setToOneTarget("parent", parent, true);
- }
-
- public Auditable1 getParent() {
- return (Auditable1)readProperty("parent");
- }
-
- @Override
- public Object readPropertyDirectly(String propName) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch(propName) {
- case "charProperty1":
- return this.charProperty1;
- case "parent":
- return this.parent;
- default:
- return super.readPropertyDirectly(propName);
- }
- }
-
- @Override
- public void writePropertyDirectly(String propName, Object val) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch (propName) {
- case "charProperty1":
- this.charProperty1 = (String)val;
- break;
- case "parent":
- this.parent = val;
- break;
- default:
- super.writePropertyDirectly(propName, val);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- writeSerialized(out);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- readSerialized(in);
- }
-
- @Override
- protected void writeState(ObjectOutputStream out) throws IOException {
- super.writeState(out);
- out.writeObject(this.charProperty1);
- out.writeObject(this.parent);
- }
-
- @Override
- protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
- super.readState(in);
- this.charProperty1 = (String)in.readObject();
- this.parent = in.readObject();
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_AuditableChild1x.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_AuditableChild1x.java
deleted file mode 100644
index b22b5dbc4..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_AuditableChild1x.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package org.apache.cayenne.commitlog.db.auto;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.apache.cayenne.PersistentObject;
-import org.apache.cayenne.commitlog.db.Auditable1;
-import org.apache.cayenne.commitlog.db.AuditableChild1x;
-import org.apache.cayenne.exp.property.EntityProperty;
-import org.apache.cayenne.exp.property.PropertyFactory;
-import org.apache.cayenne.exp.property.SelfProperty;
-import org.apache.cayenne.exp.property.StringProperty;
-
-/**
- * Class _AuditableChild1x was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public abstract class _AuditableChild1x extends PersistentObject {
-
- private static final long serialVersionUID = 1L;
-
- public static final SelfProperty<AuditableChild1x> SELF = PropertyFactory.createSelf(AuditableChild1x.class);
-
- public static final String ID_PK_COLUMN = "ID";
-
- public static final StringProperty<String> CHAR_PROPERTY1 = PropertyFactory.createString("charProperty1", String.class);
- public static final EntityProperty<Auditable1> PARENT = PropertyFactory.createEntity("parent", Auditable1.class);
-
- protected String charProperty1;
-
- protected Object parent;
-
- public void setCharProperty1(String charProperty1) {
- beforePropertyWrite("charProperty1", this.charProperty1, charProperty1);
- this.charProperty1 = charProperty1;
- }
-
- public String getCharProperty1() {
- beforePropertyRead("charProperty1");
- return this.charProperty1;
- }
-
- public void setParent(Auditable1 parent) {
- setToOneTarget("parent", parent, true);
- }
-
- public Auditable1 getParent() {
- return (Auditable1)readProperty("parent");
- }
-
- @Override
- public Object readPropertyDirectly(String propName) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch(propName) {
- case "charProperty1":
- return this.charProperty1;
- case "parent":
- return this.parent;
- default:
- return super.readPropertyDirectly(propName);
- }
- }
-
- @Override
- public void writePropertyDirectly(String propName, Object val) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch (propName) {
- case "charProperty1":
- this.charProperty1 = (String)val;
- break;
- case "parent":
- this.parent = val;
- break;
- default:
- super.writePropertyDirectly(propName, val);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- writeSerialized(out);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- readSerialized(in);
- }
-
- @Override
- protected void writeState(ObjectOutputStream out) throws IOException {
- super.writeState(out);
- out.writeObject(this.charProperty1);
- out.writeObject(this.parent);
- }
-
- @Override
- protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
- super.readState(in);
- this.charProperty1 = (String)in.readObject();
- this.parent = in.readObject();
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_AuditableChild3.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_AuditableChild3.java
deleted file mode 100644
index b3c41b04a..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_AuditableChild3.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package org.apache.cayenne.commitlog.db.auto;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.apache.cayenne.PersistentObject;
-import org.apache.cayenne.commitlog.db.Auditable2;
-import org.apache.cayenne.commitlog.db.AuditableChild3;
-import org.apache.cayenne.exp.property.EntityProperty;
-import org.apache.cayenne.exp.property.PropertyFactory;
-import org.apache.cayenne.exp.property.SelfProperty;
-import org.apache.cayenne.exp.property.StringProperty;
-
-/**
- * Class _AuditableChild3 was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public abstract class _AuditableChild3 extends PersistentObject {
-
- private static final long serialVersionUID = 1L;
-
- public static final SelfProperty<AuditableChild3> SELF = PropertyFactory.createSelf(AuditableChild3.class);
-
- public static final String ID_PK_COLUMN = "ID";
-
- public static final StringProperty<String> CHAR_PROPERTY1 = PropertyFactory.createString("charProperty1", String.class);
- public static final StringProperty<String> CHAR_PROPERTY2 = PropertyFactory.createString("charProperty2", String.class);
- public static final EntityProperty<Auditable2> PARENT = PropertyFactory.createEntity("parent", Auditable2.class);
-
- protected String charProperty1;
- protected String charProperty2;
-
- protected Object parent;
-
- public void setCharProperty1(String charProperty1) {
- beforePropertyWrite("charProperty1", this.charProperty1, charProperty1);
- this.charProperty1 = charProperty1;
- }
-
- public String getCharProperty1() {
- beforePropertyRead("charProperty1");
- return this.charProperty1;
- }
-
- public void setCharProperty2(String charProperty2) {
- beforePropertyWrite("charProperty2", this.charProperty2, charProperty2);
- this.charProperty2 = charProperty2;
- }
-
- public String getCharProperty2() {
- beforePropertyRead("charProperty2");
- return this.charProperty2;
- }
-
- public void setParent(Auditable2 parent) {
- setToOneTarget("parent", parent, true);
- }
-
- public Auditable2 getParent() {
- return (Auditable2)readProperty("parent");
- }
-
- @Override
- public Object readPropertyDirectly(String propName) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch(propName) {
- case "charProperty1":
- return this.charProperty1;
- case "charProperty2":
- return this.charProperty2;
- case "parent":
- return this.parent;
- default:
- return super.readPropertyDirectly(propName);
- }
- }
-
- @Override
- public void writePropertyDirectly(String propName, Object val) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch (propName) {
- case "charProperty1":
- this.charProperty1 = (String)val;
- break;
- case "charProperty2":
- this.charProperty2 = (String)val;
- break;
- case "parent":
- this.parent = val;
- break;
- default:
- super.writePropertyDirectly(propName, val);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- writeSerialized(out);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- readSerialized(in);
- }
-
- @Override
- protected void writeState(ObjectOutputStream out) throws IOException {
- super.writeState(out);
- out.writeObject(this.charProperty1);
- out.writeObject(this.charProperty2);
- out.writeObject(this.parent);
- }
-
- @Override
- protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
- super.readState(in);
- this.charProperty1 = (String)in.readObject();
- this.charProperty2 = (String)in.readObject();
- this.parent = in.readObject();
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_AuditableChild5.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_AuditableChild5.java
deleted file mode 100644
index 26e66b211..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_AuditableChild5.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package org.apache.cayenne.commitlog.db.auto;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.apache.cayenne.PersistentObject;
-import org.apache.cayenne.commitlog.db.Auditable5;
-import org.apache.cayenne.commitlog.db.AuditableChild5;
-import org.apache.cayenne.exp.property.EntityProperty;
-import org.apache.cayenne.exp.property.PropertyFactory;
-import org.apache.cayenne.exp.property.SelfProperty;
-import org.apache.cayenne.exp.property.StringProperty;
-
-/**
- * Class _AuditableChild5 was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public abstract class _AuditableChild5 extends PersistentObject {
-
- private static final long serialVersionUID = 1L;
-
- public static final SelfProperty<AuditableChild5> SELF = PropertyFactory.createSelf(AuditableChild5.class);
-
- public static final String ID_PK_COLUMN = "ID";
-
- public static final StringProperty<String> CHAR_PROPERTY1 = PropertyFactory.createString("charProperty1", String.class);
- public static final EntityProperty<Auditable5> PARENT = PropertyFactory.createEntity("parent", Auditable5.class);
-
- protected String charProperty1;
-
- protected Object parent;
-
- public void setCharProperty1(String charProperty1) {
- beforePropertyWrite("charProperty1", this.charProperty1, charProperty1);
- this.charProperty1 = charProperty1;
- }
-
- public String getCharProperty1() {
- beforePropertyRead("charProperty1");
- return this.charProperty1;
- }
-
- public void setParent(Auditable5 parent) {
- setToOneTarget("parent", parent, true);
- }
-
- public Auditable5 getParent() {
- return (Auditable5)readProperty("parent");
- }
-
- @Override
- public Object readPropertyDirectly(String propName) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch(propName) {
- case "charProperty1":
- return this.charProperty1;
- case "parent":
- return this.parent;
- default:
- return super.readPropertyDirectly(propName);
- }
- }
-
- @Override
- public void writePropertyDirectly(String propName, Object val) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch (propName) {
- case "charProperty1":
- this.charProperty1 = (String)val;
- break;
- case "parent":
- this.parent = val;
- break;
- default:
- super.writePropertyDirectly(propName, val);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- writeSerialized(out);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- readSerialized(in);
- }
-
- @Override
- protected void writeState(ObjectOutputStream out) throws IOException {
- super.writeState(out);
- out.writeObject(this.charProperty1);
- out.writeObject(this.parent);
- }
-
- @Override
- protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
- super.readState(in);
- this.charProperty1 = (String)in.readObject();
- this.parent = in.readObject();
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_E1.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_E1.java
deleted file mode 100644
index 216bf3aad..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_E1.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.apache.cayenne.commitlog.db.auto;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.apache.cayenne.PersistentObject;
-import org.apache.cayenne.commitlog.db.E1;
-import org.apache.cayenne.exp.property.PropertyFactory;
-import org.apache.cayenne.exp.property.SelfProperty;
-
-/**
- * Class _E1 was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public abstract class _E1 extends PersistentObject {
-
- private static final long serialVersionUID = 1L;
-
- public static final SelfProperty<E1> SELF = PropertyFactory.createSelf(E1.class);
-
- public static final String ID_PK_COLUMN = "ID";
-
-
-
-
- @Override
- public Object readPropertyDirectly(String propName) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch(propName) {
- default:
- return super.readPropertyDirectly(propName);
- }
- }
-
- @Override
- public void writePropertyDirectly(String propName, Object val) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch (propName) {
- default:
- super.writePropertyDirectly(propName, val);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- writeSerialized(out);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- readSerialized(in);
- }
-
- @Override
- protected void writeState(ObjectOutputStream out) throws IOException {
- super.writeState(out);
- }
-
- @Override
- protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
- super.readState(in);
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_E2.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_E2.java
deleted file mode 100644
index c8a9ee396..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_E2.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.apache.cayenne.commitlog.db.auto;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.apache.cayenne.PersistentObject;
-import org.apache.cayenne.commitlog.db.E2;
-import org.apache.cayenne.exp.property.PropertyFactory;
-import org.apache.cayenne.exp.property.SelfProperty;
-
-/**
- * Class _E2 was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public abstract class _E2 extends PersistentObject {
-
- private static final long serialVersionUID = 1L;
-
- public static final SelfProperty<E2> SELF = PropertyFactory.createSelf(E2.class);
-
- public static final String ID_PK_COLUMN = "ID";
-
-
-
-
- @Override
- public Object readPropertyDirectly(String propName) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch(propName) {
- default:
- return super.readPropertyDirectly(propName);
- }
- }
-
- @Override
- public void writePropertyDirectly(String propName, Object val) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch (propName) {
- default:
- super.writePropertyDirectly(propName, val);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- writeSerialized(out);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- readSerialized(in);
- }
-
- @Override
- protected void writeState(ObjectOutputStream out) throws IOException {
- super.writeState(out);
- }
-
- @Override
- protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
- super.readState(in);
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_E3.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_E3.java
deleted file mode 100644
index 3c25124f2..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_E3.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.apache.cayenne.commitlog.db.auto;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.List;
-
-import org.apache.cayenne.PersistentObject;
-import org.apache.cayenne.commitlog.db.E3;
-import org.apache.cayenne.commitlog.db.E4;
-import org.apache.cayenne.exp.property.ListProperty;
-import org.apache.cayenne.exp.property.PropertyFactory;
-import org.apache.cayenne.exp.property.SelfProperty;
-
-/**
- * Class _E3 was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public abstract class _E3 extends PersistentObject {
-
- private static final long serialVersionUID = 1L;
-
- public static final SelfProperty<E3> SELF = PropertyFactory.createSelf(E3.class);
-
- public static final String ID_PK_COLUMN = "ID";
-
- public static final ListProperty<E4> E4S = PropertyFactory.createList("e4s", E4.class);
-
-
- protected Object e4s;
-
- public void addToE4s(E4 obj) {
- addToManyTarget("e4s", obj, true);
- }
-
- public void removeFromE4s(E4 obj) {
- removeToManyTarget("e4s", obj, true);
- }
-
- @SuppressWarnings("unchecked")
- public List<E4> getE4s() {
- return (List<E4>)readProperty("e4s");
- }
-
- @Override
- public Object readPropertyDirectly(String propName) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch(propName) {
- case "e4s":
- return this.e4s;
- default:
- return super.readPropertyDirectly(propName);
- }
- }
-
- @Override
- public void writePropertyDirectly(String propName, Object val) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch (propName) {
- case "e4s":
- this.e4s = val;
- break;
- default:
- super.writePropertyDirectly(propName, val);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- writeSerialized(out);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- readSerialized(in);
- }
-
- @Override
- protected void writeState(ObjectOutputStream out) throws IOException {
- super.writeState(out);
- out.writeObject(this.e4s);
- }
-
- @Override
- protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
- super.readState(in);
- this.e4s = in.readObject();
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_E4.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_E4.java
deleted file mode 100644
index 67c669387..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_E4.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.apache.cayenne.commitlog.db.auto;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.List;
-
-import org.apache.cayenne.PersistentObject;
-import org.apache.cayenne.commitlog.db.E3;
-import org.apache.cayenne.commitlog.db.E4;
-import org.apache.cayenne.exp.property.ListProperty;
-import org.apache.cayenne.exp.property.PropertyFactory;
-import org.apache.cayenne.exp.property.SelfProperty;
-
-/**
- * Class _E4 was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public abstract class _E4 extends PersistentObject {
-
- private static final long serialVersionUID = 1L;
-
- public static final SelfProperty<E4> SELF = PropertyFactory.createSelf(E4.class);
-
- public static final String ID_PK_COLUMN = "ID";
-
- public static final ListProperty<E3> E3S = PropertyFactory.createList("e3s", E3.class);
-
-
- protected Object e3s;
-
- public void addToE3s(E3 obj) {
- addToManyTarget("e3s", obj, true);
- }
-
- public void removeFromE3s(E3 obj) {
- removeToManyTarget("e3s", obj, true);
- }
-
- @SuppressWarnings("unchecked")
- public List<E3> getE3s() {
- return (List<E3>)readProperty("e3s");
- }
-
- @Override
- public Object readPropertyDirectly(String propName) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch(propName) {
- case "e3s":
- return this.e3s;
- default:
- return super.readPropertyDirectly(propName);
- }
- }
-
- @Override
- public void writePropertyDirectly(String propName, Object val) {
- if(propName == null) {
- throw new IllegalArgumentException();
- }
-
- switch (propName) {
- case "e3s":
- this.e3s = val;
- break;
- default:
- super.writePropertyDirectly(propName, val);
- }
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- writeSerialized(out);
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- readSerialized(in);
- }
-
- @Override
- protected void writeState(ObjectOutputStream out) throws IOException {
- super.writeState(out);
- out.writeObject(this.e3s);
- }
-
- @Override
- protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
- super.readState(in);
- this.e3s = in.readObject();
- }
-
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_LifecycleMap.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_LifecycleMap.java
deleted file mode 100644
index 13bed5f5c..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/db/auto/_LifecycleMap.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.apache.cayenne.commitlog.db.auto;
-
-
-
-/**
- * This class was generated by Cayenne.
- * It is probably a good idea to avoid changing this class manually,
- * since it may be overwritten next time code is regenerated.
- * If you need to make any customizations, please use subclass.
- */
-public class _LifecycleMap {
-}
\ No newline at end of file
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/unit/AuditableRuntimeCase.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/unit/AuditableRuntimeCase.java
deleted file mode 100644
index ab006130f..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/unit/AuditableRuntimeCase.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.unit;
-
-import org.apache.cayenne.runtime.CayenneRuntime;
-import org.apache.cayenne.runtime.CayenneRuntimeBuilder;
-import org.apache.cayenne.test.jdbc.DbHelper;
-import org.apache.cayenne.test.jdbc.TableHelper;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-
-/**
- * A superclass of integration tests for cayenne-lifecycle.
- */
-public abstract class AuditableRuntimeCase {
-
- protected CayenneRuntime runtime;
-
- protected TableHelper auditable1;
- protected TableHelper auditableChild1;
- protected TableHelper auditableChild1x;
-
- protected TableHelper auditable2;
- protected TableHelper auditableChild3;
-
- protected TableHelper auditable3;
- protected TableHelper auditable4;
-
- protected TableHelper auditable5;
- protected TableHelper auditableChild5;
-
- protected TableHelper auditLog;
-
- @BeforeEach
- public void startCayenne() throws Exception {
- this.runtime = configureCayenne().build();
-
- DbHelper dbHelper = new DbHelper(runtime.getDataSource());
-
- this.auditLog = new TableHelper(dbHelper, "AUDIT_LOG").setColumns("ID", "LOG");
-
- this.auditable1 = new TableHelper(dbHelper, "AUDITABLE1").setColumns("ID", "CHAR_PROPERTY1");
-
- this.auditableChild1 = new TableHelper(dbHelper, "AUDITABLE_CHILD1").setColumns("ID", "AUDITABLE1_ID",
- "CHAR_PROPERTY1");
- this.auditableChild1x = new TableHelper(dbHelper, "AUDITABLE_CHILD1X").setColumns("ID", "AUDITABLE1_ID",
- "CHAR_PROPERTY1");
-
- this.auditable2 = new TableHelper(dbHelper, "AUDITABLE2").setColumns("ID", "CHAR_PROPERTY1", "CHAR_PROPERTY2");
-
- this.auditableChild3 = new TableHelper(dbHelper, "AUDITABLE_CHILD3").setColumns("ID", "AUDITABLE2_ID",
- "CHAR_PROPERTY1", "CHAR_PROPERTY2");
-
- this.auditable3 = new TableHelper(dbHelper, "AUDITABLE3").setColumns("ID", "CHAR_PROPERTY1", "CHAR_PROPERTY2");
- this.auditable4 = new TableHelper(dbHelper, "AUDITABLE4").setColumns("ID", "CHAR_PROPERTY1", "CHAR_PROPERTY2",
- "AUDITABLE3_ID");
-
- this.auditable5 = new TableHelper(dbHelper, "AUDITABLE5").setColumns("ID", "CHAR_PROPERTY1");
- this.auditableChild5 = new TableHelper(dbHelper, "AUDITABLE_CHILD5").setColumns("ID", "AUDITABLE5_ID",
- "CHAR_PROPERTY1");
-
- this.auditableChild1.deleteAll();
- this.auditableChild1x.deleteAll();
- this.auditable1.deleteAll();
- this.auditableChild3.deleteAll();
- this.auditable2.deleteAll();
- this.auditable4.deleteAll();
- this.auditable3.deleteAll();
- this.auditableChild5.deleteAll();
- this.auditable5.deleteAll();
-
- this.auditLog.deleteAll();
- }
-
- protected CayenneRuntimeBuilder configureCayenne() {
- return CayenneRuntime.builder().addConfig("cayenne-lifecycle.xml");
- }
-
- @AfterEach
- public void shutdownCayenne() {
- if (runtime != null) {
- runtime.shutdown();
- }
- }
-}
diff --git a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/unit/FlattenedRuntimeCase.java b/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/unit/FlattenedRuntimeCase.java
deleted file mode 100644
index 4980ac85c..000000000
--- a/cayenne-commitlog/src/test/java/org/apache/cayenne/commitlog/unit/FlattenedRuntimeCase.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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
- *
- * https://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 org.apache.cayenne.commitlog.unit;
-
-import org.apache.cayenne.runtime.CayenneRuntime;
-import org.apache.cayenne.runtime.CayenneRuntimeBuilder;
-import org.apache.cayenne.test.jdbc.DbHelper;
-import org.apache.cayenne.test.jdbc.TableHelper;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-
-public class FlattenedRuntimeCase {
-
- protected CayenneRuntime runtime;
-
- protected TableHelper e3;
- protected TableHelper e4;
- protected TableHelper e34;
-
- @BeforeEach
- public void startCayenne() throws Exception {
- this.runtime = configureCayenne().build();
-
- DbHelper dbHelper = new DbHelper(runtime.getDataSource());
-
- this.e3 = new TableHelper(dbHelper, "E3").setColumns("ID");
- this.e4 = new TableHelper(dbHelper, "E4").setColumns("ID");
- this.e34 = new TableHelper(dbHelper, "E34").setColumns("E3_ID", "E4_ID");
-
- this.e34.deleteAll();
- this.e3.deleteAll();
-
- }
-
- protected CayenneRuntimeBuilder configureCayenne() {
- return CayenneRuntime.builder().addConfig("cayenne-lifecycle.xml");
- }
-
- @AfterEach
- public void shutdownCayenne() {
- if (runtime != null) {
- runtime.shutdown();
- }
- }
-
-}
diff --git a/cayenne-commitlog/src/test/resources/cayenne-lifecycle.xml b/cayenne-commitlog/src/test/resources/cayenne-lifecycle.xml
deleted file mode 100644
index cdc1381a6..000000000
--- a/cayenne-commitlog/src/test/resources/cayenne-lifecycle.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<domain xmlns="http://cayenne.apache.org/schema/12/domain"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://cayenne.apache.org/schema/12/domain https://cayenne.apache.org/schema/12/domain.xsd"
- project-version="12">
- <map name="lifecycle-map"/>
- <node name="lifecycle-db"
- factory="org.apache.cayenne.configuration.runtime.XMLPoolingDataSourceFactory"
- schema-update-strategy="org.apache.cayenne.access.dbsync.CreateIfNoSchemaStrategy">
- <map-ref name="lifecycle-map"/>
- <data-source>
- <driver value="org.hsqldb.jdbcDriver"/>
- <url value="jdbc:hsqldb:mem:lifecycle"/>
- <connectionPool min="1" max="1"/>
- <login userName="sa"/>
- </data-source>
- </node>
-</domain>
diff --git a/cayenne-commitlog/src/test/resources/lifecycle-map.map.xml b/cayenne-commitlog/src/test/resources/lifecycle-map.map.xml
deleted file mode 100644
index a3130b785..000000000
--- a/cayenne-commitlog/src/test/resources/lifecycle-map.map.xml
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<data-map xmlns="http://cayenne.apache.org/schema/12/modelMap"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://cayenne.apache.org/schema/12/modelMap https://cayenne.apache.org/schema/12/modelMap.xsd"
- project-version="12">
- <property name="defaultPackage" value="org.apache.cayenne.commitlog.db"/>
- <db-entity name="AUDITABLE1">
- <db-attribute name="CHAR_PROPERTY1" type="VARCHAR" length="200"/>
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
- </db-entity>
- <db-entity name="AUDITABLE2">
- <db-attribute name="CHAR_PROPERTY1" type="VARCHAR" length="200"/>
- <db-attribute name="CHAR_PROPERTY2" type="VARCHAR" length="200"/>
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
- </db-entity>
- <db-entity name="AUDITABLE3">
- <db-attribute name="CHAR_PROPERTY1" type="VARCHAR" length="200"/>
- <db-attribute name="CHAR_PROPERTY2" type="VARCHAR" length="200"/>
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
- </db-entity>
- <db-entity name="AUDITABLE4">
- <db-attribute name="AUDITABLE3_ID" type="INTEGER"/>
- <db-attribute name="CHAR_PROPERTY1" type="VARCHAR" length="200"/>
- <db-attribute name="CHAR_PROPERTY2" type="VARCHAR" length="200"/>
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
- </db-entity>
- <db-entity name="AUDITABLE5">
- <db-attribute name="CHAR_PROPERTY1" type="VARCHAR" length="200"/>
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
- </db-entity>
- <db-entity name="AUDITABLE_CHILD1">
- <db-attribute name="AUDITABLE1_ID" type="INTEGER"/>
- <db-attribute name="CHAR_PROPERTY1" type="VARCHAR" length="200"/>
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
- </db-entity>
- <db-entity name="AUDITABLE_CHILD1X">
- <db-attribute name="AUDITABLE1_ID" type="INTEGER"/>
- <db-attribute name="CHAR_PROPERTY1" type="VARCHAR" length="200"/>
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
- </db-entity>
- <db-entity name="AUDITABLE_CHILD3">
- <db-attribute name="AUDITABLE2_ID" type="INTEGER"/>
- <db-attribute name="CHAR_PROPERTY1" type="VARCHAR" length="200"/>
- <db-attribute name="CHAR_PROPERTY2" type="VARCHAR" length="200"/>
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
- </db-entity>
- <db-entity name="AUDITABLE_CHILD5">
- <db-attribute name="AUDITABLE5_ID" type="INTEGER"/>
- <db-attribute name="CHAR_PROPERTY1" type="VARCHAR" length="200"/>
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
- </db-entity>
- <db-entity name="AUDIT_LOG">
- <db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
- <db-attribute name="LOG" type="CLOB"/>
- </db-entity>
- <db-entity name="E1">
- <db-attribute name="ID" type="BIGINT" isPrimaryKey="true" isMandatory="true"/>
- </db-entity>
- <db-entity name="E2">
- <db-attribute name="ID" type="BIGINT" isPrimaryKey="true" isMandatory="true"/>
- </db-entity>
- <db-entity name="E3">
- <db-attribute name="ID" type="BIGINT" isPrimaryKey="true" isMandatory="true"/>
- </db-entity>
- <db-entity name="E34">
- <db-attribute name="E3_ID" type="BIGINT" isPrimaryKey="true" isMandatory="true"/>
- <db-attribute name="E4_ID" type="BIGINT" isPrimaryKey="true" isMandatory="true"/>
- </db-entity>
- <db-entity name="E4">
- <db-attribute name="ID" type="BIGINT" isPrimaryKey="true" isMandatory="true"/>
- </db-entity>
- <obj-entity name="AuditLog" className="org.apache.cayenne.commitlog.db.AuditLog" dbEntityName="AUDIT_LOG">
- <obj-attribute name="log" type="java.lang.String" db-attribute-path="LOG"/>
- </obj-entity>
- <obj-entity name="Auditable1" className="org.apache.cayenne.commitlog.db.Auditable1" dbEntityName="AUDITABLE1">
- <obj-attribute name="charProperty1" type="java.lang.String" db-attribute-path="CHAR_PROPERTY1"/>
- </obj-entity>
- <obj-entity name="Auditable2" className="org.apache.cayenne.commitlog.db.Auditable2" dbEntityName="AUDITABLE2">
- <obj-attribute name="charProperty1" type="java.lang.String" db-attribute-path="CHAR_PROPERTY1"/>
- <obj-attribute name="charProperty2" type="java.lang.String" db-attribute-path="CHAR_PROPERTY2"/>
- </obj-entity>
- <obj-entity name="Auditable3" className="org.apache.cayenne.commitlog.db.Auditable3" dbEntityName="AUDITABLE3">
- <obj-attribute name="charProperty1" type="java.lang.String" db-attribute-path="CHAR_PROPERTY1"/>
- <obj-attribute name="charProperty2" type="java.lang.String" db-attribute-path="CHAR_PROPERTY2"/>
- </obj-entity>
- <obj-entity name="Auditable4" className="org.apache.cayenne.commitlog.db.Auditable4" dbEntityName="AUDITABLE4">
- <obj-attribute name="charProperty1" type="java.lang.String" db-attribute-path="CHAR_PROPERTY1"/>
- <obj-attribute name="charProperty2" type="java.lang.String" db-attribute-path="CHAR_PROPERTY2"/>
- </obj-entity>
- <obj-entity name="Auditable5" className="org.apache.cayenne.commitlog.db.Auditable5" dbEntityName="AUDITABLE5">
- <obj-attribute name="charProperty1" type="java.lang.String" db-attribute-path="CHAR_PROPERTY1"/>
- </obj-entity>
- <obj-entity name="AuditableChild1" className="org.apache.cayenne.commitlog.db.AuditableChild1" dbEntityName="AUDITABLE_CHILD1">
- <obj-attribute name="charProperty1" type="java.lang.String" db-attribute-path="CHAR_PROPERTY1"/>
- </obj-entity>
- <obj-entity name="AuditableChild1x" className="org.apache.cayenne.commitlog.db.AuditableChild1x" dbEntityName="AUDITABLE_CHILD1X">
- <obj-attribute name="charProperty1" type="java.lang.String" db-attribute-path="CHAR_PROPERTY1"/>
- </obj-entity>
- <obj-entity name="AuditableChild3" className="org.apache.cayenne.commitlog.db.AuditableChild3" dbEntityName="AUDITABLE_CHILD3">
- <obj-attribute name="charProperty1" type="java.lang.String" db-attribute-path="CHAR_PROPERTY1"/>
- <obj-attribute name="charProperty2" type="java.lang.String" db-attribute-path="CHAR_PROPERTY2"/>
- </obj-entity>
- <obj-entity name="AuditableChild5" className="org.apache.cayenne.commitlog.db.AuditableChild5" dbEntityName="AUDITABLE_CHILD5">
- <obj-attribute name="charProperty1" type="java.lang.String" db-attribute-path="CHAR_PROPERTY1"/>
- </obj-entity>
- <obj-entity name="E1" className="org.apache.cayenne.commitlog.db.E1" dbEntityName="E1"/>
- <obj-entity name="E2" className="org.apache.cayenne.commitlog.db.E2" dbEntityName="E2"/>
- <obj-entity name="E3" className="org.apache.cayenne.commitlog.db.E3" dbEntityName="E3"/>
- <obj-entity name="E4" className="org.apache.cayenne.commitlog.db.E4" dbEntityName="E4"/>
- <db-relationship name="children1" source="AUDITABLE1" target="AUDITABLE_CHILD1" toMany="true">
- <db-attribute-pair source="ID" target="AUDITABLE1_ID"/>
- </db-relationship>
- <db-relationship name="children1x" source="AUDITABLE1" target="AUDITABLE_CHILD1X" toMany="true">
- <db-attribute-pair source="ID" target="AUDITABLE1_ID"/>
- </db-relationship>
- <db-relationship name="children" source="AUDITABLE2" target="AUDITABLE_CHILD3" toMany="true">
- <db-attribute-pair source="ID" target="AUDITABLE2_ID"/>
- </db-relationship>
- <db-relationship name="auditable4s" source="AUDITABLE3" target="AUDITABLE4" toMany="true">
- <db-attribute-pair source="ID" target="AUDITABLE3_ID"/>
- </db-relationship>
- <db-relationship name="auditable3" source="AUDITABLE4" target="AUDITABLE3">
- <db-attribute-pair source="AUDITABLE3_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="children" source="AUDITABLE5" target="AUDITABLE_CHILD5" toMany="true">
- <db-attribute-pair source="ID" target="AUDITABLE5_ID"/>
- </db-relationship>
- <db-relationship name="parent" source="AUDITABLE_CHILD1" target="AUDITABLE1">
- <db-attribute-pair source="AUDITABLE1_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="parent" source="AUDITABLE_CHILD1X" target="AUDITABLE1">
- <db-attribute-pair source="AUDITABLE1_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="parent" source="AUDITABLE_CHILD3" target="AUDITABLE2">
- <db-attribute-pair source="AUDITABLE2_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="parent" source="AUDITABLE_CHILD5" target="AUDITABLE5">
- <db-attribute-pair source="AUDITABLE5_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="e34s" source="E3" target="E34" toDependentPK="true" toMany="true">
- <db-attribute-pair source="ID" target="E3_ID"/>
- </db-relationship>
- <db-relationship name="e3" source="E34" target="E3">
- <db-attribute-pair source="E3_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="e4" source="E34" target="E4">
- <db-attribute-pair source="E4_ID" target="ID"/>
- </db-relationship>
- <db-relationship name="e34s" source="E4" target="E34" toDependentPK="true" toMany="true">
- <db-attribute-pair source="ID" target="E4_ID"/>
- </db-relationship>
- <obj-relationship name="children1" source="Auditable1" target="AuditableChild1" deleteRule="Deny" db-relationship-path="children1"/>
- <obj-relationship name="children" source="Auditable2" target="AuditableChild3" deleteRule="Deny" db-relationship-path="children"/>
- <obj-relationship name="auditable4s" source="Auditable3" target="Auditable4" deleteRule="Deny" db-relationship-path="auditable4s"/>
- <obj-relationship name="auditable3" source="Auditable4" target="Auditable3" deleteRule="Nullify" db-relationship-path="auditable3"/>
- <obj-relationship name="children" source="Auditable5" target="AuditableChild5" deleteRule="Deny" db-relationship-path="children"/>
- <obj-relationship name="parent" source="AuditableChild1" target="Auditable1" deleteRule="Nullify" db-relationship-path="parent"/>
- <obj-relationship name="parent" source="AuditableChild1x" target="Auditable1" deleteRule="Nullify" db-relationship-path="parent"/>
- <obj-relationship name="parent" source="AuditableChild3" target="Auditable2" deleteRule="Nullify" db-relationship-path="parent"/>
- <obj-relationship name="parent" source="AuditableChild5" target="Auditable5" deleteRule="Nullify" db-relationship-path="parent"/>
- <obj-relationship name="e4s" source="E3" target="E4" deleteRule="Deny" db-relationship-path="e34s.e4"/>
- <obj-relationship name="e3s" source="E4" target="E3" deleteRule="Deny" db-relationship-path="e34s.e3"/>
- <cgen xmlns="http://cayenne.apache.org/schema/12/cgen">
- <destDir>../java</destDir>
- <mode>entity</mode>
- <template>templates/v4_1/subclass.vm</template>
- <superTemplate>templates/v4_1/superclass.vm</superTemplate>
- <embeddableTemplate>templates/v4_1/embeddable-subclass.vm</embeddableTemplate>
- <embeddableSuperTemplate>templates/v4_1/embeddable-superclass.vm</embeddableSuperTemplate>
- <queryTemplate>templates/v4_1/datamap-subclass.vm</queryTemplate>
- <querySuperTemplate>templates/v4_1/datamap-superclass.vm</querySuperTemplate>
- <outputPattern>*.java</outputPattern>
- <makePairs>true</makePairs>
- <usePkgPath>true</usePkgPath>
- <overwrite>false</overwrite>
- <createPropertyNames>false</createPropertyNames>
- <createPKProperties>false</createPKProperties>
- </cgen>
-</data-map>
diff --git a/pom.xml b/pom.xml
index a5d5afa25..fbcc6f397 100644
--- a/pom.xml
+++ b/pom.xml
@@ -111,8 +111,7 @@
<module>cayenne-ant</module>
<module>cayenne-cache-invalidation</module>
<module>cayenne-cgen</module>
- <module>cayenne-commitlog</module>
- <module>cayenne-crypto</module>
+<module>cayenne-crypto</module>
<module>cayenne-dbsync</module>
<module>cayenne-di</module>
<module>cayenne-gradle-plugin</module>