db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1056899 [1/4] - in /db/torque/torque4/trunk: torque-runtime/ torque-runtime/src/main/java/ torque-runtime/src/main/java/org/apache/torque/map/ torque-runtime/src/main/java/org/apache/torque/oid/ torque-runtime/src/main/java/org/apache/torq...
Date Sun, 09 Jan 2011 09:52:46 GMT
Author: tfischer
Date: Sun Jan  9 09:52:45 2011
New Revision: 1056899

URL: http://svn.apache.org/viewvc?rev=1056899&view=rev
Log:
Merged the trunk-without-village branch with the torque4 trunk

Added:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/
      - copied from r1056616, db/torque/torque4/branches/trunk-without-village/torque-runtime/src/main/java/org/apache/torque/om/mapper/
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/BigDecimalMapper.java
      - copied unchanged from r1056616, db/torque/torque4/branches/trunk-without-village/torque-runtime/src/main/java/org/apache/torque/om/mapper/BigDecimalMapper.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/CompositeMapper.java
      - copied unchanged from r1056616, db/torque/torque4/branches/trunk-without-village/torque-runtime/src/main/java/org/apache/torque/om/mapper/CompositeMapper.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/IntegerMapper.java
      - copied unchanged from r1056616, db/torque/torque4/branches/trunk-without-village/torque-runtime/src/main/java/org/apache/torque/om/mapper/IntegerMapper.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/LongMapper.java
      - copied unchanged from r1056616, db/torque/torque4/branches/trunk-without-village/torque-runtime/src/main/java/org/apache/torque/om/mapper/LongMapper.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/ObjectListMapper.java
      - copied unchanged from r1056616, db/torque/torque4/branches/trunk-without-village/torque-runtime/src/main/java/org/apache/torque/om/mapper/ObjectListMapper.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/RecordMapper.java
      - copied unchanged from r1056616, db/torque/torque4/branches/trunk-without-village/torque-runtime/src/main/java/org/apache/torque/om/mapper/RecordMapper.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/StringMapper.java
      - copied unchanged from r1056616, db/torque/torque4/branches/trunk-without-village/torque-runtime/src/main/java/org/apache/torque/om/mapper/StringMapper.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/mapper/package.html
      - copied unchanged from r1056616, db/torque/torque4/branches/trunk-without-village/torque-runtime/src/main/java/org/apache/torque/om/mapper/package.html
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/ColumnValues.java
      - copied unchanged from r1056616, db/torque/torque4/branches/trunk-without-village/torque-runtime/src/main/java/org/apache/torque/util/ColumnValues.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/JdbcTypedValue.java
      - copied unchanged from r1056616, db/torque/torque4/branches/trunk-without-village/torque-runtime/src/main/java/org/apache/torque/util/JdbcTypedValue.java
Removed:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/VillageUtils.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/engine/database/transform/
Modified:
    db/torque/torque4/trunk/torque-runtime/pom.xml
    db/torque/torque4/trunk/torque-runtime/src/main/java/   (props changed)
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/TableMap.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/AutoIncrementIdGenerator.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/SequenceIdGenerator.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/BooleanKey.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/ComboKey.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/DateKey.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/NumberKey.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/ObjectKey.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/StringKey.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeer.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/CountHelper.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/LargeSelect.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Query.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/SummaryHelper.java
    db/torque/torque4/trunk/torque-runtime/src/test/java/org/   (props changed)
    db/torque/torque4/trunk/torque-site/src/changes/changes.xml   (contents, props changed)
    db/torque/torque4/trunk/torque-site/src/site/resources/images/   (props changed)
    db/torque/torque4/trunk/torque-site/src/site/xdoc/   (props changed)
    db/torque/torque4/trunk/torque-test/src/   (props changed)
    db/torque/torque4/trunk/torque-test/src/main/schema/   (props changed)
    db/torque/torque4/trunk/torque-test/src/test/java/   (props changed)
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseRuntimeTestCase.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/map/DatabaseMapTest.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/LargeSelectTest.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/SummaryHelperTest.java
    db/torque/torque4/trunk/torque-test/src/test/profile/   (props changed)
    db/torque/torque4/trunk/torque-test/src/test/profile/mysql/Torque.properties
    db/torque/torque4/trunk/torque-test/src/test/profile/oracle/Torque.properties
    db/torque/torque4/trunk/torque-test/src/test/profile/postgresql/Torque.properties
    db/torque/torque4/trunk/torque-test/src/test/resources/TestComponentConfig.xml   (props
changed)
    db/torque/torque4/trunk/torque-test/src/test/resources/TestRoleConfig.xml   (props changed)
    db/torque/torque4/trunk/torque-test/src/test/resources/TurbineResources.properties   (props
changed)
    db/torque/torque4/trunk/torque-test/src/test/resources/cache.ccf   (props changed)
    db/torque/torque4/trunk/torque-test/src/test/resources/commons-logging.properties   (props
changed)
    db/torque/torque4/trunk/torque-test/src/test/resources/log4j.properties   (props changed)
    db/torque/torque4/trunk/torque-test/src/test/sql/   (props changed)

