db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1436782 [2/2] - in /db/torque/torque4/trunk/torque-test: ./ src/main/schema/ src/test/java/org/apache/torque/ src/test/java/org/apache/torque/datatypes/ src/test/java/org/apache/torque/generated/dataobject/ src/test/java/org/apache/torque/...
Date Tue, 22 Jan 2013 07:51:32 GMT
Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BooleanIntCharTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BooleanIntCharTest.java?rev=1436782&r1=1436781&r2=1436782&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BooleanIntCharTest.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/BooleanIntCharTest.java Tue Jan 22 07:51:31 2013
@@ -9,8 +9,8 @@ import org.apache.torque.TorqueException
 import org.apache.torque.criteria.Criteria;
 import org.apache.torque.criteria.Criterion;
 import org.apache.torque.om.StringKey;
-import org.apache.torque.test.dbobject.BintBcharValue;
-import org.apache.torque.test.peer.BintBcharValuePeer;
+import org.apache.torque.test.dbobject.BintBcharType;
+import org.apache.torque.test.peer.BintBcharTypePeer;
 import org.apache.torque.util.ColumnValues;
 import org.apache.torque.util.JdbcTypedValue;
 
@@ -48,8 +48,8 @@ public class BooleanIntCharTest extends 
     {
         fillTables();
 
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("t1"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("t1"));
         assertEquals(true, bc.getBintValue());
         assertEquals(true, bc.getBcharValue());
         assertEquals(Boolean.TRUE, bc.getBintObjectValue());
@@ -65,8 +65,8 @@ public class BooleanIntCharTest extends 
     {
         fillTables();
 
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("f1"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("f1"));
         assertEquals(false, bc.getBintValue());
         assertEquals(false, bc.getBcharValue());
         assertEquals(Boolean.FALSE, bc.getBintObjectValue());
@@ -82,8 +82,8 @@ public class BooleanIntCharTest extends 
     {
         fillTables();
 
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("null"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("null"));
         assertEquals(null, bc.getBintObjectValue());
         assertEquals(null, bc.getBcharObjectValue());
     }
@@ -97,7 +97,7 @@ public class BooleanIntCharTest extends 
     {
         // prepare
         fillTables();
-        BintBcharValue bc = new BintBcharValue();
+        BintBcharType bc = new BintBcharType();
         bc.setPrimaryKey("new");
         bc.setBintValue(true);
         bc.setBcharValue(true);
@@ -108,7 +108,7 @@ public class BooleanIntCharTest extends 
         bc.save();
 
         // verify
-        bc = BintBcharValuePeer.retrieveByPK(new StringKey("new"));
+        bc = BintBcharTypePeer.retrieveByPK(new StringKey("new"));
         assertEquals(true, bc.getBintValue());
         assertEquals(true, bc.getBcharValue());
         assertEquals(Boolean.TRUE, bc.getBintObjectValue());
@@ -124,7 +124,7 @@ public class BooleanIntCharTest extends 
     {
         // prepare
         fillTables();
-        BintBcharValue bc = new BintBcharValue();
+        BintBcharType bc = new BintBcharType();
         bc.setPrimaryKey("new");
         bc.setBintValue(false);
         bc.setBcharValue(false);
@@ -135,7 +135,7 @@ public class BooleanIntCharTest extends 
         bc.save();
 
         // verify
-        bc = BintBcharValuePeer.retrieveByPK(new StringKey("new"));
+        bc = BintBcharTypePeer.retrieveByPK(new StringKey("new"));
         assertEquals(false, bc.getBintValue());
         assertEquals(false, bc.getBcharValue());
         assertEquals(Boolean.FALSE, bc.getBintObjectValue());
@@ -151,7 +151,7 @@ public class BooleanIntCharTest extends 
     {
         // prepare
         fillTables();
-        BintBcharValue bc = new BintBcharValue();
+        BintBcharType bc = new BintBcharType();
         bc.setPrimaryKey("new");
         bc.setBintObjectValue(null);
         bc.setBcharObjectValue(null);
@@ -160,7 +160,7 @@ public class BooleanIntCharTest extends 
         bc.save();
 
         // verify
-        bc = BintBcharValuePeer.retrieveByPK(new StringKey("new"));
+        bc = BintBcharTypePeer.retrieveByPK(new StringKey("new"));
         assertEquals(null, bc.getBintObjectValue());
         assertEquals(null, bc.getBcharObjectValue());
     }
@@ -174,8 +174,8 @@ public class BooleanIntCharTest extends 
     {
         // prepare
         fillTables();
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("f1"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("f1"));
         bc.setBintValue(true);
         bc.setBcharValue(true);
         bc.setBintObjectValue(Boolean.TRUE);
@@ -185,7 +185,7 @@ public class BooleanIntCharTest extends 
         bc.save();
 
         // verify
-        bc = BintBcharValuePeer.retrieveByPK(new StringKey("f1"));
+        bc = BintBcharTypePeer.retrieveByPK(new StringKey("f1"));
         assertEquals(true, bc.getBintValue());
         assertEquals(true, bc.getBcharValue());
         assertEquals(Boolean.TRUE, bc.getBintObjectValue());
@@ -201,8 +201,8 @@ public class BooleanIntCharTest extends 
     {
         // prepare
         fillTables();
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("t1"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("t1"));
         bc.setBintValue(false);
         bc.setBcharValue(false);
         bc.setBintObjectValue(Boolean.FALSE);
@@ -212,7 +212,7 @@ public class BooleanIntCharTest extends 
         bc.save();
 
         // verify
-        bc = BintBcharValuePeer.retrieveByPK(new StringKey("t1"));
+        bc = BintBcharTypePeer.retrieveByPK(new StringKey("t1"));
         assertEquals(false, bc.getBintValue());
         assertEquals(false, bc.getBcharValue());
         assertEquals(Boolean.FALSE, bc.getBintObjectValue());
@@ -228,8 +228,8 @@ public class BooleanIntCharTest extends 
     {
         // prepare
         fillTables();
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("t1"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("t1"));
         bc.setBintObjectValue(null);
         bc.setBcharObjectValue(null);
 
@@ -237,7 +237,7 @@ public class BooleanIntCharTest extends 
         bc.save();
 
         // verify
-        bc = BintBcharValuePeer.retrieveByPK(new StringKey("t1"));
+        bc = BintBcharTypePeer.retrieveByPK(new StringKey("t1"));
         assertEquals(null, bc.getBintObjectValue());
         assertEquals(null, bc.getBcharObjectValue());
     }
@@ -253,17 +253,15 @@ public class BooleanIntCharTest extends 
         fillTables();
 
         Criteria criteria = new Criteria()
-                .where(BintBcharValuePeer.BCHAR_VALUE, new Boolean(true))
-                .and(BintBcharValuePeer.BINT_VALUE, new Boolean(true))
-                .and(BintBcharValuePeer.BCHAR_OBJECT_VALUE, new Boolean(true))
-                .and(BintBcharValuePeer.BINT_OBJECT_VALUE, new Boolean(true));
-        List<BintBcharValue> selectedList
-            = BintBcharValuePeer.doSelect(criteria);
+                .where(BintBcharTypePeer.BCHAR_VALUE, new Boolean(true))
+                .and(BintBcharTypePeer.BINT_VALUE, new Boolean(true))
+                .and(BintBcharTypePeer.BCHAR_OBJECT_VALUE, new Boolean(true))
+                .and(BintBcharTypePeer.BINT_OBJECT_VALUE, new Boolean(true));
+        List<BintBcharType> selectedList
+            = BintBcharTypePeer.doSelect(criteria);
         assertEquals(1, selectedList.size());
-        BintBcharValue bintBcharValue = selectedList.get(0);
-        assertTrue("Primary key of data set should be t1 but is "
-                + bintBcharValue.getId(),
-                "t1".equals(bintBcharValue.getId()));
+        BintBcharType bintBcharType = selectedList.get(0);
+        assertEquals("t1", bintBcharType.getId());
     }
 
     /**
@@ -277,17 +275,15 @@ public class BooleanIntCharTest extends 
         fillTables();
 
         Criteria criteria = new Criteria()
-                .where(BintBcharValuePeer.BCHAR_VALUE, new Boolean(false))
-                .and(BintBcharValuePeer.BINT_VALUE, new Boolean(false))
-                .and(BintBcharValuePeer.BCHAR_OBJECT_VALUE, new Boolean(false))
-                .and(BintBcharValuePeer.BINT_OBJECT_VALUE, new Boolean(false));
-        List<BintBcharValue> selectedList
-                = BintBcharValuePeer.doSelect(criteria);
+                .where(BintBcharTypePeer.BCHAR_VALUE, new Boolean(false))
+                .and(BintBcharTypePeer.BINT_VALUE, new Boolean(false))
+                .and(BintBcharTypePeer.BCHAR_OBJECT_VALUE, new Boolean(false))
+                .and(BintBcharTypePeer.BINT_OBJECT_VALUE, new Boolean(false));
+        List<BintBcharType> selectedList
+                = BintBcharTypePeer.doSelect(criteria);
         assertEquals(1, selectedList.size());
-        BintBcharValue bintBcharValue = selectedList.get(0);
-        assertTrue("Primary key of data set should be f1 but is "
-                + bintBcharValue.getId(),
-                "f1".equals(bintBcharValue.getId()));
+        BintBcharType bintBcharType = selectedList.get(0);
+        assertEquals("f1", bintBcharType.getId());
     }
 
     /**
@@ -302,15 +298,13 @@ public class BooleanIntCharTest extends 
         fillTables();
 
         Criteria criteria = new Criteria()
-                .where(BintBcharValuePeer.BCHAR_OBJECT_VALUE, null)
-                .and(BintBcharValuePeer.BINT_OBJECT_VALUE, null);
-        List<BintBcharValue> selectedList
-                = BintBcharValuePeer.doSelect(criteria);
+                .where(BintBcharTypePeer.BCHAR_OBJECT_VALUE, null)
+                .and(BintBcharTypePeer.BINT_OBJECT_VALUE, null);
+        List<BintBcharType> selectedList
+                = BintBcharTypePeer.doSelect(criteria);
         assertEquals(1, selectedList.size());
-        BintBcharValue bintBcharValue = selectedList.get(0);
-        assertTrue("Primary key of data set should be null but is "
-                + bintBcharValue.getId(),
-                "null".equals(bintBcharValue.getId()));
+        BintBcharType bintBcharType = selectedList.get(0);
+        assertEquals("null", bintBcharType.getId());
     }
 
     /**
@@ -324,10 +318,10 @@ public class BooleanIntCharTest extends 
         fillTables();
 
         Criteria criteria = new Criteria()
-                .and(BintBcharValuePeer.BCHAR_VALUE, null)
-                .and(BintBcharValuePeer.BINT_VALUE, null);
-        List<BintBcharValue> selectedList
-                = BintBcharValuePeer.doSelect(criteria);
+                .and(BintBcharTypePeer.BCHAR_VALUE, null)
+                .and(BintBcharTypePeer.BINT_VALUE, null);
+        List<BintBcharType> selectedList
+                = BintBcharTypePeer.doSelect(criteria);
         assertTrue("Should have read 0 dataset with both values false "
                 + "but read " + selectedList.size(),
                 selectedList.size() == 0);
@@ -344,23 +338,21 @@ public class BooleanIntCharTest extends 
         fillTables();
 
         Criteria criteria = new Criteria();
-        criteria.addAlias("bc", BintBcharValuePeer.TABLE_NAME);
+        criteria.addAlias("bc", BintBcharTypePeer.TABLE_NAME);
         criteria.addJoin(
-                BintBcharValuePeer.ID,
+                BintBcharTypePeer.ID,
                 new ColumnImpl("bc.id"));
-        criteria.where(new ColumnImpl("bc.bint_value"), new Boolean(false))
-                .and(new ColumnImpl("bc.bchar_value"), new Boolean(false))
-                .and(new ColumnImpl("bc.bint_object_value"), new Boolean(false))
-                .and(new ColumnImpl("bc.bchar_object_value"), new Boolean(false));
-        List<BintBcharValue> selectedList
-                = BintBcharValuePeer.doSelect(criteria);
+        criteria.where(new ColumnImpl("bc.BINT_VALUE"), new Boolean(false))
+                .and(new ColumnImpl("bc.BCHAR_VALUE"), new Boolean(false))
+                .and(new ColumnImpl("bc.BINT_OBJECT_VALUE"), new Boolean(false))
+                .and(new ColumnImpl("bc.BCHAR_OBJECT_VALUE"), new Boolean(false));
+        List<BintBcharType> selectedList
+                = BintBcharTypePeer.doSelect(criteria);
         assertTrue("Should have read 1 dataset with both values false "
                 + "but read " + selectedList.size(),
                 selectedList.size() == 1);
-        BintBcharValue bintBcharValue = selectedList.get(0);
-        assertTrue("Primary key of data set should be f1 but is "
-                + bintBcharValue.getId(),
-                "f1".equals(bintBcharValue.getId()));
+        BintBcharType bintBcharType = selectedList.get(0);
+        assertEquals("f1", bintBcharType.getId());
     }
 
     /**
@@ -377,16 +369,16 @@ public class BooleanIntCharTest extends 
         // replaceBooleans
         Criteria criteria = new Criteria();
         Criterion criterion1 = new Criterion(
-                BintBcharValuePeer.BCHAR_VALUE,
+                BintBcharTypePeer.BCHAR_VALUE,
                 Boolean.FALSE,
                 Criteria.EQUAL);
         Criterion criterion2 = new Criterion(
-                BintBcharValuePeer.BCHAR_VALUE,
+                BintBcharTypePeer.BCHAR_VALUE,
                 null,
                 Criteria.ISNULL);
         criteria.where(criterion1.and(criterion2));
-        List<BintBcharValue> selectedList
-                = BintBcharValuePeer.doSelect(criteria);
+        List<BintBcharType> selectedList
+                = BintBcharTypePeer.doSelect(criteria);
         // List should be empty, because and creates unfulfillable condition
         // If BasePeer.correctBooleans() replaces Criterion wrongly,
         // then we get entries in the list.
@@ -407,20 +399,20 @@ public class BooleanIntCharTest extends 
 
         Criteria criteria = new Criteria();
         Criterion criterion1 = new Criterion(
-                BintBcharValuePeer.BCHAR_VALUE,
+                BintBcharTypePeer.BCHAR_VALUE,
                 null,
                 Criteria.ISNULL);
         Criterion criterion2 = new Criterion(
-                BintBcharValuePeer.BCHAR_VALUE,
+                BintBcharTypePeer.BCHAR_VALUE,
                 Boolean.FALSE,
                 Criteria.EQUAL);
         criteria.where(criterion1.or(criterion2));
-        List<BintBcharValue> selectedList
-                = BintBcharValuePeer.doSelect(criteria);
+        List<BintBcharType> selectedList
+                = BintBcharTypePeer.doSelect(criteria);
         assertTrue("Should have read 1 dataset complex Criteria "
                 + "but read " + selectedList.size(),
                 selectedList.size() == 1);
-        BintBcharValue selected = selectedList.get(0);
+        BintBcharType selected = selectedList.get(0);
         // use trim() for testkey because some databases will return the
         // testkey filled up with blanks, as it is defined as char(10)
         assertTrue("Primary key of data set should be f1 but is "
@@ -437,10 +429,10 @@ public class BooleanIntCharTest extends 
     {
         // check whether booleans are replaced with unqualified columns
         Criteria criteria = new Criteria()
-            .where(new ColumnImpl("bint_value"), true)
-            .and(new ColumnImpl("bchar_value"), true);
+            .where(new ColumnImpl("BINT_VALUE"), true)
+            .and(new ColumnImpl("BCHAR_VALUE"), true);
 
-        BintBcharValuePeer.correctBooleans(criteria);
+        BintBcharTypePeer.correctBooleans(criteria);
 
         Criterion criterionInt
                 = criteria.getTopLevelCriterion().getParts().get(0);
@@ -468,7 +460,7 @@ public class BooleanIntCharTest extends 
             .where("BooleanCheck.bint_value", true)
             .and("BooleanCheck.bchar_value", true);
 
-        BintBcharValuePeer.correctBooleans(criteria);
+        BintBcharTypePeer.correctBooleans(criteria);
 
         Criterion criterionBool1
                 = criteria.getTopLevelCriterion().getParts().get(0);
@@ -496,27 +488,27 @@ public class BooleanIntCharTest extends 
         fillTables();
         ColumnValues columnValues = new ColumnValues();
         columnValues.put(
-                BintBcharValuePeer.ID,
+                BintBcharTypePeer.ID,
                 new JdbcTypedValue("new", Types.VARCHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_VALUE,
+                BintBcharTypePeer.BINT_VALUE,
                 new JdbcTypedValue(Boolean.TRUE, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_VALUE,
+                BintBcharTypePeer.BCHAR_VALUE,
                 new JdbcTypedValue(Boolean.TRUE, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BINT_OBJECT_VALUE,
+                BintBcharTypePeer.BINT_OBJECT_VALUE,
                 new JdbcTypedValue(Boolean.TRUE, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_OBJECT_VALUE,
+                BintBcharTypePeer.BCHAR_OBJECT_VALUE,
                 new JdbcTypedValue(Boolean.TRUE, Types.BIT));
 
         // execute
-        BintBcharValuePeer.doInsert(columnValues);
+        BintBcharTypePeer.doInsert(columnValues);
 
         // verify
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("new"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("new"));
         assertEquals(true, bc.getBintValue());
         assertEquals(true, bc.getBcharValue());
         assertEquals(Boolean.TRUE, bc.getBintObjectValue());
@@ -534,27 +526,27 @@ public class BooleanIntCharTest extends 
         fillTables();
         ColumnValues columnValues = new ColumnValues();
         columnValues.put(
-                BintBcharValuePeer.ID,
+                BintBcharTypePeer.ID,
                 new JdbcTypedValue("new", Types.VARCHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_VALUE,
+                BintBcharTypePeer.BINT_VALUE,
                 new JdbcTypedValue(1, Types.INTEGER));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_VALUE,
+                BintBcharTypePeer.BCHAR_VALUE,
                 new JdbcTypedValue("Y", Types.CHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_OBJECT_VALUE,
+                BintBcharTypePeer.BINT_OBJECT_VALUE,
                 new JdbcTypedValue(1, Types.INTEGER));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_OBJECT_VALUE,
+                BintBcharTypePeer.BCHAR_OBJECT_VALUE,
                 new JdbcTypedValue("Y", Types.CHAR));
 
         // execute
-        BintBcharValuePeer.doInsert(columnValues);
+        BintBcharTypePeer.doInsert(columnValues);
 
         // verify
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("new"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("new"));
         assertEquals(true, bc.getBintValue());
         assertEquals(true, bc.getBcharValue());
         assertEquals(Boolean.TRUE, bc.getBintObjectValue());
@@ -572,27 +564,27 @@ public class BooleanIntCharTest extends 
         fillTables();
         ColumnValues columnValues = new ColumnValues();
         columnValues.put(
-                BintBcharValuePeer.ID,
+                BintBcharTypePeer.ID,
                 new JdbcTypedValue("new", Types.VARCHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_VALUE,
+                BintBcharTypePeer.BINT_VALUE,
                 new JdbcTypedValue(Boolean.FALSE, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_VALUE,
+                BintBcharTypePeer.BCHAR_VALUE,
                 new JdbcTypedValue(Boolean.FALSE, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BINT_OBJECT_VALUE,
+                BintBcharTypePeer.BINT_OBJECT_VALUE,
                 new JdbcTypedValue(Boolean.FALSE, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_OBJECT_VALUE,
+                BintBcharTypePeer.BCHAR_OBJECT_VALUE,
                 new JdbcTypedValue(Boolean.FALSE, Types.BIT));
 
         // execute
-        BintBcharValuePeer.doInsert(columnValues);
+        BintBcharTypePeer.doInsert(columnValues);
 
         // verify
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("new"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("new"));
         assertEquals(false, bc.getBintValue());
         assertEquals(false, bc.getBcharValue());
         assertEquals(Boolean.FALSE, bc.getBintObjectValue());
@@ -610,27 +602,27 @@ public class BooleanIntCharTest extends 
         fillTables();
         ColumnValues columnValues = new ColumnValues();
         columnValues.put(
-                BintBcharValuePeer.ID,
+                BintBcharTypePeer.ID,
                 new JdbcTypedValue("new", Types.VARCHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_VALUE,
+                BintBcharTypePeer.BINT_VALUE,
                 new JdbcTypedValue(0, Types.INTEGER));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_VALUE,
+                BintBcharTypePeer.BCHAR_VALUE,
                 new JdbcTypedValue("N", Types.CHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_OBJECT_VALUE,
+                BintBcharTypePeer.BINT_OBJECT_VALUE,
                 new JdbcTypedValue(0, Types.INTEGER));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_OBJECT_VALUE,
+                BintBcharTypePeer.BCHAR_OBJECT_VALUE,
                 new JdbcTypedValue("N", Types.CHAR));
 
         // execute
-        BintBcharValuePeer.doInsert(columnValues);
+        BintBcharTypePeer.doInsert(columnValues);
 
         // verify
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("new"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("new"));
         assertEquals(false, bc.getBintValue());
         assertEquals(false, bc.getBcharValue());
         assertEquals(Boolean.FALSE, bc.getBintObjectValue());
@@ -648,27 +640,27 @@ public class BooleanIntCharTest extends 
         fillTables();
         ColumnValues columnValues = new ColumnValues();
         columnValues.put(
-                BintBcharValuePeer.ID,
+                BintBcharTypePeer.ID,
                 new JdbcTypedValue("new", Types.VARCHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_VALUE,
+                BintBcharTypePeer.BINT_VALUE,
                 new JdbcTypedValue(true, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_VALUE,
+                BintBcharTypePeer.BCHAR_VALUE,
                 new JdbcTypedValue(false, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BINT_OBJECT_VALUE,
+                BintBcharTypePeer.BINT_OBJECT_VALUE,
                 new JdbcTypedValue(null, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_OBJECT_VALUE,
+                BintBcharTypePeer.BCHAR_OBJECT_VALUE,
                 new JdbcTypedValue(null, Types.BIT));
 
         // execute
-        BintBcharValuePeer.doInsert(columnValues);
+        BintBcharTypePeer.doInsert(columnValues);
 
         // verify
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("new"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("new"));
         assertEquals(null, bc.getBintObjectValue());
         assertEquals(null, bc.getBcharObjectValue());
     }
@@ -684,27 +676,27 @@ public class BooleanIntCharTest extends 
         fillTables();
         ColumnValues columnValues = new ColumnValues();
         columnValues.put(
-                BintBcharValuePeer.ID,
+                BintBcharTypePeer.ID,
                 new JdbcTypedValue("new", Types.VARCHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_VALUE,
+                BintBcharTypePeer.BINT_VALUE,
                 new JdbcTypedValue(0, Types.INTEGER));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_VALUE,
+                BintBcharTypePeer.BCHAR_VALUE,
                 new JdbcTypedValue("N", Types.CHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_OBJECT_VALUE,
+                BintBcharTypePeer.BINT_OBJECT_VALUE,
                 new JdbcTypedValue(null, Types.INTEGER));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_OBJECT_VALUE,
+                BintBcharTypePeer.BCHAR_OBJECT_VALUE,
                 new JdbcTypedValue(null, Types.CHAR));
 
         // execute
-        BintBcharValuePeer.doInsert(columnValues);
+        BintBcharTypePeer.doInsert(columnValues);
 
         // verify
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("new"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("new"));
         assertEquals(null, bc.getBintObjectValue());
         assertEquals(null, bc.getBcharObjectValue());
     }
@@ -720,27 +712,27 @@ public class BooleanIntCharTest extends 
         fillTables();
         ColumnValues columnValues = new ColumnValues();
         columnValues.put(
-                BintBcharValuePeer.ID,
+                BintBcharTypePeer.ID,
                 new JdbcTypedValue("f1", Types.VARCHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_VALUE,
+                BintBcharTypePeer.BINT_VALUE,
                 new JdbcTypedValue(Boolean.TRUE, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_VALUE,
+                BintBcharTypePeer.BCHAR_VALUE,
                 new JdbcTypedValue(Boolean.TRUE, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BINT_OBJECT_VALUE,
+                BintBcharTypePeer.BINT_OBJECT_VALUE,
                 new JdbcTypedValue(Boolean.TRUE, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_OBJECT_VALUE,
+                BintBcharTypePeer.BCHAR_OBJECT_VALUE,
                 new JdbcTypedValue(Boolean.TRUE, Types.BIT));
 
         // execute
-        BintBcharValuePeer.doUpdate(columnValues);
+        BintBcharTypePeer.doUpdate(columnValues);
 
         // verify
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("f1"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("f1"));
         assertEquals(true, bc.getBintValue());
         assertEquals(true, bc.getBcharValue());
         assertEquals(Boolean.TRUE, bc.getBintObjectValue());
@@ -758,27 +750,27 @@ public class BooleanIntCharTest extends 
         fillTables();
         ColumnValues columnValues = new ColumnValues();
         columnValues.put(
-                BintBcharValuePeer.ID,
+                BintBcharTypePeer.ID,
                 new JdbcTypedValue("f1", Types.VARCHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_VALUE,
+                BintBcharTypePeer.BINT_VALUE,
                 new JdbcTypedValue(1, Types.INTEGER));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_VALUE,
+                BintBcharTypePeer.BCHAR_VALUE,
                 new JdbcTypedValue("Y", Types.CHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_OBJECT_VALUE,
+                BintBcharTypePeer.BINT_OBJECT_VALUE,
                 new JdbcTypedValue(1, Types.INTEGER));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_OBJECT_VALUE,
+                BintBcharTypePeer.BCHAR_OBJECT_VALUE,
                 new JdbcTypedValue("Y", Types.CHAR));
 
         // execute
-        BintBcharValuePeer.doUpdate(columnValues);
+        BintBcharTypePeer.doUpdate(columnValues);
 
         // verify
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("f1"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("f1"));
         assertEquals(true, bc.getBintValue());
         assertEquals(true, bc.getBcharValue());
         assertEquals(Boolean.TRUE, bc.getBintObjectValue());
@@ -796,27 +788,27 @@ public class BooleanIntCharTest extends 
         fillTables();
         ColumnValues columnValues = new ColumnValues();
         columnValues.put(
-                BintBcharValuePeer.ID,
+                BintBcharTypePeer.ID,
                 new JdbcTypedValue("t1", Types.VARCHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_VALUE,
+                BintBcharTypePeer.BINT_VALUE,
                 new JdbcTypedValue(Boolean.FALSE, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_VALUE,
+                BintBcharTypePeer.BCHAR_VALUE,
                 new JdbcTypedValue(Boolean.FALSE, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BINT_OBJECT_VALUE,
+                BintBcharTypePeer.BINT_OBJECT_VALUE,
                 new JdbcTypedValue(Boolean.FALSE, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_OBJECT_VALUE,
+                BintBcharTypePeer.BCHAR_OBJECT_VALUE,
                 new JdbcTypedValue(Boolean.FALSE, Types.BIT));
 
         // execute
-        BintBcharValuePeer.doUpdate(columnValues);
+        BintBcharTypePeer.doUpdate(columnValues);
 
         // verify
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("t1"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("t1"));
         assertEquals(false, bc.getBintValue());
         assertEquals(false, bc.getBcharValue());
         assertEquals(Boolean.FALSE, bc.getBintObjectValue());
@@ -834,27 +826,27 @@ public class BooleanIntCharTest extends 
         fillTables();
         ColumnValues columnValues = new ColumnValues();
         columnValues.put(
-                BintBcharValuePeer.ID,
+                BintBcharTypePeer.ID,
                 new JdbcTypedValue("t1", Types.VARCHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_VALUE,
+                BintBcharTypePeer.BINT_VALUE,
                 new JdbcTypedValue(0, Types.INTEGER));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_VALUE,
+                BintBcharTypePeer.BCHAR_VALUE,
                 new JdbcTypedValue("N", Types.CHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_OBJECT_VALUE,
+                BintBcharTypePeer.BINT_OBJECT_VALUE,
                 new JdbcTypedValue(0, Types.INTEGER));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_OBJECT_VALUE,
+                BintBcharTypePeer.BCHAR_OBJECT_VALUE,
                 new JdbcTypedValue("N", Types.CHAR));
 
         // execute
-        BintBcharValuePeer.doUpdate(columnValues);
+        BintBcharTypePeer.doUpdate(columnValues);
 
         // verify
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("t1"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("t1"));
         assertEquals(false, bc.getBintValue());
         assertEquals(false, bc.getBcharValue());
         assertEquals(Boolean.FALSE, bc.getBintObjectValue());
@@ -872,21 +864,21 @@ public class BooleanIntCharTest extends 
         fillTables();
         ColumnValues columnValues = new ColumnValues();
         columnValues.put(
-                BintBcharValuePeer.ID,
+                BintBcharTypePeer.ID,
                 new JdbcTypedValue("t1", Types.VARCHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_OBJECT_VALUE,
+                BintBcharTypePeer.BINT_OBJECT_VALUE,
                 new JdbcTypedValue(null, Types.BIT));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_OBJECT_VALUE,
+                BintBcharTypePeer.BCHAR_OBJECT_VALUE,
                 new JdbcTypedValue(null, Types.BIT));
 
         // execute
-        BintBcharValuePeer.doUpdate(columnValues);
+        BintBcharTypePeer.doUpdate(columnValues);
 
         // verify
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("t1"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("t1"));
         assertEquals(null, bc.getBintObjectValue());
         assertEquals(null, bc.getBcharObjectValue());
     }
@@ -902,21 +894,21 @@ public class BooleanIntCharTest extends 
         fillTables();
         ColumnValues columnValues = new ColumnValues();
         columnValues.put(
-                BintBcharValuePeer.ID,
+                BintBcharTypePeer.ID,
                 new JdbcTypedValue("t1", Types.VARCHAR));
         columnValues.put(
-                BintBcharValuePeer.BINT_OBJECT_VALUE,
+                BintBcharTypePeer.BINT_OBJECT_VALUE,
                 new JdbcTypedValue(null, Types.NUMERIC));
         columnValues.put(
-                BintBcharValuePeer.BCHAR_OBJECT_VALUE,
+                BintBcharTypePeer.BCHAR_OBJECT_VALUE,
                 new JdbcTypedValue(null, Types.CHAR));
 
         // execute
-        BintBcharValuePeer.doUpdate(columnValues);
+        BintBcharTypePeer.doUpdate(columnValues);
 
         // verify
-        BintBcharValue bc
-                = BintBcharValuePeer.retrieveByPK(new StringKey("t1"));
+        BintBcharType bc
+                = BintBcharTypePeer.retrieveByPK(new StringKey("t1"));
         assertEquals(null, bc.getBintObjectValue());
         assertEquals(null, bc.getBcharObjectValue());
     }
@@ -928,23 +920,23 @@ public class BooleanIntCharTest extends 
     private void fillTables() throws TorqueException
     {
         Criteria criteria = new Criteria();
-        BintBcharValuePeer.doDelete(criteria);
+        BintBcharTypePeer.doDelete(criteria);
 
-        BintBcharValue bc = new BintBcharValue();
+        BintBcharType bc = new BintBcharType();
         bc.setId("t1");
         bc.setBintValue(true);
         bc.setBcharValue(true);
         bc.setBintObjectValue(Boolean.TRUE);
         bc.setBcharObjectValue(Boolean.TRUE);
         bc.save();
-        bc = new BintBcharValue();
+        bc = new BintBcharType();
         bc.setId("f1");
         bc.setBintValue(false);
         bc.setBcharValue(false);
         bc.setBintObjectValue(Boolean.FALSE);
         bc.setBcharObjectValue(Boolean.FALSE);
         bc.save();
-        bc = new BintBcharValue();
+        bc = new BintBcharType();
         bc.setId("null");
         bc.setBintValue(false);
         bc.setBcharValue(true);

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/dataobject/SaveTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/dataobject/SaveTest.java?rev=1436782&r1=1436781&r2=1436782&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/dataobject/SaveTest.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/dataobject/SaveTest.java Tue Jan 22 07:51:31 2013
@@ -24,16 +24,17 @@ import java.util.List;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.torque.BaseDatabaseTestCase;
+import org.apache.torque.ForeignKeySchemaData;
 import org.apache.torque.TorqueException;
 import org.apache.torque.adapter.MssqlAdapter;
 import org.apache.torque.criteria.Criteria;
 import org.apache.torque.test.dbobject.Author;
 import org.apache.torque.test.dbobject.Book;
-import org.apache.torque.test.dbobject.IntegerObjectPk;
 import org.apache.torque.test.dbobject.Nopk;
+import org.apache.torque.test.dbobject.OIntegerPk;
 import org.apache.torque.test.peer.AuthorPeer;
-import org.apache.torque.test.peer.IntegerObjectPkPeer;
 import org.apache.torque.test.peer.NopkPeer;
+import org.apache.torque.test.peer.OIntegerPkPeer;
 import org.apache.torque.util.CountHelper;
 
 /**
@@ -80,26 +81,25 @@ public class SaveTest extends BaseDataba
             return;
         }
         // prepare
-        Criteria criteria = new Criteria();
-        IntegerObjectPkPeer.doDelete(criteria);
+        ForeignKeySchemaData.clearTablesInDatabase();
 
-        IntegerObjectPk integerObjectPk = new IntegerObjectPk();
-        integerObjectPk.setId(3001);
+        OIntegerPk oIntegerPk = new OIntegerPk();
+        oIntegerPk.setId(3001);
 
         // execute
-        integerObjectPk.save();
+        oIntegerPk.save();
 
         // verify
-        assertEquals(new Integer(3001), integerObjectPk.getId());
+        assertEquals(new Integer(3001), oIntegerPk.getId());
 
-        criteria = new Criteria().where(IntegerObjectPkPeer.ID, 3001);
-        List<IntegerObjectPk> integerObjectPkList
-                = IntegerObjectPkPeer.doSelect(criteria);
+        Criteria criteria = new Criteria().where(OIntegerPkPeer.ID, 3001);
+        List<OIntegerPk> integerObjectPkList
+                = OIntegerPkPeer.doSelect(criteria);
         assertEquals(1, integerObjectPkList.size());
 
         assertEquals(
                 1,
-                new CountHelper().count(IntegerObjectPkPeer.getTableMap()));
+                new CountHelper().count(OIntegerPkPeer.getTableMap()));
     }
 
     /**

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DateTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DateTest.java?rev=1436782&r1=1436781&r2=1436782&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DateTest.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/DateTest.java Tue Jan 22 07:51:31 2013
@@ -34,8 +34,8 @@ import org.apache.torque.adapter.MssqlAd
 import org.apache.torque.adapter.MysqlAdapter;
 import org.apache.torque.adapter.OracleAdapter;
 import org.apache.torque.criteria.Criteria;
-import org.apache.torque.test.dbobject.DateTimeTimestamp;
-import org.apache.torque.test.peer.DateTimeTimestampPeer;
+import org.apache.torque.test.dbobject.DateTimeTimestampType;
+import org.apache.torque.test.peer.DateTimeTimestampTypePeer;
 
 /**
  * Tests behavior of date, time and timestamp fields.
@@ -64,7 +64,7 @@ public class DateTest extends BaseDataba
         cleanDateTimeTimestampTable();
 
         // insert new DateTest object to db
-        DateTimeTimestamp dateTimeTimestamp = new DateTimeTimestamp();
+        DateTimeTimestampType dateTimeTimestamp = new DateTimeTimestampType();
         Date now = new Date();
         dateTimeTimestamp.setDateValue(now);
         dateTimeTimestamp.setTimeValue(now);
@@ -72,7 +72,7 @@ public class DateTest extends BaseDataba
         dateTimeTimestamp.save();
 
         // reload dateTest from db
-        DateTimeTimestamp loaded = DateTimeTimestampPeer.retrieveByPK(
+        DateTimeTimestampType loaded = DateTimeTimestampTypePeer.retrieveByPK(
                 dateTimeTimestamp.getPrimaryKey());
 
         // calculate expected value
@@ -109,7 +109,7 @@ public class DateTest extends BaseDataba
         cleanDateTimeTimestampTable();
 
         // insert new DateTest object to db
-        DateTimeTimestamp dateTimeTimestamp = new DateTimeTimestamp();
+        DateTimeTimestampType dateTimeTimestamp = new DateTimeTimestampType();
         Date now = new Date();
         dateTimeTimestamp.setDateValue(now);
         dateTimeTimestamp.setTimeValue(now);
@@ -117,7 +117,7 @@ public class DateTest extends BaseDataba
         dateTimeTimestamp.save();
 
         // reload dateTest from db
-        DateTimeTimestamp loaded = DateTimeTimestampPeer.retrieveByPK(
+        DateTimeTimestampType loaded = DateTimeTimestampTypePeer.retrieveByPK(
                 dateTimeTimestamp.getPrimaryKey());
 
         // calculate expected value
@@ -154,7 +154,7 @@ public class DateTest extends BaseDataba
         cleanDateTimeTimestampTable();
 
         // insert new DateTest object to db
-        DateTimeTimestamp dateTimeTimestamp = new DateTimeTimestamp();
+        DateTimeTimestampType dateTimeTimestamp = new DateTimeTimestampType();
         Date now = new Date();
         dateTimeTimestamp.setDateValue(now);
         dateTimeTimestamp.setTimeValue(now);
@@ -162,7 +162,7 @@ public class DateTest extends BaseDataba
         dateTimeTimestamp.save();
 
         // reload dateTest from db
-        DateTimeTimestamp loaded = DateTimeTimestampPeer.retrieveByPK(
+        DateTimeTimestampType loaded = DateTimeTimestampTypePeer.retrieveByPK(
                 dateTimeTimestamp.getPrimaryKey());
 
         // calculate expected value
@@ -199,11 +199,11 @@ public class DateTest extends BaseDataba
         fillDateTimeTimestampWithPastEntry();
 
         Criteria criteria = new Criteria().where(
-                DateTimeTimestampPeer.DATE_VALUE,
+                DateTimeTimestampTypePeer.DATE_VALUE,
                 Criteria.CURRENT_DATE,
                 Criteria.GREATER_EQUAL);
-        List<DateTimeTimestamp> result
-                = DateTimeTimestampPeer.doSelect(criteria);
+        List<DateTimeTimestampType> result
+                = DateTimeTimestampTypePeer.doSelect(criteria);
         assertEquals(0, result.size());
     }
 
@@ -224,11 +224,11 @@ public class DateTest extends BaseDataba
         }
         fillDateTimeTimestampWithPastEntry();
         Criteria criteria = new Criteria().where(
-                DateTimeTimestampPeer.TIME_VALUE,
+                DateTimeTimestampTypePeer.TIME_VALUE,
                 Criteria.CURRENT_TIME,
                 Criteria.GREATER_EQUAL);
-        List<DateTimeTimestamp> result
-                = DateTimeTimestampPeer.doSelect(criteria);
+        List<DateTimeTimestampType> result
+                = DateTimeTimestampTypePeer.doSelect(criteria);
         assertEquals(0, result.size());
     }
 
@@ -249,11 +249,11 @@ public class DateTest extends BaseDataba
         fillDateTimeTimestampWithPastEntry();
 
         Criteria criteria = new Criteria().where(
-                DateTimeTimestampPeer.TIMESTAMP_VALUE,
+                DateTimeTimestampTypePeer.TIMESTAMP_VALUE,
                 Criteria.CURRENT_TIMESTAMP,
                 Criteria.GREATER_EQUAL);
-        List<DateTimeTimestamp> result
-                = DateTimeTimestampPeer.doSelect(criteria);
+        List<DateTimeTimestampType> result
+                = DateTimeTimestampTypePeer.doSelect(criteria);
         assertEquals(0, result.size());
     }
 
@@ -268,7 +268,7 @@ public class DateTest extends BaseDataba
         cleanDateTimeTimestampTable();
 
         // insert new DateTest object to db
-        DateTimeTimestamp dateTimeTimestamp = new DateTimeTimestamp();
+        DateTimeTimestampType dateTimeTimestamp = new DateTimeTimestampType();
         dateTimeTimestamp.setDateValue(
                 new GregorianCalendar(2010, 1, 23).getTime());
         dateTimeTimestamp.setTimeValue(new Date());
@@ -277,10 +277,10 @@ public class DateTest extends BaseDataba
 
         // execute select
         Criteria criteria = new Criteria();
-        criteria.where(DateTimeTimestampPeer.DATE_VALUE,
+        criteria.where(DateTimeTimestampTypePeer.DATE_VALUE,
                 new GregorianCalendar(2010, 1, 23).getTime());
-        List<DateTimeTimestamp> result
-            = DateTimeTimestampPeer.doSelect(criteria);
+        List<DateTimeTimestampType> result
+            = DateTimeTimestampTypePeer.doSelect(criteria);
 
         // verify
         assertEquals(1, result.size());
@@ -306,7 +306,7 @@ public class DateTest extends BaseDataba
         cleanDateTimeTimestampTable();
 
         // insert new DateTest object to db
-        DateTimeTimestamp dateTimeTimestamp = new DateTimeTimestamp();
+        DateTimeTimestampType dateTimeTimestamp = new DateTimeTimestampType();
         dateTimeTimestamp.setDateValue(new Date());
         dateTimeTimestamp.setTimeValue(new Date(1234000));
         dateTimeTimestamp.setTimestampValue(new Date());
@@ -314,9 +314,9 @@ public class DateTest extends BaseDataba
 
         // execute select
         Criteria criteria = new Criteria();
-        criteria.where(DateTimeTimestampPeer.TIME_VALUE, new Date(1234000));
-        List<DateTimeTimestamp> result
-            = DateTimeTimestampPeer.doSelect(criteria);
+        criteria.where(DateTimeTimestampTypePeer.TIME_VALUE, new Date(1234000));
+        List<DateTimeTimestampType> result
+            = DateTimeTimestampTypePeer.doSelect(criteria);
 
         // verify
         assertEquals(1, result.size());
@@ -342,7 +342,7 @@ public class DateTest extends BaseDataba
         cleanDateTimeTimestampTable();
 
         // insert new DateTest object to db
-        DateTimeTimestamp dateTimeTimestamp = new DateTimeTimestamp();
+        DateTimeTimestampType dateTimeTimestamp = new DateTimeTimestampType();
         dateTimeTimestamp.setDateValue(new Date());
         dateTimeTimestamp.setTimeValue(new Date(1234000));
         dateTimeTimestamp.setTimestampValue(new Date());
@@ -351,10 +351,10 @@ public class DateTest extends BaseDataba
         // execute select
         Criteria criteria = new Criteria();
         criteria.where(
-                DateTimeTimestampPeer.TIME_VALUE,
+                DateTimeTimestampTypePeer.TIME_VALUE,
                 new java.sql.Time(1234000));
-        List<DateTimeTimestamp> result
-            = DateTimeTimestampPeer.doSelect(criteria);
+        List<DateTimeTimestampType> result
+            = DateTimeTimestampTypePeer.doSelect(criteria);
 
         // verify
         assertEquals(1, result.size());
@@ -372,7 +372,7 @@ public class DateTest extends BaseDataba
         cleanDateTimeTimestampTable();
 
         // insert new DateTest object to db
-        DateTimeTimestamp dateTimeTimestamp = new DateTimeTimestamp();
+        DateTimeTimestampType dateTimeTimestamp = new DateTimeTimestampType();
         dateTimeTimestamp.setDateValue(new Date());
         dateTimeTimestamp.setTimeValue(new Date());
         dateTimeTimestamp.setTimestampValue(
@@ -381,10 +381,10 @@ public class DateTest extends BaseDataba
 
         // execute select
         Criteria criteria = new Criteria();
-        criteria.where(DateTimeTimestampPeer.TIMESTAMP_VALUE,
+        criteria.where(DateTimeTimestampTypePeer.TIMESTAMP_VALUE,
                 new GregorianCalendar(2010, 1, 23).getTime());
-        List<DateTimeTimestamp> result
-            = DateTimeTimestampPeer.doSelect(criteria);
+        List<DateTimeTimestampType> result
+            = DateTimeTimestampTypePeer.doSelect(criteria);
 
         // verify
         assertEquals(1, result.size());
@@ -403,7 +403,7 @@ public class DateTest extends BaseDataba
         cleanDateTimeTimestampTable();
 
         // insert new DateTest object to db
-        DateTimeTimestamp dateTimeTimestamp = new DateTimeTimestamp();
+        DateTimeTimestampType dateTimeTimestamp = new DateTimeTimestampType();
         dateTimeTimestamp.setDateValue(new Date());
         dateTimeTimestamp.setTimeValue(new Date());
         dateTimeTimestamp.setTimestampValue(
@@ -414,9 +414,9 @@ public class DateTest extends BaseDataba
         Criteria criteria = new Criteria();
         Date toSelect = new GregorianCalendar(2010, 1, 23).getTime();
         toSelect = new Date(toSelect.getTime() - 1000L);
-        criteria.where(DateTimeTimestampPeer.TIMESTAMP_VALUE, toSelect);
-        List<DateTimeTimestamp> result
-            = DateTimeTimestampPeer.doSelect(criteria);
+        criteria.where(DateTimeTimestampTypePeer.TIMESTAMP_VALUE, toSelect);
+        List<DateTimeTimestampType> result
+            = DateTimeTimestampTypePeer.doSelect(criteria);
 
         // verify
         assertEquals(0, result.size());
@@ -434,7 +434,7 @@ public class DateTest extends BaseDataba
         cleanDateTimeTimestampTable();
 
         // insert new DateTest object to db
-        DateTimeTimestamp dateTimeTimestamp = new DateTimeTimestamp();
+        DateTimeTimestampType dateTimeTimestamp = new DateTimeTimestampType();
         dateTimeTimestamp.setDateValue(new Date());
         dateTimeTimestamp.setTimeValue(new Date());
         GregorianCalendar calendar = new GregorianCalendar(2010, 1, 23);
@@ -447,10 +447,10 @@ public class DateTest extends BaseDataba
         calendar = new GregorianCalendar(2010, 1, 23);
         calendar.set(GregorianCalendar.MILLISECOND, 123);
         criteria.where(
-                DateTimeTimestampPeer.TIMESTAMP_VALUE,
+                DateTimeTimestampTypePeer.TIMESTAMP_VALUE,
                 calendar.getTime());
-        List<DateTimeTimestamp> result
-            = DateTimeTimestampPeer.doSelect(criteria);
+        List<DateTimeTimestampType> result
+            = DateTimeTimestampTypePeer.doSelect(criteria);
 
         // verify
         assertEquals(1, result.size());
@@ -473,7 +473,7 @@ public class DateTest extends BaseDataba
         cleanDateTimeTimestampTable();
 
         // insert new DateTest object to db
-        DateTimeTimestamp dateTimeTimestamp = new DateTimeTimestamp();
+        DateTimeTimestampType dateTimeTimestamp = new DateTimeTimestampType();
         dateTimeTimestamp.setDateValue(new Date());
         dateTimeTimestamp.setTimeValue(new Date());
         GregorianCalendar calendar = new GregorianCalendar(2010, 1, 23);
@@ -486,10 +486,10 @@ public class DateTest extends BaseDataba
         calendar = new GregorianCalendar(2010, 1, 23);
         calendar.set(GregorianCalendar.MILLISECOND, 124);
         criteria.where(
-                DateTimeTimestampPeer.TIMESTAMP_VALUE,
+                DateTimeTimestampTypePeer.TIMESTAMP_VALUE,
                 calendar.getTime());
-        List<DateTimeTimestamp> result
-            = DateTimeTimestampPeer.doSelect(criteria);
+        List<DateTimeTimestampType> result
+            = DateTimeTimestampTypePeer.doSelect(criteria);
 
         // verify
         assertEquals(0, result.size());
@@ -506,7 +506,7 @@ public class DateTest extends BaseDataba
         cleanDateTimeTimestampTable();
 
         // insert new DateTest object to db
-        DateTimeTimestamp dateTimeTimestamp = new DateTimeTimestamp();
+        DateTimeTimestampType dateTimeTimestamp = new DateTimeTimestampType();
         dateTimeTimestamp.setDateValue(new Date());
         dateTimeTimestamp.setTimeValue(new Date());
         dateTimeTimestamp.setTimestampValue(
@@ -517,10 +517,10 @@ public class DateTest extends BaseDataba
         Criteria criteria = new Criteria();
         Date toSelect = new GregorianCalendar(2010, 1, 23).getTime();
         criteria.where(
-                DateTimeTimestampPeer.TIMESTAMP_VALUE,
+                DateTimeTimestampTypePeer.TIMESTAMP_VALUE,
                 new java.sql.Timestamp(toSelect.getTime()));
-        List<DateTimeTimestamp> result
-            = DateTimeTimestampPeer.doSelect(criteria);
+        List<DateTimeTimestampType> result
+            = DateTimeTimestampTypePeer.doSelect(criteria);
 
         // verify
         assertEquals(1, result.size());
@@ -534,7 +534,7 @@ public class DateTest extends BaseDataba
      */
     private void cleanDateTimeTimestampTable() throws TorqueException
     {
-        DateTimeTimestampPeer.doDelete(new Criteria());
+        DateTimeTimestampTypePeer.doDelete(new Criteria());
     }
 
     private boolean timestampHasMillisecondAccuracy()
@@ -560,8 +560,8 @@ public class DateTest extends BaseDataba
      */
     private void fillDateTimeTimestampWithPastEntry() throws TorqueException
     {
-        DateTimeTimestampPeer.doDelete(new Criteria());
-        DateTimeTimestamp dateTimeTimestamp = new DateTimeTimestamp();
+        DateTimeTimestampTypePeer.doDelete(new Criteria());
+        DateTimeTimestampType dateTimeTimestamp = new DateTimeTimestampType();
         dateTimeTimestamp.setDateValue(
                 new GregorianCalendar(2010, 1, 1).getTime());
         dateTimeTimestamp.setTimeValue(

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/JoinTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/JoinTest.java?rev=1436782&r1=1436781&r2=1436782&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/JoinTest.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/generated/peer/JoinTest.java Tue Jan 22 07:51:31 2013
@@ -25,22 +25,21 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.torque.BaseDatabaseTestCase;
 import org.apache.torque.ColumnImpl;
+import org.apache.torque.ForeignKeySchemaData;
 import org.apache.torque.TorqueException;
 import org.apache.torque.adapter.HsqldbAdapter;
 import org.apache.torque.criteria.Criteria;
 import org.apache.torque.criteria.Criterion;
-import org.apache.torque.test.dbobject.A;
 import org.apache.torque.test.dbobject.Author;
-import org.apache.torque.test.dbobject.B;
 import org.apache.torque.test.dbobject.Book;
-import org.apache.torque.test.dbobject.C;
-import org.apache.torque.test.dbobject.RAb;
-import org.apache.torque.test.peer.APeer;
+import org.apache.torque.test.dbobject.MultiRef;
+import org.apache.torque.test.dbobject.NullableOIntegerFk;
+import org.apache.torque.test.dbobject.OIntegerPk;
+import org.apache.torque.test.dbobject.PIntegerPk;
 import org.apache.torque.test.peer.AuthorPeer;
-import org.apache.torque.test.peer.BPeer;
 import org.apache.torque.test.peer.BookPeer;
-import org.apache.torque.test.peer.CPeer;
-import org.apache.torque.test.peer.RAbPeer;
+import org.apache.torque.test.peer.MultiRefPeer;
+import org.apache.torque.test.peer.OIntegerPkPeer;
 
 /**
  * Tests joins.
@@ -417,75 +416,71 @@ public class JoinTest extends BaseDataba
      */
     public void testDoSelectJoinAllExceptY() throws Exception
     {
-        cleanABC();
+        ForeignKeySchemaData.clearTablesInDatabase();
 
         // setup test data
-        A a = new A();
-        a.setName("test a");
-        a.save();
-
-        B b = new B();
-        b.setName("test b");
-        b.save();
-
-        RAb rab = new RAb();
-        rab.setName("test rab");
-        rab.setA(a);
-        rab.setB(b);
-        rab.save();
-
-        C c = new C();
-        c.setName("test c");
-        c.setA(a);
-        c.setB(b);
-        c.setRAb(rab);
-        c.save();
-
-        Criteria criteria = new Criteria().where(APeer.A_ID, a.getAId());
-        List<C> list = MyCPeer.doSelectJoinAllExceptA(criteria);
+        OIntegerPk oIntegerPk = new OIntegerPk();
+        oIntegerPk.setName("testOIntegerPk");
+        oIntegerPk.save();
+
+        PIntegerPk pIntegerPk = new PIntegerPk();
+        pIntegerPk.setName("testPIntegerPk");
+        pIntegerPk.save();
+
+        NullableOIntegerFk nullableOIntegerFk = new NullableOIntegerFk();
+        nullableOIntegerFk.setName("testNullableOIntegerFk");
+        nullableOIntegerFk.save();
+
+        MultiRef multiRef = new MultiRef();
+        multiRef.setOIntegerPk(oIntegerPk);
+        multiRef.setPIntegerPk(pIntegerPk);
+        multiRef.setNullableOIntegerFk(nullableOIntegerFk);
+        multiRef.save();
+
+        Criteria criteria = new Criteria().where(
+                OIntegerPkPeer.ID,
+                oIntegerPk.getId());
+        List<MultiRef> list
+            = MyMultiRefPeer.doSelectJoinAllExceptNullableOIntegerFk(
+                    criteria);
         assertTrue("list should contain 1 entry but contains "
                 + list.size(), list.size() == 1);
 
-        C c1 = list.get(0);
-        B b1 = c1.getB();
-        RAb rab1 = c1.getRAb();
-
-        assertTrue("The name of c1 should be 'test c' but is " + c1.getName(),
-                c1.getName().equals("test c"));
-        assertTrue("The name of b1 should be 'test b' but is " + b1.getName(),
-                b1.getName().equals("test b"));
-        assertTrue("The name of rab1 should be 'test rab' but is " + rab1.getName(),
-                rab1.getName().equals("test rab"));
-        assertTrue ("The c's of b1 and rab1"
-                + " should point to the same instance",
-                b1.getCs().get(0) == rab1.getCs().get(0));
+        MultiRef MultiRefLoaded = list.get(0);
+        // check loaded entities. loading already loaded entities
+        // with a null connection does not result in an error
+        OIntegerPk relatedBy1
+                = MultiRefLoaded.getOIntegerPk(null); // already loaded
+        assertEquals(oIntegerPk.getName(), relatedBy1.getName());
+        PIntegerPk relatedBy2
+                = MultiRefLoaded.getPIntegerPk(null); // already loaded
+        assertEquals(pIntegerPk.getName(), relatedBy2.getName());
+        try
+        {
+            MultiRefLoaded.getNullableOIntegerFk(null);
+            fail("relatedBy3 should not already be loaded but it is");
+        }
+        catch (NullPointerException e)
+        {
+            // expected
+        }
     }
 
     /**
-     * Subclass of CPeer to make the doSelectJoinAllExceptA() visible
+     * Subclass of MultiRefPeer to make the doSelectJoinAllExcept..()
+     * visible
      */
-    static class MyCPeer extends CPeer
+    static class MyMultiRefPeer extends MultiRefPeer
     {
-        public static List<C> doSelectJoinAllExceptA(Criteria criteria)
+        public static List<MultiRef> doSelectJoinAllExceptNullableOIntegerFk(
+                    Criteria criteria)
                 throws TorqueException
         {
-            return CPeer.doSelectJoinAllExceptA(criteria);
+            return MultiRefPeer.doSelectJoinAllExceptNullableOIntegerFk(criteria);
         }
     }
 
     /**
-     * Deletes all As, Bs, Cs and RAs
-     * @throws Exception if the cleanup fails
-     */
-    protected void cleanABC() throws Exception
-    {
-        CPeer.doDelete(new Criteria());
-        RAbPeer.doDelete(new Criteria());
-        APeer.doDelete(new Criteria());
-        BPeer.doDelete(new Criteria());
-    }
-
-    /**
      * Fills test data into the author and book tables.
      * There is one author without books, one author with one book
      * and one author with three books.

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java?rev=1436782&r1=1436781&r2=1436782&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java Tue Jan 22 07:51:31 2013
@@ -36,7 +36,7 @@ public class DatabaseMapTest extends Bas
 
     public static final String TABLE_NAME1 = "NOT_USED_BEFORE_MAP_INIT";
 
-    public static final String DATABASE_NAME = "databaseMapInit";
+    public static final String DATABASE_NAME = "databaseMap";
 
     public static final String INVALID_DATABASE_NAME = "erotskoob";
 

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/om/OMByNameMethodsTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/om/OMByNameMethodsTest.java?rev=1436782&r1=1436781&r2=1436782&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/om/OMByNameMethodsTest.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/om/OMByNameMethodsTest.java Tue Jan 22 07:51:31 2013
@@ -514,10 +514,10 @@ public class OMByNameMethodsTest extends
         {
             for (int i = 0; i < OBJECT_PEER_NAMES.length; i++)
             {
-                boolean status = objectTypes.setByPosition(i,
+                boolean status = objectTypes.setByPosition(i + 1,
                         OBJECT_TEST_VALUES[i]);
                 assertTrue("objectTypes.setByPosition(int, Object ) returned "
-                                + "false setting position " + i, status);
+                                + "false setting position " + (i + 1), status);
             }
         }
         catch (TorqueException e)
@@ -540,10 +540,10 @@ public class OMByNameMethodsTest extends
         {
             for (int i = 0; i < PRIMITIVE_PEER_NAMES.length; i++)
             {
-                boolean status = primitiveTypes.setByPosition(i,
+                boolean status = primitiveTypes.setByPosition(i + 1,
                         OBJECT_TEST_VALUES[i]);
                 assertTrue("primitiveTypes.setByPosition(int, Object) returned "
-                                + "false setting position " + i, status);
+                                + "false setting position " + (i + 1), status);
             }
         }
         catch (TorqueException e)



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


Mime
View raw message