db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r379896 - in /db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb: broker/BidirectionalAssociationTest.java otm/CopyTest.java repository_junit.xml
Date Wed, 22 Feb 2006 21:08:14 GMT
Author: arminw
Date: Wed Feb 22 13:08:13 2006
New Revision: 379896

URL: http://svn.apache.org/viewcvs?rev=379896&view=rev
Log:
add new tests

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/BidirectionalAssociationTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/otm/CopyTest.java
    db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/repository_junit.xml

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/BidirectionalAssociationTest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/BidirectionalAssociationTest.java?rev=379896&r1=379895&r2=379896&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/BidirectionalAssociationTest.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/broker/BidirectionalAssociationTest.java
Wed Feb 22 13:08:13 2006
@@ -1,17 +1,19 @@
 package org.apache.ojb.broker;
 
-import java.util.Iterator;
+import java.io.Serializable;
 import java.util.Collection;
+import java.util.Iterator;
 
+import org.apache.ojb.broker.metadata.ClassDescriptor;
+import org.apache.ojb.broker.metadata.ObjectReferenceDescriptor;
 import org.apache.ojb.broker.query.Criteria;
 import org.apache.ojb.broker.query.Query;
 import org.apache.ojb.broker.query.QueryFactory;
-import org.apache.ojb.broker.metadata.ClassDescriptor;
-import org.apache.ojb.broker.metadata.ObjectReferenceDescriptor;
+import org.apache.ojb.broker.util.ObjectModification;
 import org.apache.ojb.junit.PBTestCase;
 
 /**
- * tests a bidirectional association A<-->B
+ * Tests a bidirectional association A<-->B
  * @see org.apache.ojb.odmg.BidirectionalAssociationTest for equivalent test in ODMG
  */
 public class BidirectionalAssociationTest extends PBTestCase
@@ -37,14 +39,227 @@
         super.tearDown();
     }
 
