cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r404892 - in /incubator/cayenne/main/trunk/cayenne/cayenne-java/src: cayenne/java/org/objectstyle/cayenne/dba/hsqldb/ tests/java/org/objectstyle/cayenne/testdo/relationship/ tests/java/org/objectstyle/cayenne/testdo/relationship/auto/ tests...
Date Mon, 08 May 2006 02:03:07 GMT
Author: aadamchik
Date: Sun May  7 19:03:04 2006
New Revision: 404892

URL: http://svn.apache.org/viewcvs?rev=404892&view=rev
Log:
CAY-191 - not sure how this works on Firebird, but MySQL and HSQL do handle type mismatch
transparently.

Added:
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/testdo/relationship/FkOfDifferentType.java
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/testdo/relationship/auto/_FkOfDifferentType.java
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/unit/jira/CAY_191Tst.java
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/resources/dml/unit.jira.CAY_191Tst.xml
Modified:
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/hsqldb/HSQLDBAdapter.java
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/testdo/relationship/auto/_RelationshipHelper.java
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/unit/AccessStackAdapter.java
    incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/resources/relationships.map.xml

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/hsqldb/HSQLDBAdapter.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/hsqldb/HSQLDBAdapter.java?rev=404892&r1=404891&r2=404892&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/hsqldb/HSQLDBAdapter.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/cayenne/java/org/objectstyle/cayenne/dba/hsqldb/HSQLDBAdapter.java
Sun May  7 19:03:04 2006
@@ -56,11 +56,14 @@
 
 package org.objectstyle.cayenne.dba.hsqldb;
 
+import java.sql.PreparedStatement;
 import java.util.Collection;
 import java.util.Iterator;
 
 import org.objectstyle.cayenne.CayenneRuntimeException;
 import org.objectstyle.cayenne.access.DataNode;
+import org.objectstyle.cayenne.access.types.DefaultType;
+import org.objectstyle.cayenne.access.types.ExtendedTypeMap;
 import org.objectstyle.cayenne.dba.JdbcAdapter;
 import org.objectstyle.cayenne.map.DbAttribute;
 import org.objectstyle.cayenne.map.DbEntity;
@@ -76,31 +79,36 @@
  * use with HSQLDB are shown below:
  * 
  * <pre>
- *  
- *   test-hsqldb.cayenne.adapter = org.objectstyle.cayenne.dba.hsqldb.HSQLDBAdapter
- *   test-hsqldb.jdbc.username = test
- *   test-hsqldb.jdbc.password = secret
- *   test-hsqldb.jdbc.url = jdbc:hsqldb:hsql://serverhostname
- *   test-hsqldb.jdbc.driver = org.hsqldb.jdbcDriver
- *   
+ *       
+ *        test-hsqldb.cayenne.adapter = org.objectstyle.cayenne.dba.hsqldb.HSQLDBAdapter
+ *        test-hsqldb.jdbc.username = test
+ *        test-hsqldb.jdbc.password = secret
+ *        test-hsqldb.jdbc.url = jdbc:hsqldb:hsql://serverhostname
+ *        test-hsqldb.jdbc.driver = org.hsqldb.jdbcDriver
+ *        
  * </pre>
  * 
  * @author Holger Hoffstaette
  */
 public class HSQLDBAdapter extends JdbcAdapter {
 
+    protected void configureExtendedTypes(ExtendedTypeMap map) {
+        super.configureExtendedTypes(map);
+        map.registerType(new ShortType());
+        map.registerType(new ByteType());
+    }
+
     /**
-     * Generate fully-qualified name for 1.8 and on.  Subclass generates unqualified name.
+     * Generate fully-qualified name for 1.8 and on. Subclass generates unqualified name.
      * 
      * @since 1.2
      */
-    protected String getTableName(DbEntity entity)
-    {
-        return  entity.getFullyQualifiedName();
+    protected String getTableName(DbEntity entity) {
+        return entity.getFullyQualifiedName();
     }
-    
+
     /**
-     * Generate fully-qualified name for 1.8 and on.  Subclass generates unqualified name.
+     * Generate fully-qualified name for 1.8 and on. Subclass generates unqualified name.
      * 
      * @since 1.2
      */
@@ -139,7 +147,7 @@
 
         buf.append("ALTER TABLE ").append(srcName);
         buf.append(" ADD CONSTRAINT ");
-        
+
         buf.append(getSchemaName(source));
         buf.append("U_");
         buf.append(source.getName());
@@ -161,7 +169,7 @@
 
         return buf.toString();
     }
-    
+
     /**
      * Adds an ADD CONSTRAINT clause to a relationship constraint.
      * 
@@ -179,7 +187,7 @@
 
         // hsqldb requires the ADD CONSTRAINT statement
         buf.append(" ADD CONSTRAINT ");
-        buf.append(getSchemaName((DbEntity)rel.getSourceEntity()));
+        buf.append(getSchemaName((DbEntity) rel.getSourceEntity()));
         buf.append("C_");
         buf.append(rel.getSourceEntity().getName());
         buf.append("_");
@@ -221,7 +229,7 @@
      */
     public String createTable(DbEntity ent) {
         // SET SCHEMA <schemaname>
-        
+
         String sql = super.createTable(ent);
 
         if (sql != null && sql.toUpperCase().startsWith("CREATE TABLE ")) {
@@ -229,5 +237,53 @@
         }
 
         return sql;
+    }
+
+    final class ShortType extends DefaultType {
+
+        ShortType() {
+            super(Short.class.getName());
+        }
+
+        public void setJdbcObject(
+                PreparedStatement st,
+                Object val,
+                int pos,
+                int type,
+                int precision) throws Exception {
+
+            if (val == null) {
+                super.setJdbcObject(st, val, pos, type, precision);
+            }
+            else {
+
+                short s = ((Number) val).shortValue();
+                st.setShort(pos, s);
+            }
+        }
+    }
+    
+    final class ByteType extends DefaultType {
+
+        ByteType() {
+            super(Byte.class.getName());
+        }
+
+        public void setJdbcObject(
+                PreparedStatement st,
+                Object val,
+                int pos,
+                int type,
+                int precision) throws Exception {
+
+            if (val == null) {
+                super.setJdbcObject(st, val, pos, type, precision);
+            }
+            else {
+
+                byte b = ((Number) val).byteValue();
+                st.setByte(pos, b);
+            }
+        }
     }
 }