Modified: db/torque/torque4/trunk/torque-runtime/pom.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/pom.xml?rev=1056899&r1=1056898&r2=1056899&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/pom.xml (original)
+++ db/torque/torque4/trunk/torque-runtime/pom.xml Sun Jan  9 09:52:45 2011
@@ -111,25 +111,6 @@
       <version>1.3</version>
     </dependency>
 
-    <!--dependency>
-      <groupId>javax.sql</groupId>
-      <artifactId>jdbc-stdext</artifactId>
-      <version>2.0</version>
-    </dependency-->
-
-    <!--dependency>
-      <groupId>javax.naming</groupId>
-      <artifactId>jndi</artifactId>
-      <version>1.2.1</version>
-    </dependency-->
-
-    <dependency>
-      <groupId>org.apache.torque</groupId>
-      <artifactId>village</artifactId>
-      <version>3.3</version>
-      <type>jar</type>
-    </dependency>
-
     <dependency>
       <groupId>xerces</groupId>
       <artifactId>xercesImpl</artifactId>

Propchange: db/torque/torque4/trunk/torque-runtime/src/main/java/
            ('svn:mergeinfo' removed)

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/TableMap.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/TableMap.java?rev=1056899&r1=1056898&r2=1056899&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/TableMap.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/map/TableMap.java
Sun Jan  9 09:52:45 2011
@@ -20,12 +20,15 @@ package org.apache.torque.map;
  */
 
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.Map;
+import java.util.Set;
 import java.util.StringTokenizer;
 
 import org.apache.commons.lang.StringUtils;
+import org.apache.torque.TorqueException;
 import org.apache.torque.adapter.IDMethod;
 import org.apache.torque.oid.IdGenerator;
 
@@ -815,4 +818,38 @@ public class TableMap implements IDMetho
     {
         return optionsMap.get(key);
     }
+
+    /**
+     * Returns the single primary key of this table, if it exists
+     *
+     * @return the single primary key column.
+     *
+     * @throws TorqueException If the table has no primary key
+     *         or if the table has multiple primary keys.
+     */
+    public ColumnMap getPrimaryKey()
+            throws TorqueException
+    {
+        Set<ColumnMap> result = new HashSet<ColumnMap>();
+
+        for (ColumnMap column : columns.values())
+        {
+            if (column.isPrimaryKey())
+            {
+                result.add(column);
+            }
+        }
+        if (result.isEmpty())
+        {
+            throw new TorqueException("getPrimaryKey(): Table " + tableName
+                    + "has no primary key.");
+        }
+        if (result.size() > 1)
+        {
+            throw new TorqueException("getPrimaryKey(): Table " + tableName
+                    + "has more than one primary key.");
+        }
+        return result.iterator().next();
+    }
+
 }

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/AutoIncrementIdGenerator.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/AutoIncrementIdGenerator.java?rev=1056899&r1=1056898&r2=1056899&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/AutoIncrementIdGenerator.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/AutoIncrementIdGenerator.java
Sun Jan  9 09:52:45 2011
@@ -21,11 +21,17 @@ package org.apache.torque.oid;
 
 import java.math.BigDecimal;
 import java.sql.Connection;
