db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1148900 - in /db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util: BasePeerImpl.java Criteria.java
Date Wed, 20 Jul 2011 18:58:30 GMT
Author: tfischer
Date: Wed Jul 20 18:58:29 2011
New Revision: 1148900

URL: http://svn.apache.org/viewvc?rev=1148900&view=rev
Log:
TORQUE-165: remove cascade flag from Criteria

Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Criteria.java

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java?rev=1148900&r1=1148899&r2=1148900&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
Wed Jul 20 18:58:29 2011
@@ -306,48 +306,9 @@ public class BasePeerImpl implements Ser
                 Connection connection)
             throws TorqueException
     {
-//        String dbName = criteria.getDbName();
-//        final DatabaseMap dbMap = Torque.getDatabaseMap(dbName);
-
-        // This Callback adds all tables to the Table set which
-        // are referenced from a cascading criteria. As a result, all
-        // data that is referenced through foreign keys will also be
-        // deleted.
-//      TODO: reimplement
-//        SQLBuilder.TableCallback tc = new SQLBuilder.TableCallback() {
-//                public void process (Set<String> tables, String key, Criteria crit)
-//                {
-//                    if (crit.isCascade())
-//                    {
-//                        // This steps thru all the columns in the database.
-//                        TableMap[] tableMaps = dbMap.getTables();
-//                        for (int i = 0; i < tableMaps.length; i++)
-//                        {
-//                            ColumnMap[] columnMaps = tableMaps[i].getColumns();
-//
-//                            for (int j = 0; j < columnMaps.length; j++)
-//                            {
-//                                // Only delete rows where the foreign key is
-//                                // also a primary key.  Other rows need
-//                                // updating, but that is not implemented.
-//                                if (columnMaps[j].isForeignKey()
-//                                        && columnMaps[j].isPrimaryKey()
-//                                        && key.equals(columnMaps[j].getRelatedName()))
-//                                {
-//                                    tables.add(tableMaps[i].getName());
-//                                    crit.add(columnMaps[j].getFullyQualifiedName(),
-//                                            crit.getValue(key));
-//                                }
-//                            }
-//                        }
-//                    }
-//                }
-//            };
-
         Query query = SqlBuilder.buildQuery(criteria);
-
         query.setType(Query.Type.DELETE);
-        
+
         String fullTableName = SqlBuilder.getFullTableName(
                 tableName,
                 criteria.getDbName());

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Criteria.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Criteria.java?rev=1148900&r1=1148899&r2=1148900&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Criteria.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/Criteria.java
Wed Jul 20 18:58:29 2011
@@ -144,9 +144,6 @@ public class Criteria implements Seriali
     /** Whether the result must be a single record. */
     private boolean singleRecord = false;
 
-    /** TODO Currently unused. */
-    private boolean cascade = false;
-
     /** List of modifiers like DISTICT. */
     private UniqueList<String> selectModifiers = new UniqueList<String>();
 
@@ -260,7 +257,6 @@ public class Criteria implements Seriali
         criterionMap.clear();
         ignoreCase = false;
         singleRecord = false;
-        cascade = false;
         selectModifiers.clear();
         selectColumns.clear();
         orderByColumns.clear();
@@ -1587,28 +1583,6 @@ public class Criteria implements Seriali
     }
 
     /**
-     * Set cascade.
-     *
-     * @param b True if cascade is set.
-     * @return A modified Criteria object.
-     */
-    public Criteria setCascade(boolean b)
-    {
-        cascade = b;
-        return this;
-    }
-
-    /**
-     * Is cascade set?
-     *
-     * @return True if cascade is set.
-     */
-    public boolean isCascade()
-    {
-        return cascade;
-    }
-
-    /**
      * Set limit.
      *
      * @param limit An int with the value for limit.
@@ -1838,7 +1812,6 @@ public class Criteria implements Seriali
                 || this.limit != criteria.getLimit()
                 || ignoreCase != criteria.isIgnoreCase()
                 || singleRecord != criteria.isSingleRecord()
-                || cascade != criteria.isCascade()
                 || !dbName.equals(criteria.getDbName())
                 || !selectModifiers.equals(criteria.getSelectModifiers())
                 || !selectColumns.equals(criteria.getSelectColumns())
@@ -1882,7 +1855,6 @@ public class Criteria implements Seriali
         result = 37 * result + limit;
         result = 37 * result + (ignoreCase ? 0 : 1);
         result = 37 * result + (singleRecord ? 0 : 1);
-        result = 37 * result + (cascade ? 0 : 1);
         result = 37 * result + dbName.hashCode();
         result = 37 * result + selectModifiers.hashCode();
         result = 37 * result + selectColumns.hashCode();



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