Added: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/testdo/relationship/FkOfDifferentType.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/testdo/relationship/FkOfDifferentType.java?rev=404892&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/testdo/relationship/FkOfDifferentType.java
(added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/testdo/relationship/FkOfDifferentType.java
Sun May  7 19:03:04 2006
@@ -0,0 +1,10 @@
+package org.objectstyle.cayenne.testdo.relationship;
+
+import org.objectstyle.cayenne.testdo.relationship.auto._FkOfDifferentType;
+
+public class FkOfDifferentType extends _FkOfDifferentType {
+
+}
+
+
+

Added: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/testdo/relationship/auto/_FkOfDifferentType.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/testdo/relationship/auto/_FkOfDifferentType.java?rev=404892&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/testdo/relationship/auto/_FkOfDifferentType.java
(added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/testdo/relationship/auto/_FkOfDifferentType.java
Sun May  7 19:03:04 2006
@@ -0,0 +1,23 @@
+package org.objectstyle.cayenne.testdo.relationship.auto;
+
+/** Class _FkOfDifferentType 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 _FkOfDifferentType extends org.objectstyle.cayenne.CayenneDataObject {
+
+    public static final String RELATIONSHIP_HELPER_PROPERTY = "relationshipHelper";
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public void setRelationshipHelper(org.objectstyle.cayenne.testdo.relationship.RelationshipHelper
relationshipHelper) {
+        setToOneTarget("relationshipHelper", relationshipHelper, true);
+    }
+
+    public org.objectstyle.cayenne.testdo.relationship.RelationshipHelper getRelationshipHelper()
{
+        return (org.objectstyle.cayenne.testdo.relationship.RelationshipHelper)readProperty("relationshipHelper");
+    } 
+    
+    
+}

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/testdo/relationship/auto/_RelationshipHelper.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/testdo/relationship/auto/_RelationshipHelper.java?rev=404892&r1=404891&r2=404892&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/testdo/relationship/auto/_RelationshipHelper.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/testdo/relationship/auto/_RelationshipHelper.java
Sun May  7 19:03:04 2006
@@ -1,5 +1,7 @@
 package org.objectstyle.cayenne.testdo.relationship.auto;
 
+import java.util.List;
+
 /** Class _RelationshipHelper 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. 
@@ -8,6 +10,9 @@
 public class _RelationshipHelper extends org.objectstyle.cayenne.CayenneDataObject {
 
     public static final String NAME_PROPERTY = "name";
+    public static final String FKS_OF_DIFFERENT_TYPE_PROPERTY = "fksOfDifferentType";
+    public static final String MEANIGFUL_FKS_PROPERTY = "meanigfulFKs";
+    public static final String REFLEXIVE_AND_TO_ONE_ARRAY_PROPERTY = "reflexiveAndToOneArray";
 
     public static final String RELATIONSHIP_HELPER_ID_PK_COLUMN = "RELATIONSHIP_HELPER_ID";
 
@@ -16,6 +21,39 @@
     }
     public String getName() {
         return (String)readProperty("name");
+    }
+    
+    
+    public void addToFksOfDifferentType(org.objectstyle.cayenne.testdo.relationship.FkOfDifferentType
obj) {
+        addToManyTarget("fksOfDifferentType", obj, true);
+    }
+    public void removeFromFksOfDifferentType(org.objectstyle.cayenne.testdo.relationship.FkOfDifferentType
obj) {
+        removeToManyTarget("fksOfDifferentType", obj, true);
+    }
+    public List getFksOfDifferentType() {
+        return (List)readProperty("fksOfDifferentType");
+    }
+    
+    
+    public void addToMeanigfulFKs(org.objectstyle.cayenne.testdo.relationship.MeaningfulFK
obj) {
+        addToManyTarget("meanigfulFKs", obj, true);
+    }
+    public void removeFromMeanigfulFKs(org.objectstyle.cayenne.testdo.relationship.MeaningfulFK
obj) {
+        removeToManyTarget("meanigfulFKs", obj, true);
+    }
+    public List getMeanigfulFKs() {
+        return (List)readProperty("meanigfulFKs");
+    }
+    
+    
+    public void addToReflexiveAndToOneArray(org.objectstyle.cayenne.testdo.relationship.ReflexiveAndToOne
obj) {
+        addToManyTarget("reflexiveAndToOneArray", obj, true);
+    }
+    public void removeFromReflexiveAndToOneArray(org.objectstyle.cayenne.testdo.relationship.ReflexiveAndToOne
obj) {
+        removeToManyTarget("reflexiveAndToOneArray", obj, true);
+    }
+    public List getReflexiveAndToOneArray() {
+        return (List)readProperty("reflexiveAndToOneArray");
     }
     
     

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/unit/AccessStackAdapter.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/unit/AccessStackAdapter.java?rev=404892&r1=404891&r2=404892&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/unit/AccessStackAdapter.java
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/unit/AccessStackAdapter.java
Sun May  7 19:03:04 2006
@@ -175,6 +175,10 @@
     }
     
     public boolean supportsFKConstraints(DbEntity entity) {
+        if("FK_OF_DIFFERENT_TYPE".equals(entity.getName())) {
+            return false;
+        }
+        
         return adapter.supportsFkConstraints();
     }
 

Added: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/unit/jira/CAY_191Tst.java
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/unit/jira/CAY_191Tst.java?rev=404892&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/unit/jira/CAY_191Tst.java
(added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/java/org/objectstyle/cayenne/unit/jira/CAY_191Tst.java
Sun May  7 19:03:04 2006
@@ -0,0 +1,82 @@
+/* ====================================================================
+ * 
+ * The ObjectStyle Group Software License, version 1.1
+ * ObjectStyle Group - http://objectstyle.org/
+ * 
+ * Copyright (c) 2002-2005, Andrei (Andrus) Adamchik and individual authors
+ * of the software. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 
+ * 3. The end-user documentation included with the redistribution, if any,
+ *    must include the following acknowlegement:
+ *    "This product includes software developed by independent contributors
+ *    and hosted on ObjectStyle Group web site (http://objectstyle.org/)."
+ *    Alternately, this acknowlegement may appear in the software itself,
+ *    if and wherever such third-party acknowlegements normally appear.
+ * 
+ * 4. The names "ObjectStyle Group" and "Cayenne" must not be used to endorse
+ *    or promote products derived from this software without prior written
+ *    permission. For written permission, email
+ *    "andrus at objectstyle dot org".
+ * 
+ * 5. Products derived from this software may not be called "ObjectStyle"
+ *    or "Cayenne", nor may "ObjectStyle" or "Cayenne" appear in their
+ *    names without prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE OBJECTSTYLE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ * 
+ * This software consists of voluntary contributions made by many
+ * individuals and hosted on ObjectStyle Group web site.  For more
+ * information on the ObjectStyle Group, please see
+ * <http://objectstyle.org/>.
+ */
+package org.objectstyle.cayenne.unit.jira;
+
+import org.objectstyle.cayenne.DataObjectUtils;
+import org.objectstyle.cayenne.access.DataContext;
+import org.objectstyle.cayenne.testdo.relationship.FkOfDifferentType;
+import org.objectstyle.cayenne.unit.RelationshipTestCase;
+
+public class CAY_191Tst extends RelationshipTestCase {
+
+    public void testResolveToOneOverFKOfDifferentNumType() throws Exception {
+        // this is mostly for legacy schemas, as on many dbs you won;t be able to even
+        // create the FK constraint...
+
+        deleteTestData();
+        createTestData("testResolveToOneOverFKOfDifferentNumType");
+
+        DataContext context = createDataContext();
+        FkOfDifferentType root = (FkOfDifferentType) DataObjectUtils.objectForPK(
+                context,
+                FkOfDifferentType.class,
+                1);
+
+        assertNotNull(root);
+        assertNotNull(root.getRelationshipHelper());
+        assertEquals("RH1", root.getRelationshipHelper().getName());
+    }
+}

Added: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/resources/dml/unit.jira.CAY_191Tst.xml
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/resources/dml/unit.jira.CAY_191Tst.xml?rev=404892&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/resources/dml/unit.jira.CAY_191Tst.xml
(added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/resources/dml/unit.jira.CAY_191Tst.xml
Sun May  7 19:03:04 2006
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans default-lazy-init="true">	
+	<!-- ======================================= -->
+	<!-- Named Queries -->
+	<!-- ======================================= -->
+	<bean id="RH1" class="org.objectstyle.cayenne.unit.util.UpdatingSQLTemplate">
+		<constructor-arg type="java.lang.Class"><value>org.objectstyle.cayenne.testdo.relationship.FkOfDifferentType</value></constructor-arg>
+		<constructor-arg><value>
+		insert into RELATIONSHIP_HELPER (NAME, RELATIONSHIP_HELPER_ID) values ('RH1', 1)
+		</value></constructor-arg>
+	</bean>
+
+	<bean id="FD1" class="org.objectstyle.cayenne.unit.util.UpdatingSQLTemplate">
+		<constructor-arg type="java.lang.Class"><value>org.objectstyle.cayenne.testdo.relationship.FkOfDifferentType</value></constructor-arg>
+		<constructor-arg><value>
+		insert into FK_OF_DIFFERENT_TYPE (ID, RELATIONSHIP_HELPER_FK) values (1, 1)
+		</value></constructor-arg>
+	</bean>
+
+
+	
+	<!-- ======================================= -->
+	<!-- Data Sets -->
+	<!-- ======================================= -->
+	<bean id="testResolveToOneOverFKOfDifferentNumType" class="java.util.ArrayList">
+		<constructor-arg>
+			<list>
+				<ref bean="RH1"/>
+				<ref bean="FD1"/>
+			</list>
+		</constructor-arg>
+	</bean>
+</beans>
\ No newline at end of file

Modified: incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/resources/relationships.map.xml
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/resources/relationships.map.xml?rev=404892&r1=404891&r2=404892&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/resources/relationships.map.xml
(original)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-java/src/tests/resources/relationships.map.xml
Sun May  7 19:03:04 2006
@@ -38,6 +38,10 @@
 		<db-attribute name="DELETE_RULE_TEST_3_FK" type="INTEGER"/>
 		<db-attribute name="DELETE_RULE_TEST_3_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
 	</db-entity>
+	<db-entity name="FK_OF_DIFFERENT_TYPE">
+		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+		<db-attribute name="RELATIONSHIP_HELPER_FK" type="SMALLINT"/>
+	</db-entity>
 	<db-entity name="FLATTENED_TEST_1">
 		<db-attribute name="FT1_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
 		<db-attribute name="NAME" type="VARCHAR" isMandatory="true" length="100"/>
@@ -104,6 +108,8 @@
 	</obj-entity>
 	<obj-entity name="DeleteRuleTest3" className="org.objectstyle.cayenne.testdo.relationship.DeleteRuleTest3"
dbEntityName="DELETE_RULE_TEST3">
 	</obj-entity>
+	<obj-entity name="FkOfDifferentType" className="org.objectstyle.cayenne.testdo.relationship.FkOfDifferentType"
dbEntityName="FK_OF_DIFFERENT_TYPE">
+	</obj-entity>
 	<obj-entity name="FlattenedTest1" className="org.objectstyle.cayenne.testdo.relationship.FlattenedTest1"
dbEntityName="FLATTENED_TEST_1">
 		<obj-attribute name="name" type="java.lang.String" db-attribute-path="NAME"/>
 	</obj-entity>
@@ -176,6 +182,9 @@
 	<db-relationship name="toDeleteRuleTest2" source="DELETE_RULE_TEST3" target="DELETE_RULE_TEST2"
toMany="false">
 		<db-attribute-pair source="DELETE_RULE_TEST_3_FK" target="DEL_RULE_TEST2_ID"/>
 	</db-relationship>
+	<db-relationship name="relationshipHelper" source="FK_OF_DIFFERENT_TYPE" target="RELATIONSHIP_HELPER"
toMany="false">
+		<db-attribute-pair source="RELATIONSHIP_HELPER_FK" target="RELATIONSHIP_HELPER_ID"/>
+	</db-relationship>
 	<db-relationship name="complexJoins" source="FLATTENED_TEST_1" target="COMPLEX_JOIN"
toMany="true">
 		<db-attribute-pair source="FT1_ID" target="FT1_FK"/>
 	</db-relationship>
@@ -206,6 +215,9 @@
 	<db-relationship name="toParent" source="REFLEXIVE_AND_TO_ONE" target="REFLEXIVE_AND_TO_ONE"
toMany="false">
 		<db-attribute-pair source="PARENT_ID" target="REFLEXIVE_AND_TO_ONE_ID"/>
 	</db-relationship>
+	<db-relationship name="fksOfDifferentType" source="RELATIONSHIP_HELPER" target="FK_OF_DIFFERENT_TYPE"
toMany="true">
+		<db-attribute-pair source="RELATIONSHIP_HELPER_ID" target="RELATIONSHIP_HELPER_FK"/>
+	</db-relationship>
 	<db-relationship name="meanigfulFKs" source="RELATIONSHIP_HELPER" target="MEANINGFUL_FK"
toMany="true">
 		<db-attribute-pair source="RELATIONSHIP_HELPER_ID" target="RELATIONSHIP_HELPER_ID"/>
 	</db-relationship>
@@ -238,6 +250,7 @@
 	<obj-relationship name="deleteRuleTest3Array" source="DeleteRuleTest2" target="DeleteRuleTest3"
db-relationship-path="deleteRuleTest3Array"/>
 	<obj-relationship name="test1Array" source="DeleteRuleTest2" target="DeleteRuleTest1"
deleteRule="Nullify" db-relationship-path="test1Array"/>
 	<obj-relationship name="toDeleteRuleTest2" source="DeleteRuleTest3" target="DeleteRuleTest2"
db-relationship-path="toDeleteRuleTest2"/>
+	<obj-relationship name="relationshipHelper" source="FkOfDifferentType" target="RelationshipHelper"
db-relationship-path="relationshipHelper"/>
 	<obj-relationship name="ft2Array" source="FlattenedTest1" target="FlattenedTest2" db-relationship-path="ft2Array"/>
 	<obj-relationship name="ft3Array" source="FlattenedTest1" target="FlattenedTest3" db-relationship-path="ft2Array.ft3Array"/>
 	<obj-relationship name="ft3OverComplex" source="FlattenedTest1" target="FlattenedTest3"
db-relationship-path="complexJoins.toFT3"/>
@@ -249,6 +262,9 @@
 	<obj-relationship name="children" source="ReflexiveAndToOne" target="ReflexiveAndToOne"
db-relationship-path="children"/>
 	<obj-relationship name="toHelper" source="ReflexiveAndToOne" target="RelationshipHelper"
db-relationship-path="toHelper"/>
 	<obj-relationship name="toParent" source="ReflexiveAndToOne" target="ReflexiveAndToOne"
db-relationship-path="toParent"/>
+	<obj-relationship name="fksOfDifferentType" source="RelationshipHelper" target="FkOfDifferentType"
db-relationship-path="fksOfDifferentType"/>
+	<obj-relationship name="meanigfulFKs" source="RelationshipHelper" target="MeaningfulFK"
db-relationship-path="meanigfulFKs"/>
+	<obj-relationship name="reflexiveAndToOneArray" source="RelationshipHelper" target="ReflexiveAndToOne"
db-relationship-path="reflexiveAndToOneArray"/>
 	<obj-relationship name="root" source="ToManyFkDep" target="ToManyFkRoot" db-relationship-path="root"/>
 	<obj-relationship name="root2" source="ToManyFkDep" target="ToManyRoot2" db-relationship-path="root2"/>
 	<obj-relationship name="deps" source="ToManyFkRoot" target="ToManyFkDep" db-relationship-path="deps"/>



Mime
View raw message