+import java.util.List;
+
+import org.apache.torque.TorqueException;
 import org.apache.torque.adapter.DB;
+import org.apache.torque.om.mapper.BigDecimalMapper;
+import org.apache.torque.om.mapper.IntegerMapper;
+import org.apache.torque.om.mapper.LongMapper;
+import org.apache.torque.om.mapper.RecordMapper;
+import org.apache.torque.om.mapper.StringMapper;
+import org.apache.torque.util.BasePeer;
 import org.apache.torque.util.SQLBuilder;
-import com.workingdogs.village.QueryDataSet;
-import com.workingdogs.village.Record;
-import com.workingdogs.village.Value;
 
 /**
  * This generator works with databases that have an sql syntax that
@@ -58,60 +64,70 @@ public class AutoIncrementIdGenerator im
     /**
      * Returns the last ID used by this connection.
      *
-     * @param connection A Connection.
-     * @param keyInfo an Object that contains additional info.
-     * @return An int with the value for the id.
-     * @exception Exception Database error.
+     * @param connection The database connection to read the sequence, not null.
+     * @param keyInfo the name of the table on which the last insert occured.
+     *
+     * @return An int with the last value auto-incremented as a
+     *         result of an insert.
+     *
+     * @throws TorqueException if a database error occurs.
      */
     public int getIdAsInt(Connection connection, Object keyInfo)
-        throws Exception
+        throws TorqueException
     {
-        return getIdAsVillageValue(connection, keyInfo).asInt();
+        return getId(connection, keyInfo, new IntegerMapper());
     }
 
     /**
      * Returns the last ID used by this connection.
      *
-     * @param connection A Connection.
-     * @param keyInfo an Object that contains additional info.
-     * @return A long with the value for the id.
-     * @exception Exception Database error.
+     * @param connection The database connection to read the sequence, not null.
+     * @param keyInfo the name of the table on which the last insert occured.
+     *
+     * @return A long with the last value auto-incremented as a
+     *         result of an insert.
+     *
+     * @throws TorqueException if a database error occurs.
      */
     public long getIdAsLong(Connection connection, Object keyInfo)
-        throws Exception
+        throws TorqueException
     {
-        return getIdAsVillageValue(connection, keyInfo).asLong();
+        return getId(connection, keyInfo, new LongMapper());
     }
 
     /**
      * Returns the last ID used by this connection.
      *
-     * @param connection A Connection.
-     * @param keyInfo an Object that contains additional info.
+     * @param connection The database connection to read the sequence, not null.
+     * @param keyInfo the name of the table on which the last insert occured.
+     *
      * @return A BigDecimal with the last value auto-incremented as a
-     * result of an insert.
-     * @exception Exception Database error.
+     *         result of an insert.
+     *
+     * @throws TorqueException if a database error occurs.
      */
     public BigDecimal getIdAsBigDecimal(Connection connection, Object keyInfo)
-        throws Exception
+        throws TorqueException
     {
-        return getIdAsVillageValue(connection, keyInfo).asBigDecimal();
+        return getId(connection, keyInfo, new BigDecimalMapper());
     }
 
 
     /**
      * Returns the last ID used by this connection.
      *
-     * @param connection A Connection.
-     * @param keyInfo an Object that contains additional info.
+     * @param connection The database connection to read the sequence, not null.
+     * @param keyInfo the name of the table on which the last insert occured.
+     *
      * @return A String with the last value auto-incremented as a
-     * result of an insert.
-     * @exception Exception Database error.
+     *         result of an insert.
+     *
+     * @throws TorqueException if a database error occurs.
      */
     public String getIdAsString(Connection connection, Object keyInfo)
