avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From froehl...@apache.org
Subject cvs commit: jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql BasicLXSQLUpdateRowsHandler.java BasicLXSQLSelectSimpleHandler.java BasicLXSQLDeleteRowsHandler.java BasicLXSQLCreateViewHandler.java BasicLXSQLCreateAggregateViewHandler.java
Date Thu, 29 Nov 2001 10:35:56 GMT
froehlich    01/11/29 02:35:56

  Modified:    apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql
                        BasicLXSQLUpdateRowsHandler.java
                        BasicLXSQLSelectSimpleHandler.java
                        BasicLXSQLDeleteRowsHandler.java
                        BasicLXSQLCreateViewHandler.java
                        BasicLXSQLCreateAggregateViewHandler.java
  Log:
  moved parsing logic from SimpleWhereClause and renamed it to
  BasicCriteria. Parsing logic now in BasicLXSQLCriteriaHelper.
  
  Revision  Changes    Path
  1.7       +12 -8     jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql/BasicLXSQLUpdateRowsHandler.java
  
  Index: BasicLXSQLUpdateRowsHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql/BasicLXSQLUpdateRowsHandler.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BasicLXSQLUpdateRowsHandler.java	2001/11/23 12:40:20	1.6
  +++ BasicLXSQLUpdateRowsHandler.java	2001/11/29 10:35:55	1.7
  @@ -8,11 +8,10 @@
    */
   package org.apache.avalon.db.basic.handlers.lxsql;
   
  -
  -
   import org.apache.avalon.db.basic.parser.BasicLXSQLParser;
   import org.apache.avalon.db.basic.actions.BasicUpdateRows;
  -import org.apache.avalon.db.basic.actions.SimpleWhereClause;
  +import org.apache.avalon.db.basic.actions.BasicCriteria;
  +import org.apache.avalon.db.basic.actions.BasicLXSQLCriteriaHelper;
   import org.apache.avalon.db.services.DatabasePersistor;
   import org.apache.avalon.db.transport.Reply;
   import org.apache.avalon.db.transport.Request;
  @@ -34,7 +33,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.6 $
  + * @version $Revision: 1.7 $
    */
   public class BasicLXSQLUpdateRowsHandler extends BasicLXSQLHandler {
   
  @@ -69,7 +68,7 @@
           Element rootElement = doc.getDocumentElement();
           String queryableStr = rootElement.getAttribute("from");
           Queryable queryable = (Queryable) mDatabasePersistor.getQueryable(queryableStr);
  -
  +    
           String matchingInstructions = null;
   
           NodeList subRootNodes = rootElement.getChildNodes();
  @@ -79,10 +78,15 @@
               }
           }
   
  -        SimpleWhereClause swc = new SimpleWhereClause(rootElement, matchingInstructions,
"");
  -        swc.enableLogging(super.getLogger());
  +        BasicLXSQLCriteriaHelper basicCriteriaHelper = new BasicLXSQLCriteriaHelper(rootElement);
  +        basicCriteriaHelper.enableLogging(super.getLogger());
   
  -        UpdateRows action = new BasicUpdateRows((AbstractQueryable) queryable, swc);
  +        UpdateRows action = new BasicUpdateRows(
  +                                    (AbstractQueryable) queryable, 
  +                                    new BasicCriteria(
  +                                            basicCriteriaHelper.getCriteria(), 
  +                                            matchingInstructions, "")
  +                                    );
   
           mParser.initializeAction(action);
           action.execute();
  
  
  
  1.5       +5 -9      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql/BasicLXSQLSelectSimpleHandler.java
  
  Index: BasicLXSQLSelectSimpleHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql/BasicLXSQLSelectSimpleHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BasicLXSQLSelectSimpleHandler.java	2001/11/29 08:46:26	1.4
  +++ BasicLXSQLSelectSimpleHandler.java	2001/11/29 10:35:55	1.5
  @@ -1,4 +1,3 @@
  -
   /*
    * Copyright (C) The Apache Software Foundation. All rights reserved.
    *
  @@ -8,11 +7,10 @@
    */
   package org.apache.avalon.db.basic.handlers.lxsql;
   
  -
  -
   import org.apache.avalon.db.basic.parser.BasicLXSQLParser;
   import org.apache.avalon.db.basic.actions.BasicSelectSimple;
  -import org.apache.avalon.db.basic.actions.SimpleWhereClause;
  +import org.apache.avalon.db.basic.actions.BasicCriteria;
  +import org.apache.avalon.db.basic.actions.BasicLXSQLCriteriaHelper;
   import org.apache.avalon.db.services.DatabasePersistor;
   import org.apache.avalon.db.transport.Reply;
   import org.apache.avalon.db.transport.Request;
  @@ -35,7 +33,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public class BasicLXSQLSelectSimpleHandler extends BasicLXSQLHandler {
   
  @@ -70,12 +68,13 @@
           Element rootElement = doc.getDocumentElement();
   
           String[] tables = parseFrom(rootElement);
  +        BasicLXSQLCriteriaHelper criteriaHelper = new BasicLXSQLCriteriaHelper(rootElement);
   
           AbstractQueryable queryable = (AbstractQueryable) mDatabasePersistor.getQueryable(tables[0]);
   
           Select action = new BasicSelectSimple(tables,
           convertColumns(queryable, getColumns(rootElement)),
  -        new SimpleWhereClause(rootElement));
  +        new BasicCriteria(criteriaHelper.getCriteria()));
   
           mParser.initializeAction(action);
           action.execute();
  @@ -148,7 +147,4 @@
           }
           return cols;
       }
  -
  -
  -
   }
  
  
  
  1.7       +7 -6      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql/BasicLXSQLDeleteRowsHandler.java
  
  Index: BasicLXSQLDeleteRowsHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql/BasicLXSQLDeleteRowsHandler.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BasicLXSQLDeleteRowsHandler.java	2001/11/23 12:40:20	1.6
  +++ BasicLXSQLDeleteRowsHandler.java	2001/11/29 10:35:55	1.7
  @@ -12,7 +12,8 @@
   
   import org.apache.avalon.db.basic.parser.BasicLXSQLParser;
   import org.apache.avalon.db.basic.actions.BasicDeleteRows;
  -import org.apache.avalon.db.basic.actions.SimpleWhereClause;
  +import org.apache.avalon.db.basic.actions.BasicCriteria;
  +import org.apache.avalon.db.basic.actions.BasicLXSQLCriteriaHelper;
   import org.apache.avalon.db.services.DatabasePersistor;
   import org.apache.avalon.db.transport.Reply;
   import org.apache.avalon.db.transport.Request;
  @@ -33,7 +34,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.6 $
  + * @version $Revision: 1.7 $
    */
   public class BasicLXSQLDeleteRowsHandler extends BasicLXSQLHandler {
   
  @@ -69,11 +70,11 @@
           String queryableStr = rootElement.getAttribute("from");
           Queryable queryable = (Queryable) mDatabasePersistor.getQueryable(queryableStr);
   
  -        SimpleWhereClause swc = new SimpleWhereClause(rootElement);
  -        swc.enableLogging(super.getLogger());
  +        BasicLXSQLCriteriaHelper basicCriteriaHelper = new BasicLXSQLCriteriaHelper(rootElement);
  +        basicCriteriaHelper.enableLogging(super.getLogger());
   
  -
  -        DeleteRows action = new BasicDeleteRows((AbstractQueryable) queryable, swc);
  +        DeleteRows action = new BasicDeleteRows((AbstractQueryable) queryable, 
  +                                new BasicCriteria(basicCriteriaHelper.getCriteria()));
   
           mParser.initializeAction(action);
           action.execute();
  
  
  
  1.9       +11 -8     jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql/BasicLXSQLCreateViewHandler.java
  
  Index: BasicLXSQLCreateViewHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql/BasicLXSQLCreateViewHandler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- BasicLXSQLCreateViewHandler.java	2001/11/29 08:46:26	1.8
  +++ BasicLXSQLCreateViewHandler.java	2001/11/29 10:35:55	1.9
  @@ -8,11 +8,10 @@
    */
   package org.apache.avalon.db.basic.handlers.lxsql;
   
  -
  -
   import org.apache.avalon.db.basic.parser.BasicLXSQLParser;
   import org.apache.avalon.db.basic.actions.BasicCreateView;
  -import org.apache.avalon.db.basic.actions.SimpleWhereClause;
  +import org.apache.avalon.db.basic.actions.BasicCriteria;
  +import org.apache.avalon.db.basic.actions.BasicLXSQLCriteriaHelper;
   import org.apache.avalon.db.basic.actions.BasicSelectSimple;
   import org.apache.avalon.db.services.DatabasePersistor;
   import org.apache.avalon.db.transport.Reply;
  @@ -34,7 +33,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.8 $
  + * @version $Revision: 1.9 $
    */
   public class BasicLXSQLCreateViewHandler extends BasicLXSQLQueryableHandler {
   
  @@ -82,12 +81,16 @@
                       columns = this.getColumns((Element) subRootNodes.item(i));
                   }
               }
  -
  -            SimpleWhereClause swc = new SimpleWhereClause(rootElement);
  -            swc.enableLogging(super.getLogger());
   
  +            BasicLXSQLCriteriaHelper basicCriteriaHelper = new BasicLXSQLCriteriaHelper(rootElement);
  +            basicCriteriaHelper.enableLogging(super.getLogger());
   
  -            CreateView action = new BasicCreateView(viewName, onName, columns ,swc);
  +            CreateView action = new BasicCreateView(
  +                                        viewName, 
  +                                        onName, 
  +                                        columns,
  +                                        new BasicCriteria(basicCriteriaHelper.getCriteria())
  +                                );
   
               mParser.initializeAction(action);
               action.execute();
  
  
  
  1.4       +11 -8     jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql/BasicLXSQLCreateAggregateViewHandler.java
  
  Index: BasicLXSQLCreateAggregateViewHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql/BasicLXSQLCreateAggregateViewHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BasicLXSQLCreateAggregateViewHandler.java	2001/11/29 08:46:26	1.3
  +++ BasicLXSQLCreateAggregateViewHandler.java	2001/11/29 10:35:55	1.4
  @@ -8,10 +8,9 @@
    */
   package org.apache.avalon.db.basic.handlers.lxsql;
   
  -
  -
   import org.apache.avalon.db.basic.parser.BasicLXSQLParser;
  -import org.apache.avalon.db.basic.actions.SimpleWhereClause;
  +import org.apache.avalon.db.basic.actions.BasicCriteria;
  +import org.apache.avalon.db.basic.actions.BasicLXSQLCriteriaHelper;
   import org.apache.avalon.db.basic.actions.BasicSelectSimple;
   import org.apache.avalon.db.basic.actions.BasicCreateAggregateView;
   import org.apache.avalon.db.services.DatabasePersistor;
  @@ -34,7 +33,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
   public class BasicLXSQLCreateAggregateViewHandler extends BasicLXSQLAggregateHandler {
   
  @@ -84,12 +83,16 @@
                       columns = this.getAggregateFunctionColumns((Element) subRootNodes.item(i));
                   }
               }
  -
  -            SimpleWhereClause swc = new SimpleWhereClause(rootElement);
  -            swc.enableLogging(super.getLogger());
   
  +            BasicLXSQLCriteriaHelper basicCriteriaHelper = new BasicLXSQLCriteriaHelper(rootElement);
  +            basicCriteriaHelper.enableLogging(super.getLogger());
   
  -            CreateAggregateView action = new BasicCreateAggregateView(viewName, onName,
columns ,swc);
  +            CreateAggregateView action = new BasicCreateAggregateView(
  +                                                viewName, 
  +                                                onName, 
  +                                                columns ,
  +                                                new BasicCriteria(basicCriteriaHelper.getCriteria())
  +                                         );
   
               mParser.initializeAction(action);
               action.execute();
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message