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 2014/11/10 18:12:26 UTC

[6/8] cayenne git commit: Refactor Relationships Project

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_activity/auto/_Activity.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_activity/auto/_Activity.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_activity/auto/_Activity.java
new file mode 100644
index 0000000..2ab4c3c
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_activity/auto/_Activity.java
@@ -0,0 +1,58 @@
+package org.apache.cayenne.testdo.relationships_activity.auto;
+
+import java.sql.Date;
+import java.util.Map;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.exp.Property;
+import org.apache.cayenne.testdo.relationships_activity.ActivityResult;
+
+/**
+ * Class _Activity 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 _Activity extends CayenneDataObject {
+
+    @Deprecated
+    public static final String APPOINTMENT_DATE_PROPERTY = "appointmentDate";
+    @Deprecated
+    public static final String APPOINTMENT_NO_PROPERTY = "appointmentNo";
+    @Deprecated
+    public static final String RESULTS_PROPERTY = "results";
+
+    public static final String ACTIVITY_ID_PK_COLUMN = "ACTIVITY_ID";
+
+    public static final Property<Date> APPOINTMENT_DATE = new Property<Date>("appointmentDate");
+    public static final Property<Integer> APPOINTMENT_NO = new Property<Integer>("appointmentNo");
+    public static final Property<Map<String, ActivityResult>> RESULTS = new Property<Map<String, ActivityResult>>("results");
+
+    public void setAppointmentDate(Date appointmentDate) {
+        writeProperty("appointmentDate", appointmentDate);
+    }
+    public Date getAppointmentDate() {
+        return (Date)readProperty("appointmentDate");
+    }
+
+    public void setAppointmentNo(int appointmentNo) {
+        writeProperty("appointmentNo", appointmentNo);
+    }
+    public int getAppointmentNo() {
+        Object value = readProperty("appointmentNo");
+        return (value != null) ? (Integer) value : 0;
+    }
+
+    public void addToResults(ActivityResult obj) {
+        addToManyTarget("results", obj, true);
+    }
+    public void removeFromResults(ActivityResult obj) {
+        removeToManyTarget("results", obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public Map<String, ActivityResult> getResults() {
+        return (Map<String, ActivityResult>)readProperty("results");
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_activity/auto/_ActivityResult.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_activity/auto/_ActivityResult.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_activity/auto/_ActivityResult.java
new file mode 100644
index 0000000..6971f0e
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_activity/auto/_ActivityResult.java
@@ -0,0 +1,53 @@
+package org.apache.cayenne.testdo.relationships_activity.auto;
+
+import java.sql.Date;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.exp.Property;
+
+/**
+ * Class _ActivityResult 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 _ActivityResult extends CayenneDataObject {
+
+    @Deprecated
+    public static final String APPOINT_DATE_PROPERTY = "appointDate";
+    @Deprecated
+    public static final String APPOINT_NO_PROPERTY = "appointNo";
+    @Deprecated
+    public static final String FIELD_PROPERTY = "field";
+
+    public static final String APPOINT_DATE_PK_COLUMN = "APPOINT_DATE";
+    public static final String APPOINT_NO_PK_COLUMN = "APPOINT_NO";
+    public static final String RESULTNAME_PK_COLUMN = "RESULTNAME";
+
+    public static final Property<Date> APPOINT_DATE = new Property<Date>("appointDate");
+    public static final Property<Integer> APPOINT_NO = new Property<Integer>("appointNo");
+    public static final Property<String> FIELD = new Property<String>("field");
+
+    public void setAppointDate(Date appointDate) {
+        writeProperty("appointDate", appointDate);
+    }
+    public Date getAppointDate() {
+        return (Date)readProperty("appointDate");
+    }
+
+    public void setAppointNo(int appointNo) {
+        writeProperty("appointNo", appointNo);
+    }
+    public int getAppointNo() {
+        Object value = readProperty("appointNo");
+        return (value != null) ? (Integer) value : 0;
+    }
+
+    public void setField(String field) {
+        writeProperty("field", field);
+    }
+    public String getField() {
+        return (String)readProperty("field");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_activity/auto/_Relationships1.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_activity/auto/_Relationships1.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_activity/auto/_Relationships1.java
new file mode 100644
index 0000000..c36bc74
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_activity/auto/_Relationships1.java
@@ -0,0 +1,12 @@
+package org.apache.cayenne.testdo.relationships_activity.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 _Relationships1 {
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/Child.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/Child.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/Child.java
new file mode 100644
index 0000000..d46803f
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/Child.java
@@ -0,0 +1,25 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_child_master;
+
+import org.apache.cayenne.testdo.relationships_child_master.auto._Child;
+
+public class Child extends _Child {
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/Master.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/Master.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/Master.java
new file mode 100644
index 0000000..c14aaa3
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/Master.java
@@ -0,0 +1,25 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_child_master;
+
+import org.apache.cayenne.testdo.relationships_child_master.auto._Master;
+
+public class Master extends _Master {
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/auto/_Child.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/auto/_Child.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/auto/_Child.java
new file mode 100644
index 0000000..4798c5b
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/auto/_Child.java
@@ -0,0 +1,27 @@
+package org.apache.cayenne.testdo.relationships_child_master.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_child_master.Master;
+
+/**
+ * Class _Child 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 _Child extends CayenneDataObject {
+
+    public static final String MASTER_PROPERTY = "master";
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public void setMaster(Master master) {
+        setToOneTarget(MASTER_PROPERTY, master, true);
+    }
+
+    public Master getMaster() {
+        return (Master)readProperty(MASTER_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/auto/_Master.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/auto/_Master.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/auto/_Master.java
new file mode 100644
index 0000000..3b9fde7
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_child_master/auto/_Master.java
@@ -0,0 +1,40 @@
+package org.apache.cayenne.testdo.relationships_child_master.auto;
+
+import java.util.List;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_child_master.Child;
+
+/**
+ * Class _Master 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 _Master extends CayenneDataObject {
+
+    public static final String NAME_PROPERTY = "name";
+    public static final String CHILDREN_PROPERTY = "children";
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public void setName(String name) {
+        writeProperty(NAME_PROPERTY, name);
+    }
+    public String getName() {
+        return (String)readProperty(NAME_PROPERTY);
+    }
+
+    public void addToChildren(Child obj) {
+        addToManyTarget(CHILDREN_PROPERTY, obj, true);
+    }
+    public void removeFromChildren(Child obj) {
+        removeToManyTarget(CHILDREN_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public List<Child> getChildren() {
+        return (List<Child>)readProperty(CHILDREN_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/ClobDetail.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/ClobDetail.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/ClobDetail.java
new file mode 100644
index 0000000..a1c7ecf
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/ClobDetail.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_clob;
+
+import org.apache.cayenne.testdo.relationships_clob.auto._ClobDetail;
+
+public class ClobDetail extends _ClobDetail {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/ClobMaster.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/ClobMaster.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/ClobMaster.java
new file mode 100644
index 0000000..751734c
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/ClobMaster.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_clob;
+
+import org.apache.cayenne.testdo.relationships_clob.auto._ClobMaster;
+
+public class ClobMaster extends _ClobMaster {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/auto/_ClobDetail.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/auto/_ClobDetail.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/auto/_ClobDetail.java
new file mode 100644
index 0000000..3d37f60
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/auto/_ClobDetail.java
@@ -0,0 +1,35 @@
+package org.apache.cayenne.testdo.relationships_clob.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_clob.ClobMaster;
+
+/**
+ * Class _ClobDetail 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 _ClobDetail extends CayenneDataObject {
+
+    public static final String NAME_PROPERTY = "name";
+    public static final String MASTER_PROPERTY = "master";
+
+    public static final String CLOB_DETAIL_ID_PK_COLUMN = "CLOB_DETAIL_ID";
+
+    public void setName(String name) {
+        writeProperty(NAME_PROPERTY, name);
+    }
+    public String getName() {
+        return (String)readProperty(NAME_PROPERTY);
+    }
+
+    public void setMaster(ClobMaster master) {
+        setToOneTarget(MASTER_PROPERTY, master, true);
+    }
+
+    public ClobMaster getMaster() {
+        return (ClobMaster)readProperty(MASTER_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/auto/_ClobMaster.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/auto/_ClobMaster.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/auto/_ClobMaster.java
new file mode 100644
index 0000000..76a077c
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_clob/auto/_ClobMaster.java
@@ -0,0 +1,48 @@
+package org.apache.cayenne.testdo.relationships_clob.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_clob.ClobDetail;
+
+import java.util.List;
+
+/**
+ * Class _ClobMaster 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 _ClobMaster extends CayenneDataObject {
+
+    public static final String CLOB_COLUMN_PROPERTY = "clobColumn";
+    public static final String NAME_PROPERTY = "name";
+    public static final String DETAILS_PROPERTY = "details";
+
+    public static final String CLOB_MASTER_ID_PK_COLUMN = "CLOB_MASTER_ID";
+
+    public void setClobColumn(String clobColumn) {
+        writeProperty(CLOB_COLUMN_PROPERTY, clobColumn);
+    }
+    public String getClobColumn() {
+        return (String)readProperty(CLOB_COLUMN_PROPERTY);
+    }
+
+    public void setName(String name) {
+        writeProperty(NAME_PROPERTY, name);
+    }
+    public String getName() {
+        return (String)readProperty(NAME_PROPERTY);
+    }
+
+    public void addToDetails(ClobDetail obj) {
+        addToManyTarget(DETAILS_PROPERTY, obj, true);
+    }
+    public void removeFromDetails(ClobDetail obj) {
+        removeToManyTarget(DETAILS_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public List<ClobDetail> getDetails() {
+        return (List<ClobDetail>)readProperty(DETAILS_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/CollectionToMany.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/CollectionToMany.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/CollectionToMany.java
new file mode 100644
index 0000000..6fe6024
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/CollectionToMany.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_collection_to_many;
+
+import org.apache.cayenne.testdo.relationships_collection_to_many.auto._CollectionToMany;
+
+public class CollectionToMany extends _CollectionToMany {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/CollectionToManyTarget.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/CollectionToManyTarget.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/CollectionToManyTarget.java
new file mode 100644
index 0000000..d9e0a1b
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/CollectionToManyTarget.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_collection_to_many;
+
+import org.apache.cayenne.testdo.relationships_collection_to_many.auto._CollectionToManyTarget;
+
+public class CollectionToManyTarget extends _CollectionToManyTarget {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/auto/_CollectionToMany.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/auto/_CollectionToMany.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/auto/_CollectionToMany.java
new file mode 100644
index 0000000..2e10a01
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/auto/_CollectionToMany.java
@@ -0,0 +1,32 @@
+package org.apache.cayenne.testdo.relationships_collection_to_many.auto;
+
+import java.util.Collection;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_collection_to_many.CollectionToManyTarget;
+
+/**
+ * Class _CollectionToMany 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 _CollectionToMany extends CayenneDataObject {
+
+    public static final String TARGETS_PROPERTY = "targets";
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public void addToTargets(CollectionToManyTarget obj) {
+        addToManyTarget(TARGETS_PROPERTY, obj, true);
+    }
+    public void removeFromTargets(CollectionToManyTarget obj) {
+        removeToManyTarget(TARGETS_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public Collection<CollectionToManyTarget> getTargets() {
+        return (Collection<CollectionToManyTarget>)readProperty(TARGETS_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/auto/_CollectionToManyTarget.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/auto/_CollectionToManyTarget.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/auto/_CollectionToManyTarget.java
new file mode 100644
index 0000000..be533ef
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_collection_to_many/auto/_CollectionToManyTarget.java
@@ -0,0 +1,27 @@
+package org.apache.cayenne.testdo.relationships_collection_to_many.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_collection_to_many.CollectionToMany;
+
+/**
+ * Class _CollectionToManyTarget 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 _CollectionToManyTarget extends CayenneDataObject {
+
+    public static final String COLLECTION_TO_MANY_PROPERTY = "collectionToMany";
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public void setCollectionToMany(CollectionToMany collectionToMany) {
+        setToOneTarget(COLLECTION_TO_MANY_PROPERTY, collectionToMany, true);
+    }
+
+    public CollectionToMany getCollectionToMany() {
+        return (CollectionToMany)readProperty(COLLECTION_TO_MANY_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleFlatA.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleFlatA.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleFlatA.java
new file mode 100644
index 0000000..d458bdb
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleFlatA.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_delete_rules;
+
+import org.apache.cayenne.testdo.relationships_delete_rules.auto._DeleteRuleFlatA;
+
+public class DeleteRuleFlatA extends _DeleteRuleFlatA {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleFlatB.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleFlatB.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleFlatB.java
new file mode 100644
index 0000000..e5d288a
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleFlatB.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_delete_rules;
+
+import org.apache.cayenne.testdo.relationships_delete_rules.auto._DeleteRuleFlatB;
+
+public class DeleteRuleFlatB extends _DeleteRuleFlatB {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleTest1.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleTest1.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleTest1.java
new file mode 100644
index 0000000..1ccb0b8
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleTest1.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_delete_rules;
+
+import org.apache.cayenne.testdo.relationships_delete_rules.auto._DeleteRuleTest1;
+
+public class DeleteRuleTest1 extends _DeleteRuleTest1 {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleTest2.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleTest2.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleTest2.java
new file mode 100644
index 0000000..621a0d5
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleTest2.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_delete_rules;
+
+import org.apache.cayenne.testdo.relationships_delete_rules.auto._DeleteRuleTest2;
+
+public class DeleteRuleTest2 extends _DeleteRuleTest2 {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleTest3.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleTest3.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleTest3.java
new file mode 100644
index 0000000..b19f65c
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/DeleteRuleTest3.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_delete_rules;
+
+import org.apache.cayenne.testdo.relationships_delete_rules.auto._DeleteRuleTest3;
+
+public class DeleteRuleTest3 extends _DeleteRuleTest3 {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleFlatA.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleFlatA.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleFlatA.java
new file mode 100644
index 0000000..2c9ff1a
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleFlatA.java
@@ -0,0 +1,32 @@
+package org.apache.cayenne.testdo.relationships_delete_rules.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_delete_rules.DeleteRuleFlatB;
+
+import java.util.List;
+
+/**
+ * Class _DeleteRuleFlatA 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 _DeleteRuleFlatA extends CayenneDataObject {
+
+    public static final String FLAT_B_PROPERTY = "flatB";
+
+    public static final String FLATA_ID_PK_COLUMN = "FLATA_ID";
+
+    public void addToFlatB(DeleteRuleFlatB obj) {
+        addToManyTarget(FLAT_B_PROPERTY, obj, true);
+    }
+    public void removeFromFlatB(DeleteRuleFlatB obj) {
+        removeToManyTarget(FLAT_B_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public List<DeleteRuleFlatB> getFlatB() {
+        return (List<DeleteRuleFlatB>)readProperty(FLAT_B_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleFlatB.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleFlatB.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleFlatB.java
new file mode 100644
index 0000000..07de891
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleFlatB.java
@@ -0,0 +1,32 @@
+package org.apache.cayenne.testdo.relationships_delete_rules.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_delete_rules.DeleteRuleFlatA;
+
+import java.util.List;
+
+/**
+ * Class _DeleteRuleFlatB 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 _DeleteRuleFlatB extends CayenneDataObject {
+
+    public static final String UNTITLED_REL_PROPERTY = "untitledRel";
+
+    public static final String FLATB_ID_PK_COLUMN = "FLATB_ID";
+
+    public void addToUntitledRel(DeleteRuleFlatA obj) {
+        addToManyTarget(UNTITLED_REL_PROPERTY, obj, true);
+    }
+    public void removeFromUntitledRel(DeleteRuleFlatA obj) {
+        removeToManyTarget(UNTITLED_REL_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public List<DeleteRuleFlatA> getUntitledRel() {
+        return (List<DeleteRuleFlatA>)readProperty(UNTITLED_REL_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleTest1.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleTest1.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleTest1.java
new file mode 100644
index 0000000..6cef752
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleTest1.java
@@ -0,0 +1,27 @@
+package org.apache.cayenne.testdo.relationships_delete_rules.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_delete_rules.DeleteRuleTest2;
+
+/**
+ * Class _DeleteRuleTest1 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 _DeleteRuleTest1 extends CayenneDataObject {
+
+    public static final String TEST2_PROPERTY = "test2";
+
+    public static final String DEL_RULE_TEST1_ID_PK_COLUMN = "DEL_RULE_TEST1_ID";
+
+    public void setTest2(DeleteRuleTest2 test2) {
+        setToOneTarget(TEST2_PROPERTY, test2, true);
+    }
+
+    public DeleteRuleTest2 getTest2() {
+        return (DeleteRuleTest2)readProperty(TEST2_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleTest2.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleTest2.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleTest2.java
new file mode 100644
index 0000000..098b0b2
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleTest2.java
@@ -0,0 +1,46 @@
+package org.apache.cayenne.testdo.relationships_delete_rules.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_delete_rules.DeleteRuleTest1;
+import org.apache.cayenne.testdo.relationships_delete_rules.DeleteRuleTest3;
+
+import java.util.List;
+
+/**
+ * Class _DeleteRuleTest2 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 _DeleteRuleTest2 extends CayenneDataObject {
+
+    public static final String DELETE_RULE_TEST3ARRAY_PROPERTY = "deleteRuleTest3Array";
+    public static final String TEST1ARRAY_PROPERTY = "test1Array";
+
+    public static final String DEL_RULE_TEST2_ID_PK_COLUMN = "DEL_RULE_TEST2_ID";
+
+    public void addToDeleteRuleTest3Array(DeleteRuleTest3 obj) {
+        addToManyTarget(DELETE_RULE_TEST3ARRAY_PROPERTY, obj, true);
+    }
+    public void removeFromDeleteRuleTest3Array(DeleteRuleTest3 obj) {
+        removeToManyTarget(DELETE_RULE_TEST3ARRAY_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public List<DeleteRuleTest3> getDeleteRuleTest3Array() {
+        return (List<DeleteRuleTest3>)readProperty(DELETE_RULE_TEST3ARRAY_PROPERTY);
+    }
+
+
+    public void addToTest1Array(DeleteRuleTest1 obj) {
+        addToManyTarget(TEST1ARRAY_PROPERTY, obj, true);
+    }
+    public void removeFromTest1Array(DeleteRuleTest1 obj) {
+        removeToManyTarget(TEST1ARRAY_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public List<DeleteRuleTest1> getTest1Array() {
+        return (List<DeleteRuleTest1>)readProperty(TEST1ARRAY_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleTest3.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleTest3.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleTest3.java
new file mode 100644
index 0000000..cdff598
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_delete_rules/auto/_DeleteRuleTest3.java
@@ -0,0 +1,27 @@
+package org.apache.cayenne.testdo.relationships_delete_rules.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_delete_rules.DeleteRuleTest2;
+
+/**
+ * Class _DeleteRuleTest3 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 _DeleteRuleTest3 extends CayenneDataObject {
+
+    public static final String TO_DELETE_RULE_TEST2_PROPERTY = "toDeleteRuleTest2";
+
+    public static final String DELETE_RULE_TEST_3_ID_PK_COLUMN = "DELETE_RULE_TEST_3_ID";
+
+    public void setToDeleteRuleTest2(DeleteRuleTest2 toDeleteRuleTest2) {
+        setToOneTarget(TO_DELETE_RULE_TEST2_PROPERTY, toDeleteRuleTest2, true);
+    }
+
+    public DeleteRuleTest2 getToDeleteRuleTest2() {
+        return (DeleteRuleTest2)readProperty(TO_DELETE_RULE_TEST2_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedCircular.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedCircular.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedCircular.java
new file mode 100644
index 0000000..d3c01a3
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedCircular.java
@@ -0,0 +1,25 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_flattened;
+
+import org.apache.cayenne.testdo.relationships_flattened.auto._FlattenedCircular;
+
+public class FlattenedCircular extends _FlattenedCircular {
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest1.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest1.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest1.java
new file mode 100644
index 0000000..a34a364
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest1.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_flattened;
+
+import org.apache.cayenne.testdo.relationships_flattened.auto._FlattenedTest1;
+
+public class FlattenedTest1 extends _FlattenedTest1 {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest2.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest2.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest2.java
new file mode 100644
index 0000000..6ee68b8
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest2.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_flattened;
+
+import org.apache.cayenne.testdo.relationships_flattened.auto._FlattenedTest2;
+
+public class FlattenedTest2 extends _FlattenedTest2 {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest3.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest3.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest3.java
new file mode 100644
index 0000000..183dad5
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest3.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_flattened;
+
+import org.apache.cayenne.testdo.relationships_flattened.auto._FlattenedTest3;
+
+public class FlattenedTest3 extends _FlattenedTest3 {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest4.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest4.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest4.java
new file mode 100644
index 0000000..a3297d4
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/FlattenedTest4.java
@@ -0,0 +1,25 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_flattened;
+
+import org.apache.cayenne.testdo.relationships_flattened.auto._FlattenedTest4;
+
+public class FlattenedTest4 extends _FlattenedTest4 {
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedCircular.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedCircular.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedCircular.java
new file mode 100644
index 0000000..7f41da2
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedCircular.java
@@ -0,0 +1,45 @@
+package org.apache.cayenne.testdo.relationships_flattened.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_flattened.FlattenedCircular;
+
+import java.util.List;
+
+/**
+ * Class _FlattenedCircular 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 _FlattenedCircular extends CayenneDataObject {
+
+    public static final String SIDE1S_PROPERTY = "side1s";
+    public static final String SIDE2S_PROPERTY = "side2s";
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public void addToSide1s(FlattenedCircular obj) {
+        addToManyTarget(SIDE1S_PROPERTY, obj, true);
+    }
+    public void removeFromSide1s(FlattenedCircular obj) {
+        removeToManyTarget(SIDE1S_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public List<FlattenedCircular> getSide1s() {
+        return (List<FlattenedCircular>)readProperty(SIDE1S_PROPERTY);
+    }
+
+
+    public void addToSide2s(FlattenedCircular obj) {
+        addToManyTarget(SIDE2S_PROPERTY, obj, true);
+    }
+    public void removeFromSide2s(FlattenedCircular obj) {
+        removeToManyTarget(SIDE2S_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public List<FlattenedCircular> getSide2s() {
+        return (List<FlattenedCircular>)readProperty(SIDE2S_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest1.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest1.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest1.java
new file mode 100644
index 0000000..4e7ea7a
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest1.java
@@ -0,0 +1,69 @@
+package org.apache.cayenne.testdo.relationships_flattened.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest2;
+import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest3;
+import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest4;
+
+import java.util.List;
+
+/**
+ * Class _FlattenedTest1 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 _FlattenedTest1 extends CayenneDataObject {
+
+    public static final String NAME_PROPERTY = "name";
+    public static final String FT2ARRAY_PROPERTY = "ft2Array";
+    public static final String FT3ARRAY_PROPERTY = "ft3Array";
+    public static final String FT3OVER_COMPLEX_PROPERTY = "ft3OverComplex";
+    public static final String FT4ARRAY_FOR1_PROPERTY = "ft4ArrayFor1";
+
+    public static final String FT1_ID_PK_COLUMN = "FT1_ID";
+
+    public void setName(String name) {
+        writeProperty(NAME_PROPERTY, name);
+    }
+    public String getName() {
+        return (String)readProperty(NAME_PROPERTY);
+    }
+
+    public void addToFt2Array(FlattenedTest2 obj) {
+        addToManyTarget(FT2ARRAY_PROPERTY, obj, true);
+    }
+    public void removeFromFt2Array(FlattenedTest2 obj) {
+        removeToManyTarget(FT2ARRAY_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public List<FlattenedTest2> getFt2Array() {
+        return (List<FlattenedTest2>)readProperty(FT2ARRAY_PROPERTY);
+    }
+
+
+    @SuppressWarnings("unchecked")
+    public List<FlattenedTest3> getFt3Array() {
+        return (List<FlattenedTest3>)readProperty(FT3ARRAY_PROPERTY);
+    }
+
+
+    public void addToFt3OverComplex(FlattenedTest3 obj) {
+        addToManyTarget(FT3OVER_COMPLEX_PROPERTY, obj, true);
+    }
+    public void removeFromFt3OverComplex(FlattenedTest3 obj) {
+        removeToManyTarget(FT3OVER_COMPLEX_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public List<FlattenedTest3> getFt3OverComplex() {
+        return (List<FlattenedTest3>)readProperty(FT3OVER_COMPLEX_PROPERTY);
+    }
+
+
+    @SuppressWarnings("unchecked")
+    public List<FlattenedTest4> getFt4ArrayFor1() {
+        return (List<FlattenedTest4>)readProperty(FT4ARRAY_FOR1_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest2.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest2.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest2.java
new file mode 100644
index 0000000..cd2edd5
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest2.java
@@ -0,0 +1,51 @@
+package org.apache.cayenne.testdo.relationships_flattened.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest1;
+import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest3;
+
+import java.util.List;
+
+/**
+ * Class _FlattenedTest2 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 _FlattenedTest2 extends CayenneDataObject {
+
+    public static final String NAME_PROPERTY = "name";
+    public static final String FT3ARRAY_PROPERTY = "ft3Array";
+    public static final String TO_FT1_PROPERTY = "toFT1";
+
+    public static final String FT2_ID_PK_COLUMN = "FT2_ID";
+
+    public void setName(String name) {
+        writeProperty(NAME_PROPERTY, name);
+    }
+    public String getName() {
+        return (String)readProperty(NAME_PROPERTY);
+    }
+
+    public void addToFt3Array(FlattenedTest3 obj) {
+        addToManyTarget(FT3ARRAY_PROPERTY, obj, true);
+    }
+    public void removeFromFt3Array(FlattenedTest3 obj) {
+        removeToManyTarget(FT3ARRAY_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public List<FlattenedTest3> getFt3Array() {
+        return (List<FlattenedTest3>)readProperty(FT3ARRAY_PROPERTY);
+    }
+
+
+    public void setToFT1(FlattenedTest1 toFT1) {
+        setToOneTarget(TO_FT1_PROPERTY, toFT1, true);
+    }
+
+    public FlattenedTest1 getToFT1() {
+        return (FlattenedTest1)readProperty(TO_FT1_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest3.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest3.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest3.java
new file mode 100644
index 0000000..f84c88f
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest3.java
@@ -0,0 +1,59 @@
+package org.apache.cayenne.testdo.relationships_flattened.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest1;
+import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest2;
+import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest4;
+
+import java.util.List;
+
+/**
+ * Class _FlattenedTest3 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 _FlattenedTest3 extends CayenneDataObject {
+
+    public static final String NAME_PROPERTY = "name";
+    public static final String FT4ARRAY_PROPERTY = "ft4Array";
+    public static final String TO_FT1_PROPERTY = "toFT1";
+    public static final String TO_FT2_PROPERTY = "toFT2";
+
+    public static final String FT3_ID_PK_COLUMN = "FT3_ID";
+
+    public void setName(String name) {
+        writeProperty(NAME_PROPERTY, name);
+    }
+    public String getName() {
+        return (String)readProperty(NAME_PROPERTY);
+    }
+
+    public void addToFt4Array(FlattenedTest4 obj) {
+        addToManyTarget(FT4ARRAY_PROPERTY, obj, true);
+    }
+    public void removeFromFt4Array(FlattenedTest4 obj) {
+        removeToManyTarget(FT4ARRAY_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public List<FlattenedTest4> getFt4Array() {
+        return (List<FlattenedTest4>)readProperty(FT4ARRAY_PROPERTY);
+    }
+
+
+
+    public FlattenedTest1 getToFT1() {
+        return (FlattenedTest1)readProperty(TO_FT1_PROPERTY);
+    }
+
+
+    public void setToFT2(FlattenedTest2 toFT2) {
+        setToOneTarget(TO_FT2_PROPERTY, toFT2, true);
+    }
+
+    public FlattenedTest2 getToFT2() {
+        return (FlattenedTest2)readProperty(TO_FT2_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest4.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest4.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest4.java
new file mode 100644
index 0000000..1e6206a
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_flattened/auto/_FlattenedTest4.java
@@ -0,0 +1,35 @@
+package org.apache.cayenne.testdo.relationships_flattened.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest3;
+
+/**
+ * Class _FlattenedTest4 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 _FlattenedTest4 extends CayenneDataObject {
+
+    public static final String NAME_PROPERTY = "name";
+    public static final String TO_FT3_PROPERTY = "toFT3";
+
+    public static final String FT4_ID_PK_COLUMN = "FT4_ID";
+
+    public void setName(String name) {
+        writeProperty(NAME_PROPERTY, name);
+    }
+    public String getName() {
+        return (String)readProperty(NAME_PROPERTY);
+    }
+
+    public void setToFT3(FlattenedTest3 toFT3) {
+        setToOneTarget(TO_FT3_PROPERTY, toFT3, true);
+    }
+
+    public FlattenedTest3 getToFT3() {
+        return (FlattenedTest3)readProperty(TO_FT3_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/SetToMany.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/SetToMany.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/SetToMany.java
new file mode 100644
index 0000000..176c033
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/SetToMany.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_set_to_many;
+
+import org.apache.cayenne.testdo.relationships_set_to_many.auto._SetToMany;
+
+public class SetToMany extends _SetToMany {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/SetToManyTarget.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/SetToManyTarget.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/SetToManyTarget.java
new file mode 100644
index 0000000..7c2ca3b
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/SetToManyTarget.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_set_to_many;
+
+import org.apache.cayenne.testdo.relationships_set_to_many.auto._SetToManyTarget;
+
+public class SetToManyTarget extends _SetToManyTarget {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/auto/_SetToMany.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/auto/_SetToMany.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/auto/_SetToMany.java
new file mode 100644
index 0000000..ffa0f83
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/auto/_SetToMany.java
@@ -0,0 +1,32 @@
+package org.apache.cayenne.testdo.relationships_set_to_many.auto;
+
+import java.util.Set;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_set_to_many.SetToManyTarget;
+
+/**
+ * Class _SetToMany 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 _SetToMany extends CayenneDataObject {
+
+    public static final String TARGETS_PROPERTY = "targets";
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public void addToTargets(SetToManyTarget obj) {
+        addToManyTarget(TARGETS_PROPERTY, obj, true);
+    }
+    public void removeFromTargets(SetToManyTarget obj) {
+        removeToManyTarget(TARGETS_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public Set<SetToManyTarget> getTargets() {
+        return (Set<SetToManyTarget>)readProperty(TARGETS_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/auto/_SetToManyTarget.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/auto/_SetToManyTarget.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/auto/_SetToManyTarget.java
new file mode 100644
index 0000000..6e4414b
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_set_to_many/auto/_SetToManyTarget.java
@@ -0,0 +1,27 @@
+package org.apache.cayenne.testdo.relationships_set_to_many.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_set_to_many.SetToMany;
+
+/**
+ * Class _SetToManyTarget 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 _SetToManyTarget extends CayenneDataObject {
+
+    public static final String SET_TO_MANY_PROPERTY = "setToMany";
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public void setSetToMany(SetToMany setToMany) {
+        setToOneTarget(SET_TO_MANY_PROPERTY, setToMany, true);
+    }
+
+    public SetToMany getSetToMany() {
+        return (SetToMany)readProperty(SET_TO_MANY_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/ToManyFkDep.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/ToManyFkDep.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/ToManyFkDep.java
new file mode 100644
index 0000000..7cbbb08
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/ToManyFkDep.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_to_many_fk;
+
+import org.apache.cayenne.testdo.relationships_to_many_fk.auto._ToManyFkDep;
+
+public class ToManyFkDep extends _ToManyFkDep {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/ToManyFkRoot.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/ToManyFkRoot.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/ToManyFkRoot.java
new file mode 100644
index 0000000..9a35fc4
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/ToManyFkRoot.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_to_many_fk;
+
+import org.apache.cayenne.testdo.relationships_to_many_fk.auto._ToManyFkRoot;
+
+public class ToManyFkRoot extends _ToManyFkRoot {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/ToManyRoot2.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/ToManyRoot2.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/ToManyRoot2.java
new file mode 100644
index 0000000..d300771
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/ToManyRoot2.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_to_many_fk;
+
+import org.apache.cayenne.testdo.relationships_to_many_fk.auto._ToManyRoot2;
+
+public class ToManyRoot2 extends _ToManyRoot2 {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/auto/_ToManyFkDep.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/auto/_ToManyFkDep.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/auto/_ToManyFkDep.java
new file mode 100644
index 0000000..c9e55e2
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/auto/_ToManyFkDep.java
@@ -0,0 +1,55 @@
+package org.apache.cayenne.testdo.relationships_to_many_fk.auto;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_to_many_fk.ToManyFkRoot;
+import org.apache.cayenne.testdo.relationships_to_many_fk.ToManyRoot2;
+
+/**
+ * Class _ToManyFkDep 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 _ToManyFkDep extends CayenneDataObject {
+
+    public static final String DEP_ID_PROPERTY = "depId";
+    public static final String NAME_PROPERTY = "name";
+    public static final String ROOT_PROPERTY = "root";
+    public static final String ROOT2_PROPERTY = "root2";
+
+    public static final String DEP_ID_PK_COLUMN = "DEP_ID";
+    public static final String OTHER_ID_PK_COLUMN = "OTHER_ID";
+
+    public void setDepId(Integer depId) {
+        writeProperty(DEP_ID_PROPERTY, depId);
+    }
+    public Integer getDepId() {
+        return (Integer)readProperty(DEP_ID_PROPERTY);
+    }
+
+    public void setName(String name) {
+        writeProperty(NAME_PROPERTY, name);
+    }
+    public String getName() {
+        return (String)readProperty(NAME_PROPERTY);
+    }
+
+    public void setRoot(ToManyFkRoot root) {
+        setToOneTarget(ROOT_PROPERTY, root, true);
+    }
+
+    public ToManyFkRoot getRoot() {
+        return (ToManyFkRoot)readProperty(ROOT_PROPERTY);
+    }
+
+
+    public void setRoot2(ToManyRoot2 root2) {
+        setToOneTarget(ROOT2_PROPERTY, root2, true);
+    }
+
+    public ToManyRoot2 getRoot2() {
+        return (ToManyRoot2)readProperty(ROOT2_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/auto/_ToManyFkRoot.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/auto/_ToManyFkRoot.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/auto/_ToManyFkRoot.java
new file mode 100644
index 0000000..11f5339
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/auto/_ToManyFkRoot.java
@@ -0,0 +1,48 @@
+package org.apache.cayenne.testdo.relationships_to_many_fk.auto;
+
+import java.util.List;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_to_many_fk.ToManyFkDep;
+
+/**
+ * Class _ToManyFkRoot 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 _ToManyFkRoot extends CayenneDataObject {
+
+    public static final String DEP_ID_PROPERTY = "depId";
+    public static final String NAME_PROPERTY = "name";
+    public static final String DEPS_PROPERTY = "deps";
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public void setDepId(Integer depId) {
+        writeProperty(DEP_ID_PROPERTY, depId);
+    }
+    public Integer getDepId() {
+        return (Integer)readProperty(DEP_ID_PROPERTY);
+    }
+
+    public void setName(String name) {
+        writeProperty(NAME_PROPERTY, name);
+    }
+    public String getName() {
+        return (String)readProperty(NAME_PROPERTY);
+    }
+
+    public void addToDeps(ToManyFkDep obj) {
+        addToManyTarget(DEPS_PROPERTY, obj, true);
+    }
+    public void removeFromDeps(ToManyFkDep obj) {
+        removeToManyTarget(DEPS_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public List<ToManyFkDep> getDeps() {
+        return (List<ToManyFkDep>)readProperty(DEPS_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/auto/_ToManyRoot2.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/auto/_ToManyRoot2.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/auto/_ToManyRoot2.java
new file mode 100644
index 0000000..418b975
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_many_fk/auto/_ToManyRoot2.java
@@ -0,0 +1,40 @@
+package org.apache.cayenne.testdo.relationships_to_many_fk.auto;
+
+import java.util.List;
+
+import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.testdo.relationships_to_many_fk.ToManyFkDep;
+
+/**
+ * Class _ToManyRoot2 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 _ToManyRoot2 extends CayenneDataObject {
+
+    public static final String NAME_PROPERTY = "name";
+    public static final String DEPS_PROPERTY = "deps";
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public void setName(String name) {
+        writeProperty(NAME_PROPERTY, name);
+    }
+    public String getName() {
+        return (String)readProperty(NAME_PROPERTY);
+    }
+
+    public void addToDeps(ToManyFkDep obj) {
+        addToManyTarget(DEPS_PROPERTY, obj, true);
+    }
+    public void removeFromDeps(ToManyFkDep obj) {
+        removeToManyTarget(DEPS_PROPERTY, obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public List<ToManyFkDep> getDeps() {
+        return (List<ToManyFkDep>)readProperty(DEPS_PROPERTY);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_one_fk/ToOneFK1.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_one_fk/ToOneFK1.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_one_fk/ToOneFK1.java
new file mode 100644
index 0000000..41ae88a
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_one_fk/ToOneFK1.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_to_one_fk;
+
+import org.apache.cayenne.testdo.relationships_to_one_fk.auto._ToOneFK1;
+
+public class ToOneFK1 extends _ToOneFK1 {
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/cayenne/blob/d7178a8b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_one_fk/ToOneFK2.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_one_fk/ToOneFK2.java b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_one_fk/ToOneFK2.java
new file mode 100644
index 0000000..2d3d733
--- /dev/null
+++ b/cayenne-server/src/test/java/org/apache/cayenne/testdo/relationships_to_one_fk/ToOneFK2.java
@@ -0,0 +1,28 @@
+/*****************************************************************
+ *   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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.testdo.relationships_to_one_fk;
+
+import org.apache.cayenne.testdo.relationships_to_one_fk.auto._ToOneFK2;
+
+public class ToOneFK2 extends _ToOneFK2 {
+
+}
+
+
+