-        throws Exception
+        throws TorqueException
     {
-        return getIdAsVillageValue(connection, keyInfo).asString();
+        return getId(connection, keyInfo, new StringMapper());
     }
 
     /**
@@ -150,31 +166,22 @@ public class AutoIncrementIdGenerator im
      *
      * @param connection A Connection.
      * @param keyInfo an Object that contains additional info.
-     * @return A Village Value with the last value auto-incremented as a
-     * result of an insert.
-     * @exception Exception Database error.
+     * @param mapper The RecordMapper that maps from a ResultSet to the
+     *        appropriate java object.
+     *
+     * @return The generated id.
+     * @exception TorqueException if a database error occurs.
      */
-    private Value getIdAsVillageValue(Connection connection, Object keyInfo)
-        throws Exception
+    private <T> T getId(
+                Connection connection,
+                Object keyInfo,
+                RecordMapper<T> mapper)
+            throws TorqueException
     {
         String tableName = SQLBuilder.getFullTableName(String.valueOf(keyInfo), name);
-        String idSQL = dbAdapter.getIDMethodSQL(tableName);
-        Value id = null;
-        QueryDataSet qds = null;
-        try
-        {
-            qds = new QueryDataSet(connection, idSQL);
-            qds.fetchRecords(1);
-            Record rec = qds.getRecord(0);
-            id = rec.getValue(1);
-        }
-        finally
-        {
-            if (qds != null)
-            {
-                qds.close();
-            }
-        }
-        return id;
+        String idSql = dbAdapter.getIDMethodSQL(tableName);
+
+        List<T> result = BasePeer.doSelect(idSql, mapper, null, connection);
+        return result.get(0);
     }
 }

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/SequenceIdGenerator.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/SequenceIdGenerator.java?rev=1056899&r1=1056898&r2=1056899&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/SequenceIdGenerator.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/oid/SequenceIdGenerator.java
Sun Jan  9 09:52:45 2011
@@ -21,17 +21,18 @@ package org.apache.torque.oid;
 
 import java.math.BigDecimal;
 import java.sql.Connection;
+import java.util.List;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
+import org.apache.torque.TorqueException;
 import org.apache.torque.adapter.DB;
+import org.apache.torque.om.mapper.BigDecimalMapper;
+import org.apache.torque.om.mapper.IntegerMapper;
+import org.apache.torque.om.mapper.LongMapper;
+import org.apache.torque.om.mapper.RecordMapper;
+import org.apache.torque.om.mapper.StringMapper;
+import org.apache.torque.util.BasePeer;
 import org.apache.torque.util.SQLBuilder;
 