+    public void testCreateDeleteWithAutoincrement_1()
+    {
+        ojbChangeReferenceSetting(ObjectAA.class, "relatedB", true,
+                ObjectReferenceDescriptor.CASCADE_OBJECT, ObjectReferenceDescriptor.CASCADE_OBJECT,
false);
+        ojbChangeReferenceSetting(ObjectBB.class, "relatedA", true,
+                ObjectReferenceDescriptor.CASCADE_OBJECT, ObjectReferenceDescriptor.CASCADE_OBJECT,
false);
+
+        ObjectAA a = new ObjectAA();
+        ObjectBB b = new ObjectBB();
+        broker.beginTransaction();
+        // first store both objects
+        broker.store(a, ObjectModification.INSERT);
+        broker.store(b, ObjectModification.INSERT);
+        // now set references
+        a.setRelatedB(b);
+        b.setRelatedA(a);
+        // update both
+        broker.store(a, ObjectModification.UPDATE);
+        broker.commitTransaction();
+
+        Criteria crit = new Criteria();
+        crit.addLike("pk", a.getPk());
+        Query query = QueryFactory.newQuery(ObjectAA.class, crit);
+        ObjectAA result_AA = (ObjectAA) broker.getObjectByQuery(query);
+        assertNotNull(result_AA);
+        assertNotNull(result_AA.getRelatedB());
+
+        crit = new Criteria();
+        crit.addLike("pk", b.getPk());
+        query = QueryFactory.newQuery(ObjectBB.class, crit);
+        ObjectBB result_BB = (ObjectBB) broker.getObjectByQuery(query);
+        assertNotNull(result_BB);
+        assertNotNull(result_BB.getRelatedA());
+
+        broker.beginTransaction();
+        // cascade delete enabled, will delete first ObjectAA then ObjectBB
+        broker.delete(b);
+        broker.commitTransaction();
+
+        crit = new Criteria();
+        crit.addLike("pk", a.getPk());
+        query = QueryFactory.newQuery(ObjectAA.class, crit);
+        result_AA = (ObjectAA) broker.getObjectByQuery(query);
+        assertNull(result_AA);
+
+        crit = new Criteria();
+        crit.addLike("pk", b.getPk());
+        query = QueryFactory.newQuery(ObjectBB.class, crit);
+        result_BB = (ObjectBB) broker.getObjectByQuery(query);
+        assertNull(result_BB);
+    }
+
+    public void testCreateDeleteWithAutoincrement_2()
+    {
+        ojbChangeReferenceSetting(ObjectAA.class, "relatedB", true,
+                ObjectReferenceDescriptor.CASCADE_OBJECT, ObjectReferenceDescriptor.CASCADE_NONE,
false);
+        ojbChangeReferenceSetting(ObjectBB.class, "relatedA", true,
+                ObjectReferenceDescriptor.CASCADE_OBJECT, ObjectReferenceDescriptor.CASCADE_NONE,
false);
+
+        ObjectAA a = new ObjectAA();
+        ObjectBB b = new ObjectBB();
+        // now set references
+        a.setRelatedB(b);
+        b.setRelatedA(a);
+        broker.beginTransaction();
+        // first store both objects
+        broker.store(a);
+        // update b to force OJB to set the FK
+        broker.store(b);
+        broker.commitTransaction();
+
+        Criteria crit = new Criteria();
+        crit.addLike("pk", a.getPk());
+        Query query = QueryFactory.newQuery(ObjectAA.class, crit);
+        ObjectAA result_AA = (ObjectAA) broker.getObjectByQuery(query);
+        assertNotNull(result_AA);
+        assertNotNull(result_AA.getRelatedB());
+
+        crit = new Criteria();
+        crit.addLike("pk", b.getPk());
+        query = QueryFactory.newQuery(ObjectBB.class, crit);
+        ObjectBB result_BB = (ObjectBB) broker.getObjectByQuery(query);
+        assertNotNull(result_BB);
+        assertNotNull(result_BB.getRelatedA());
+
+        broker.beginTransaction();
+        broker.delete(b);
+        broker.delete(a);
+        broker.commitTransaction();
+
+        crit = new Criteria();
+        crit.addLike("pk", a.getPk());
+        query = QueryFactory.newQuery(ObjectAA.class, crit);
+        result_AA = (ObjectAA) broker.getObjectByQuery(query);
+        assertNull(result_AA);
+
+        crit = new Criteria();
+        crit.addLike("pk", b.getPk());
+        query = QueryFactory.newQuery(ObjectBB.class, crit);
+        result_BB = (ObjectBB) broker.getObjectByQuery(query);
+        assertNull(result_BB);
+    }
+
+    public void testCreateDeleteWithAutoincrement_3()
+    {
+        ojbChangeReferenceSetting(ObjectAA.class, "relatedB", true,
+                ObjectReferenceDescriptor.CASCADE_NONE, ObjectReferenceDescriptor.CASCADE_NONE,
false);
+        ojbChangeReferenceSetting(ObjectBB.class, "relatedA", true,
+                ObjectReferenceDescriptor.CASCADE_NONE, ObjectReferenceDescriptor.CASCADE_NONE,
false);
+
+        ObjectAA a = new ObjectAA();
+        ObjectBB b = new ObjectBB();
+        // now set references
+        a.setRelatedB(b);
+        b.setRelatedA(a);
+        broker.beginTransaction();
+        // first insert a
+        broker.store(a, ObjectModification.INSERT);
+        // link (set FK to a) and insert b
+        broker.serviceBrokerHelper().link(b, true);
+        broker.store(b, ObjectModification.INSERT);
+        // link a (set FK to b)
+        broker.serviceBrokerHelper().link(a, false);
+        // update FK of a
+        broker.store(a, ObjectModification.UPDATE);
+        broker.commitTransaction();
+
+        Criteria crit = new Criteria();
+        crit.addLike("pk", a.getPk());
+        Query query = QueryFactory.newQuery(ObjectAA.class, crit);
+        ObjectAA result_AA = (ObjectAA) broker.getObjectByQuery(query);
+        assertNotNull(result_AA);
+        assertNotNull(result_AA.getRelatedB());
+
+        crit = new Criteria();
+        crit.addLike("pk", b.getPk());
+        query = QueryFactory.newQuery(ObjectBB.class, crit);
+        ObjectBB result_BB = (ObjectBB) broker.getObjectByQuery(query);
+        assertNotNull(result_BB);
+        assertNotNull(result_BB.getRelatedA());
+
+        broker.beginTransaction();
+        // cascade delete enabled
+        broker.delete(b);
+        broker.delete(a);
+        broker.commitTransaction();
+
+        crit = new Criteria();
+        crit.addLike("pk", a.getPk());
+        query = QueryFactory.newQuery(ObjectAA.class, crit);
+        result_AA = (ObjectAA) broker.getObjectByQuery(query);
+        assertNull(result_AA);
+
+        crit = new Criteria();
+        crit.addLike("pk", b.getPk());
+        query = QueryFactory.newQuery(ObjectBB.class, crit);
+        result_BB = (ObjectBB) broker.getObjectByQuery(query);
+        assertNull(result_BB);
+    }
+
+    public void testCreateDeleteWithAutoincrement_4()
+    {
+        ojbChangeReferenceSetting(ObjectAA.class, "relatedB", true,
+                ObjectReferenceDescriptor.CASCADE_LINK, ObjectReferenceDescriptor.CASCADE_NONE,
false);
+        ojbChangeReferenceSetting(ObjectBB.class, "relatedA", true,
+                ObjectReferenceDescriptor.CASCADE_LINK, ObjectReferenceDescriptor.CASCADE_NONE,
false);
+
+        ObjectAA a = new ObjectAA();
+        ObjectBB b = new ObjectBB();
+        broker.beginTransaction();
+        // first store both objects
+        broker.store(a);
+        broker.store(b);
+        // now set references
+        a.setRelatedB(b);
+        b.setRelatedA(a);
+        // update a and b to force OJB to set the FK
+        broker.store(a);
+        broker.store(b);
+        broker.commitTransaction();
+
+        Criteria crit = new Criteria();
+        crit.addLike("pk", a.getPk());
+        Query query = QueryFactory.newQuery(ObjectAA.class, crit);
+        ObjectAA result_AA = (ObjectAA) broker.getObjectByQuery(query);
+        assertNotNull(result_AA);
+        assertNotNull(result_AA.getRelatedB());
+
+        crit = new Criteria();
+        crit.addLike("pk", b.getPk());
+        query = QueryFactory.newQuery(ObjectBB.class, crit);
+        ObjectBB result_BB = (ObjectBB) broker.getObjectByQuery(query);
+        assertNotNull(result_BB);
+        assertNotNull(result_BB.getRelatedA());
+
+        broker.beginTransaction();
+        broker.delete(b);
+        broker.commitTransaction();
+
+        crit = new Criteria();
+        crit.addLike("pk", a.getPk());
+        query = QueryFactory.newQuery(ObjectAA.class, crit);
+        result_AA = (ObjectAA) broker.getObjectByQuery(query);
+        assertNotNull(result_AA);
+        assertNull(result_AA.getRelatedB());
+
+        crit = new Criteria();
+        crit.addLike("pk", b.getPk());
+        query = QueryFactory.newQuery(ObjectBB.class, crit);
+        result_BB = (ObjectBB) broker.getObjectByQuery(query);
+        assertNull(result_BB);
+    }
+
     public void testAutoRefreshTrue()
     {
-        String pkSuffix = "_" + System.currentTimeMillis();
+        String pkSuffix = "testAutoRefreshTrue_" + System.currentTimeMillis();
         ObjectReferenceDescriptor ord_A = null;
         ObjectReferenceDescriptor ord_B = null;
-        ClassDescriptor cld_A = broker.getClassDescriptor(BidirectionalAssociationObjectA.class);
+        ClassDescriptor cld_A = broker.getClassDescriptor(ObjectA.class);
         ord_A = cld_A.getObjectReferenceDescriptorByName("relatedB");
-        ClassDescriptor cld_B = broker.getClassDescriptor(BidirectionalAssociationObjectB.class);
+        ClassDescriptor cld_B = broker.getClassDescriptor(ObjectB.class);
         ord_B = cld_B.getObjectReferenceDescriptorByName("relatedA");
         boolean oldA = ord_A.isRefresh();
         boolean oldB = ord_B.isRefresh();
@@ -55,7 +270,7 @@
             createWithUpdate(pkSuffix);
             Criteria crit = new Criteria();
             crit.addLike("pk", "%" + pkSuffix);
-            Query query = QueryFactory.newQuery(BidirectionalAssociationObjectB.class, crit);
+            Query query = QueryFactory.newQuery(ObjectB.class, crit);
             Collection result = broker.getCollectionByQuery(query);
             assertEquals(1, result.size());
         }
