cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [3/5] cayenne git commit: CAY-2030 Capturing a stream of commit changes
Date Thu, 22 Oct 2015 14:56:49 GMT
CAY-2030 Capturing a stream of commit changes

* flattened relationship test


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/ed288811
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/ed288811
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/ed288811

Branch: refs/heads/master
Commit: ed288811f8fd645a3d17e5ecdebeefe843e4e8c3
Parents: c14b375
Author: aadamchik <aadamchik@apache.org>
Authored: Thu Oct 22 17:32:47 2015 +0300
Committer: aadamchik <aadamchik@apache.org>
Committed: Thu Oct 22 17:32:47 2015 +0300

----------------------------------------------------------------------
 .../org/apache/cayenne/lifecycle/db/E3.java     |  9 +++++
 .../org/apache/cayenne/lifecycle/db/E4.java     |  9 +++++
 .../apache/cayenne/lifecycle/db/auto/_E3.java   | 35 ++++++++++++++++++++
 .../apache/cayenne/lifecycle/db/auto/_E4.java   | 35 ++++++++++++++++++++
 .../src/test/resources/lifecycle-map.map.xml    | 28 ++++++++++++++++
 5 files changed, 116 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/ed288811/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/E3.java
----------------------------------------------------------------------
diff --git a/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/E3.java b/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/E3.java
new file mode 100644
index 0000000..0efda10
--- /dev/null
+++ b/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/E3.java
@@ -0,0 +1,9 @@
+package org.apache.cayenne.lifecycle.db;
+
+import org.apache.cayenne.lifecycle.db.auto._E3;
+
+public class E3 extends _E3 {
+
+    private static final long serialVersionUID = 1L; 
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/ed288811/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/E4.java
----------------------------------------------------------------------
diff --git a/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/E4.java b/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/E4.java
new file mode 100644
index 0000000..b2b0bca
--- /dev/null
+++ b/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/E4.java
@@ -0,0 +1,9 @@
+package org.apache.cayenne.lifecycle.db;
+
+import org.apache.cayenne.lifecycle.db.auto._E4;
+
+public class E4 extends _E4 {
+
+    private static final long serialVersionUID = 1L; 
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/ed288811/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/auto/_E3.java
----------------------------------------------------------------------
diff --git a/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/auto/_E3.java
b/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/auto/_E3.java
new file mode 100644
index 0000000..d9004c0
--- /dev/null
+++ b/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/auto/_E3.java
@@ -0,0 +1,35 @@
+package org.apache.cayenne.lifecycle.db.auto;
+
+import java.util.List;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.exp.Property;
+import org.apache.cayenne.lifecycle.db.E4;
+
+/**
+ * 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 CayenneDataObject {
+
+    private static final long serialVersionUID = 1L; 
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public static final Property<List<E4>> E4S = new Property<List<E4>>("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");
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/ed288811/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/auto/_E4.java
----------------------------------------------------------------------
diff --git a/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/auto/_E4.java
b/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/auto/_E4.java
new file mode 100644
index 0000000..732e532
--- /dev/null
+++ b/cayenne-lifecycle/src/test/java/org/apache/cayenne/lifecycle/db/auto/_E4.java
@@ -0,0 +1,35 @@
+package org.apache.cayenne.lifecycle.db.auto;
+
+import java.util.List;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.exp.Property;
+import org.apache.cayenne.lifecycle.db.E3;
+
+/**
+ * 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 CayenneDataObject {
+
+    private static final long serialVersionUID = 1L; 
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public static final Property<List<E3>> E3S = new Property<List<E3>>("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");
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/ed288811/cayenne-lifecycle/src/test/resources/lifecycle-map.map.xml
----------------------------------------------------------------------
diff --git a/cayenne-lifecycle/src/test/resources/lifecycle-map.map.xml b/cayenne-lifecycle/src/test/resources/lifecycle-map.map.xml
index 531aa15..14ac628 100644
--- a/cayenne-lifecycle/src/test/resources/lifecycle-map.map.xml
+++ b/cayenne-lifecycle/src/test/resources/lifecycle-map.map.xml
@@ -41,6 +41,16 @@
 	<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="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+		<db-attribute name="E4_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+	</db-entity>
+	<db-entity name="E4">
+		<db-attribute name="ID" type="BIGINT" isPrimaryKey="true" isMandatory="true"/>
+	</db-entity>
 	<db-entity name="SORT_DEP">
 		<db-attribute name="ID" type="BIGINT" isPrimaryKey="true" isMandatory="true"/>
 		<db-attribute name="ROOT_ID" type="BIGINT" isMandatory="true"/>
@@ -78,6 +88,10 @@
 	</obj-entity>
 	<obj-entity name="E2" className="org.apache.cayenne.lifecycle.db.E2" dbEntityName="E2">
 	</obj-entity>
+	<obj-entity name="E3" className="org.apache.cayenne.lifecycle.db.E3" dbEntityName="E3">
+	</obj-entity>
+	<obj-entity name="E4" className="org.apache.cayenne.lifecycle.db.E4" dbEntityName="E4">
+	</obj-entity>
 	<obj-entity name="SortDep" className="org.apache.cayenne.lifecycle.db.SortDep" dbEntityName="SORT_DEP">
 	</obj-entity>
 	<obj-entity name="SortRoot" className="org.apache.cayenne.lifecycle.db.SortRoot" dbEntityName="SORT_ROOT">
@@ -103,6 +117,18 @@
 	<db-relationship name="parent" source="AUDITABLE_CHILD3" target="AUDITABLE2" toMany="false">
 		<db-attribute-pair source="AUDITABLE2_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" toMany="false">
+		<db-attribute-pair source="E3_ID" target="ID"/>
+	</db-relationship>
+	<db-relationship name="e4" source="E34" target="E4" toMany="false">
+		<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>
 	<db-relationship name="root" source="SORT_DEP" target="SORT_ROOT" toMany="false">
 		<db-attribute-pair source="ROOT_ID" target="ID"/>
 	</db-relationship>
@@ -114,6 +140,8 @@
 	<obj-relationship name="parent" source="AuditableChild1" target="Auditable1" deleteRule="Nullify"
db-relationship-path="parent"/>
 	<obj-relationship name="parent" source="AuditableChild2" 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="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"/>
 	<obj-relationship name="root" source="SortDep" target="SortRoot" deleteRule="Nullify"
db-relationship-path="root"/>
 	<obj-relationship name="deps" source="SortRoot" target="SortDep" deleteRule="Deny" db-relationship-path="deps"/>
 </data-map>


Mime
View raw message