-import com.workingdogs.village.QueryDataSet;
-import com.workingdogs.village.Record;
-import com.workingdogs.village.Value;
-
 /**
  * This generator works with databases that have an sql syntax for
  * getting an id prior to inserting a row into the database.
@@ -41,9 +42,6 @@ import com.workingdogs.village.Value;
  */
 public class SequenceIdGenerator implements IdGenerator
 {
-    /** The log. */
-    private static Log log = LogFactory.getLog(SequenceIdGenerator.class);
-
     /** the adapter that knows the correct sql syntax */
     private DB dbAdapter;
 
@@ -65,57 +63,65 @@ public class SequenceIdGenerator impleme
     /**
      * Retrieves an id as an int.
      *
-     * @param connection A Connection.
-     * @param keyInfo an Object that contains additional info.
+     * @param connection The database connection to read the sequence, not null.
+     * @param keyInfo the name of the sequence, not null.
+     *
      * @return An int with the value for the id.
-     * @exception Exception Database error.
+     *
+     * @throws TorqueException if a database error occurs.
      */
     public int getIdAsInt(Connection connection, Object keyInfo)
-        throws Exception
+        throws TorqueException
     {
-        return getIdAsVillageValue(connection, keyInfo).asInt();
+        return getId(connection, keyInfo, new IntegerMapper());
     }
 
     /**
      * Retrieves an id as an long.
      *
-     * @param connection A Connection.
-     * @param keyInfo an Object that contains additional info.
+     * @param connection The database connection to read the sequence, not null.
+     * @param keyInfo the name of the sequence, not null.
+     *
      * @return A long with the value for the id.
-     * @exception Exception Database error.
+     *
+     * @throws TorqueException if a database error occurs.
      */
     public long getIdAsLong(Connection connection, Object keyInfo)
-        throws Exception
+        throws TorqueException
     {
-        return getIdAsVillageValue(connection, keyInfo).asLong();
+        return getId(connection, keyInfo, new LongMapper());
     }
 
     /**
      * Retrieves an id as a BigDecimal.
      *
-     * @param connection A Connection.
-     * @param keyInfo an Object that contains additional info.
-     * @return A BigDecimal id
-     * @exception Exception Database error.
+     * @param connection The database connection to read the sequence, not null.
+     * @param keyInfo the name of the sequence, not null.
+     *
+     * @return A BigDecimal id.
+     *
+     * @exception TorqueException if a database error occurs.
      */
     public BigDecimal getIdAsBigDecimal(Connection connection, Object keyInfo)
-        throws Exception
+        throws TorqueException
     {
-        return getIdAsVillageValue(connection, keyInfo).asBigDecimal();
+        return getId(connection, keyInfo, new BigDecimalMapper());
     }
 
     /**
      * Retrieves an id as an String.
      *
-     * @param connection A Connection.
-     * @param keyInfo an Object that contains additional info.
-     * @return A String id
-     * @exception Exception Database error.
+     * @param connection The database connection to read the sequence, not null.
+     * @param keyInfo the name of the sequence, not null.
+     *
+     * @return A String id.
+     *
+     * @throws TorqueException if a database error occurs.
      */
     public String getIdAsString(Connection connection, Object keyInfo)
-        throws Exception
+        throws TorqueException
     {
-        return getIdAsVillageValue(connection, keyInfo).asString();
+        return getId(connection, keyInfo, new StringMapper());
     }
 
     /**
@@ -150,35 +156,27 @@ public class SequenceIdGenerator impleme
     }
 
     /**
-     * Retrieves an id as a Village Value.
+     * Retrieves an id from a sequence.
      *
      * @param connection A Connection.
      * @param keyInfo an Object that contains additional info.
-     * @return A Village Value id.
-     * @exception Exception Database error.
+     * @param mapper The RecordMapper that maps from a ResultSet to the
+     *        appropriate java object.
+     *
+     * @return The generated id.
+     * @throws TorqueException if a database error occurs.
      */
-    private Value getIdAsVillageValue(Connection connection, Object keyInfo)
-        throws Exception
+    private <T> T getId(
+                Connection connection,
+                Object keyInfo,
+                RecordMapper<T> mapper)
+            throws TorqueException
     {
-        String sequenceName = SQLBuilder.getFullTableName(String.valueOf(keyInfo), name);
+        String sequenceName
+                = SQLBuilder.getFullTableName(String.valueOf(keyInfo), name);
         String idSql = dbAdapter.getIDMethodSQL(sequenceName);
-        if (log.isDebugEnabled())
-        {
-            log.debug(idSql);
-        }
-
-        // Execute the query.
-        QueryDataSet qds = new QueryDataSet(connection, idSql);
-        Record rec;
-        try
-        {
-            qds.fetchRecords(1);
-            rec = qds.getRecord(0);  // Records are 0 based.
-        }
-        finally
-        {
-            qds.close();
-        }
-        return rec.getValue(1); // Values are 1 based.
+
+        List<T> result = BasePeer.doSelect(idSql, mapper, null, connection);
+        return result.get(0);
     }
 }

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/BooleanKey.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/BooleanKey.java?rev=1056899&r1=1056898&r2=1056899&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/BooleanKey.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/BooleanKey.java
Sun Jan  9 09:52:45 2011
@@ -1,5 +1,7 @@
 package org.apache.torque.om;
 
+import java.sql.Types;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -124,6 +126,17 @@ public class BooleanKey extends SimpleKe
     }
 
     /**
+     * Returns the JDBC type of the key
+     * as defined in <code>java.sql.Types</code>.
+     *
+     * @return <code>Types.BIT</code>.
+     */
+    public int getJdbcType()
+    {
+        return Types.BIT;
+    }
+
+    /**
      * keyObj is equal to this StringKey if keyObj is a StringKey or String
      * that contains the same information this key contains.  Two ObjectKeys
      * that both contain null values are not considered equal.

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/ComboKey.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/ComboKey.java?rev=1056899&r1=1056898&r2=1056899&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/ComboKey.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/ComboKey.java
Sun Jan  9 09:52:45 2011
@@ -19,6 +19,7 @@ package org.apache.torque.om;
  * under the License.
  */
 