@@ -66,9 +281,9 @@
         }
     }
 
-    public void testCreateDelete()
+    public void testCreateDeleteDisabledAutoincrement_()
     {
-        String pkSuffix = "_" + System.currentTimeMillis();
+        String pkSuffix = "testCreateDeleteDisabledAutoincrement_" + System.currentTimeMillis();
         createWithUpdate(pkSuffix);
         deleteAllA();
         deleteAllB();
@@ -77,9 +292,9 @@
     private void createWithUpdate(String pkSuffix)
     {
         broker.beginTransaction();
-        BidirectionalAssociationObjectA a = new BidirectionalAssociationObjectA();
+        ObjectA a = new ObjectA();
         a.setPk("A" + pkSuffix);
-        BidirectionalAssociationObjectB b = new BidirectionalAssociationObjectB();
+        ObjectB b = new ObjectB();
         b.setPk("B" + pkSuffix);
         broker.store(a);
         broker.store(b);
@@ -104,12 +319,12 @@
         Criteria crit = new Criteria();
         Query q;
         Iterator iter;
-        q = QueryFactory.newQuery(BidirectionalAssociationObjectA.class, crit);
+        q = QueryFactory.newQuery(ObjectA.class, crit);
         iter = broker.getIteratorByQuery(q);
-        BidirectionalAssociationObjectA temp = null;
+        ObjectA temp = null;
         while (iter.hasNext())
         {
-            temp = (BidirectionalAssociationObjectA) iter.next();
+            temp = (ObjectA) iter.next();
             if (temp.getRelatedB() == null)
             {
                 fail("relatedB not found");
@@ -128,12 +343,12 @@
         Criteria crit = new Criteria();
         Query q;
         Iterator iter;
-        q = QueryFactory.newQuery(BidirectionalAssociationObjectB.class, crit);
+        q = QueryFactory.newQuery(ObjectB.class, crit);
         iter = broker.getIteratorByQuery(q);
-        BidirectionalAssociationObjectB temp = null;
+        ObjectB temp = null;
         while (iter.hasNext())
         {
-            temp = (BidirectionalAssociationObjectB) iter.next();
+            temp = (ObjectB) iter.next();
             if (temp.getRelatedA() == null)
             {
                 fail("relatedA not found");
@@ -165,14 +380,14 @@
         Criteria crit = new Criteria();
         Query q;
         Iterator iter;
-        q = QueryFactory.newQuery(BidirectionalAssociationObjectA.class, crit);
+        q = QueryFactory.newQuery(ObjectA.class, crit);
         iter = broker.getIteratorByQuery(q);
-        BidirectionalAssociationObjectA temp = null;
+        ObjectA temp = null;
         broker.beginTransaction();
         while (iter.hasNext())
         {
-            temp = (BidirectionalAssociationObjectA) iter.next();
-            BidirectionalAssociationObjectB b = temp.getRelatedB();
+            temp = (ObjectA) iter.next();
+            ObjectB b = temp.getRelatedB();
             if (b != null)
             {
                 b.setRelatedA(null);
@@ -188,14 +403,14 @@
         Criteria crit = new Criteria();
         Query q;
         Iterator iter;
-        q = QueryFactory.newQuery(BidirectionalAssociationObjectB.class, crit);
+        q = QueryFactory.newQuery(ObjectB.class, crit);
         iter = broker.getIteratorByQuery(q);
-        BidirectionalAssociationObjectB temp = null;
+        ObjectB temp = null;
         broker.beginTransaction();
         while (iter.hasNext())
         {
-            temp = (BidirectionalAssociationObjectB) iter.next();
-            BidirectionalAssociationObjectA a = temp.getRelatedA();
+            temp = (ObjectB) iter.next();
+            ObjectA a = temp.getRelatedA();
             if (a != null)
             {
                 a.setRelatedB(null);
@@ -204,5 +419,114 @@
             broker.delete(temp);
         }
         broker.commitTransaction();
+    }
+
+
+
+
+
+    //===================================================================
+    // inner classes
+    //===================================================================
+
+    /**
+     * with enabled autoincrement
+     */
+    public static class ObjectAA extends ObjectA
+    {
+
+    }
+    /**
+     * with enabled autoincrement
+     */
+    public static class ObjectBB extends ObjectB
+    {
+
+    }
+    /**
+     * with disabled autoincrement
+     */
+    public static class ObjectA implements Serializable
+    {
+        private String pk;
+        private String fkToB;
+        private ObjectB relatedB;
+
+        public ObjectA()
+        {
+        }
+
+        public String getPk()
+        {
+            return pk;
+        }
+
+        public void setPk(String pk)
+        {
+            this.pk = pk;
+        }
+
+        public String getFkToB()
+        {
+            return fkToB;
+        }
+
+        public void setFkToB(String fkToB)
+        {
+            this.fkToB = fkToB;
+        }
+
+        public ObjectB getRelatedB()
+        {
+            return relatedB;
+        }
+
+        public void setRelatedB(ObjectB relatedB)
+        {
+            this.relatedB = relatedB;
+        }
+    }
+    /**
+     * with disabled autoincrement
+     */
+    public static class ObjectB implements Serializable
+    {
+        private String pk;
+        private String fkToA;
+        private ObjectA relatedA;
+
+        public ObjectB()
+        {
+        }
+
+        public String getPk()
+        {
+            return pk;
+        }
+
+        public void setPk(String pk)
+        {
+            this.pk = pk;
+        }
+
+        public String getFkToA()
+        {
+            return fkToA;
+        }
+
+        public void setFkToA(String fkToA)
+        {
+            this.fkToA = fkToA;
+        }
+
+        public ObjectA getRelatedA()
+        {
+            return relatedA;
+        }
+
+        public void setRelatedA(ObjectA relatedA)
+        {
+            this.relatedA = relatedA;
+        }
     }
 }

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/otm/CopyTest.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/otm/CopyTest.java?rev=379896&r1=379895&r2=379896&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/otm/CopyTest.java (original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/otm/CopyTest.java Wed Feb 22 13:08:13
2006
@@ -44,7 +44,7 @@
 	private OTMConnection _conn;
 	private Zoo m_zoo;
 	private TestClassA m_tca;
-	private BidirectionalAssociationObjectA m_baoa;
+	private BidirectionalAssociationTest.ObjectA m_baoa;
 
 	public CopyTest(String name)
 	{
@@ -132,25 +132,25 @@
 	 */
 	public void testMetadataCopy3() throws LockingException
 	{
-		BidirectionalAssociationObjectA a = generateBidirectional();
+		BidirectionalAssociationTest.ObjectA a = generateBidirectional();
 		internalTest3(m_mdcs, a);
 	}
 
 	public void testSerializeCopy3() throws LockingException
 	{
-		BidirectionalAssociationObjectA a = generateBidirectional();
+		BidirectionalAssociationTest.ObjectA a = generateBidirectional();
 		internalTest3(m_scs, a);
 	}
 
 	public void testReflectiveCopy3() throws LockingException
 	{
-		BidirectionalAssociationObjectA a = generateBidirectional();
+		BidirectionalAssociationTest.ObjectA a = generateBidirectional();
 		internalTest3(m_rcs, a);
 	}
 
-	private void internalTest3(ObjectCopyStrategy strategy, BidirectionalAssociationObjectA
a)
+	private void internalTest3(ObjectCopyStrategy strategy, BidirectionalAssociationTest.ObjectA
a)
 	{
-		BidirectionalAssociationObjectA copy = (BidirectionalAssociationObjectA) strategy.copy(a,
m_pb);
+		BidirectionalAssociationTest.ObjectA copy = (BidirectionalAssociationTest.ObjectA) strategy.copy(a,
m_pb);
 		assertTrue(a != copy);
 		assertTrue(copy.getPk().equals("abc123"));
 		assertTrue(copy.getRelatedB().getPk().equals("xyz987"));
@@ -163,7 +163,7 @@
 		assertTrue(zoo.getAnimals().size() == copy.getAnimals().size());
 	}
 
-	private BidirectionalAssociationObjectA generateBidirectional() throws LockingException
+	private BidirectionalAssociationTest.ObjectA generateBidirectional() throws LockingException
 	{
 		if (m_baoa != null)
 		{
@@ -173,16 +173,16 @@
 		{
 			Transaction tx = _kit.getTransaction(_conn);
 			tx.begin();
-			BidirectionalAssociationObjectA a = new BidirectionalAssociationObjectA();
+			BidirectionalAssociationTest.ObjectA a = new BidirectionalAssociationTest.ObjectA();
 			a.setPk("abc123");
 			Identity oid = _conn.getIdentity(a);
-			a = (BidirectionalAssociationObjectA) _conn.getObjectByIdentity(oid);
+			a = (BidirectionalAssociationTest.ObjectA) _conn.getObjectByIdentity(oid);
 			if (a == null)
 			{
-				a = new BidirectionalAssociationObjectA();
+				a = new BidirectionalAssociationTest.ObjectA();
 				a.setPk("abc123");
 				_conn.makePersistent(a);
-				BidirectionalAssociationObjectB b = new BidirectionalAssociationObjectB();
+				BidirectionalAssociationTest.ObjectB b = new BidirectionalAssociationTest.ObjectB();
 				b.setPk("xyz987");
 				_conn.makePersistent(b);
 				a.setRelatedB(b);

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/repository_junit.xml
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/repository_junit.xml?rev=379896&r1=379895&r2=379896&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/repository_junit.xml (original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/test/org/apache/ojb/repository_junit.xml Wed Feb 22
13:08:13 2006
@@ -2008,7 +2008,7 @@
 
 <!-- tests for bidirectional association -->
 <class-descriptor
-	class="org.apache.ojb.broker.BidirectionalAssociationObjectA"
+	class="org.apache.ojb.broker.BidirectionalAssociationTest$ObjectA"
 	table="BIDIR_A"
  >
      <field-descriptor
@@ -2025,14 +2025,14 @@
      />
     <reference-descriptor
         name="relatedB"
-        class-ref="org.apache.ojb.broker.BidirectionalAssociationObjectB"
+        class-ref="org.apache.ojb.broker.BidirectionalAssociationTest$ObjectB"
      >
         <foreignkey field-ref="fkToB"/>
      </reference-descriptor>
  </class-descriptor>
 
  <class-descriptor
-	class="org.apache.ojb.broker.BidirectionalAssociationObjectB"
+	class="org.apache.ojb.broker.BidirectionalAssociationTest$ObjectB"
 	table="BIDIR_B"
  >
      <field-descriptor
@@ -2049,12 +2049,62 @@
      />
     <reference-descriptor
         name="relatedA"
-        class-ref="org.apache.ojb.broker.BidirectionalAssociationObjectA"
+        class-ref="org.apache.ojb.broker.BidirectionalAssociationTest$ObjectA"
      >
         <foreignkey field-ref="fkToA"/>
      </reference-descriptor>
  </class-descriptor>
 
+<class-descriptor
+	class="org.apache.ojb.broker.BidirectionalAssociationTest$ObjectAA"
+	table="BIDIR_A"
+ >
+     <field-descriptor
+        name="pk"
+        column="pk"
+        jdbc-type="VARCHAR"
+        primarykey="true"
+        autoincrement="true"
+     />
+     <field-descriptor
+       name="fkToB"
+       column="fk_to_B"
+       jdbc-type="VARCHAR"
+     />
+    <reference-descriptor
+        name="relatedB"
+        class-ref="org.apache.ojb.broker.BidirectionalAssociationTest$ObjectBB"
+     >
+        <foreignkey field-ref="fkToB"/>
+     </reference-descriptor>
+ </class-descriptor>
+
+ <class-descriptor
+	class="org.apache.ojb.broker.BidirectionalAssociationTest$ObjectBB"
+	table="BIDIR_B"
+ >
+     <field-descriptor
+        name="pk"
+        column="pk"
+        jdbc-type="VARCHAR"
+        primarykey="true"
+        autoincrement="true"
+     />
+     <field-descriptor
+       name="fkToA"
+       column="fk_to_A"
+       jdbc-type="VARCHAR"
+     />
+    <reference-descriptor
+        name="relatedA"
+        class-ref="org.apache.ojb.broker.BidirectionalAssociationTest$ObjectAA"
+     >
+        <foreignkey field-ref="fkToA"/>
+     </reference-descriptor>
+ </class-descriptor>
+
+
+
 <!-- Definitions for extent org.apache.ojb.broker.InterfaceAnimal -->
    <class-descriptor class="org.apache.ojb.broker.InterfaceAnimal">
       <extent-class class-ref="org.apache.ojb.broker.Mammal" />
@@ -3087,6 +3137,9 @@
              jdbc-type="VARCHAR"
         />
     </class-descriptor>
+
+
+        
     <class-descriptor
        class="org.apache.ojb.broker.Owner"
        table="Owner"



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message