+import java.sql.Types;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -170,6 +171,17 @@ public class ComboKey extends ObjectKey
     }
 
     /**
+     * Returns the JDBC type of the key
+     * as defined in <code>java.sql.Types</code>.
+     *
+     * @return <code>Types.ARRAY</code>.
+     */
+    public int getJdbcType()
+    {
+        return Types.ARRAY;
+    }
+
+    /**
      * This method will return true if the conditions for a looseEquals
      * are met and in addition no parts of the keys are null.
      *

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/DateKey.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/DateKey.java?rev=1056899&r1=1056898&r2=1056899&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/DateKey.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/DateKey.java
Sun Jan  9 09:52:45 2011
@@ -19,6 +19,7 @@ package org.apache.torque.om;
  * under the License.
  */
 
+import java.sql.Types;
 import java.util.Date;
 
 /**
@@ -110,6 +111,17 @@ public class DateKey extends SimpleKey
     }
 
     /**
+     * Returns the JDBC type of the key
+     * as defined in <code>java.sql.Types</code>.
+     *
+     * @return <code>Types.TIMESTAMP</code>.
+     */
+    public int getJdbcType()
+    {
+        return Types.TIMESTAMP;
+    }
+
+    /**
      * Access the underlying Date object.
      *
      * @return a <code>Date</code> value

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/NumberKey.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/NumberKey.java?rev=1056899&r1=1056898&r2=1056899&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/NumberKey.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/NumberKey.java
Sun Jan  9 09:52:45 2011
@@ -20,6 +20,7 @@ package org.apache.torque.om;
  */
 
 import java.math.BigDecimal;
+import java.sql.Types;
 
 /**
  * This class can be used as an ObjectKey to uniquely identify an
@@ -165,6 +166,17 @@ public class NumberKey extends SimpleKey
     }
 
     /**
+     * Returns the JDBC type of the key
+     * as defined in <code>java.sql.Types</code>.
+     *
+     * @return <code>Types.NUMERIC</code>.
+     */
+    public int getJdbcType()
+    {
+        return Types.NUMERIC;
+    }
+
+    /**
      * Access the underlying BigDecimal object.
      *
      * @return a <code>BigDecimal</code> value

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/ObjectKey.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/ObjectKey.java?rev=1056899&r1=1056898&r2=1056899&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/ObjectKey.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/ObjectKey.java
Sun Jan  9 09:52:45 2011
@@ -72,6 +72,14 @@ public abstract class ObjectKey implemen
     }
 
     /**
+     * Returns the JDBC type of the key
+     * as defined in <code>java.sql.Types</code>.
+     *
+     * @return the JDBC type of the key.
+     */
+    public abstract int getJdbcType();
+
+    /**
      * Appends a String representation of the key to a buffer.
      *
      * @param sb a <code>StringBuffer</code>

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/StringKey.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/StringKey.java?rev=1056899&r1=1056898&r2=1056899&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/StringKey.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/om/StringKey.java
Sun Jan  9 09:52:45 2011
@@ -1,5 +1,7 @@
 package org.apache.torque.om;
 
+import java.sql.Types;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -107,6 +109,17 @@ public class StringKey extends SimpleKey
     }
 
     /**
+     * Returns the JDBC type of the key
+     * as defined in <code>java.sql.Types</code>.
+     *
+     * @return <code>Types.VARCHAR</code>.
+     */
+    public int getJdbcType()
+    {
+        return Types.VARCHAR;
+    }
+
+    /**
      * keyObj is equal to this StringKey if keyObj is a StringKey or String
      * that contains the same information this key contains.  Two ObjectKeys
      * that both contain null values are not considered equal.



---------------------------------------------------------------------
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