avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/transport CreateTableRequest.java
Date Tue, 30 Oct 2001 08:40:29 GMT
hammant     01/10/30 00:40:29

  Modified:    apps/db/src/java/org/apache/avalon/db/data Row.java
               apps/db/src/java/org/apache/avalon/db/parser
                        DefaultSQLParser.java
               apps/db/src/java/org/apache/avalon/db/services
                        SQLParser.java
  Added:       apps/db/src/java/org/apache/avalon/db/data
                        ValidationException.java
               apps/db/src/java/org/apache/avalon/db/data/impl
                        AbstractTableRow.java
               apps/db/src/java/org/apache/avalon/db/transport
                        CreateTableRequest.java
  Removed:     apps/db/src/java/org/apache/avalon/db/data/impl Row.java
  Log:
  Start of work on Data impl
  
  Revision  Changes    Path
  1.2       +2 -2      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/Row.java
  
  Index: Row.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/Row.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Row.java	2001/10/28 14:09:20	1.1
  +++ Row.java	2001/10/30 08:40:28	1.2
  @@ -11,10 +11,10 @@
   
   
   /**
  - * Interface Row
  + * Interface AbstractTableRow
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version * $Revision: 1.1 $
  + * @version * $Revision: 1.2 $
    */
   public interface Row {}
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/ValidationException.java
  
  Index: ValidationException.java
  ===================================================================
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  
  package org.apache.avalon.db.data;
  
  public class ValidationException extends Exception {
      public ValidationException(String reason) {
          super(reason);
      }
  }
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/AbstractTableRow.java
  
  Index: AbstractTableRow.java
  ===================================================================
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.avalon.db.data.impl;
  
  import org.apache.avalon.db.data.Row;
  import org.apache.avalon.db.data.ValidationException;
  
  
  /**
   * Class AbstractTableRow
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version $Revision: 1.1 $
   */
  public abstract class AbstractTableRow implements Row {
  
  
    public void testLength(String name, String value, int maxLen) throws ValidationException
{
        if (value.length() > maxLen) {
            throw new ValidationException("String " + name + " should be a maximum of " +
maxLen + " characters long");
        }
    }
  
  }
  
  
  
  1.2       +9 -2      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/parser/DefaultSQLParser.java
  
  Index: DefaultSQLParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/parser/DefaultSQLParser.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultSQLParser.java	2001/10/28 14:09:21	1.1
  +++ DefaultSQLParser.java	2001/10/30 08:40:29	1.2
  @@ -13,7 +13,10 @@
   import org.apache.avalon.db.services.SQLParser;
   import org.apache.avalon.db.actions.Action;
   import org.apache.avalon.db.actions.Select;
  +import org.apache.avalon.db.actions.CreateTable;
   import org.apache.avalon.db.transport.Request;
  +import org.apache.avalon.db.transport.SelectRequest;
  +import org.apache.avalon.db.transport.CreateTableRequest;
   import org.apache.avalon.phoenix.Block;
   import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.context.Context;
  @@ -33,7 +36,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class DefaultSQLParser extends AbstractLoggable
           implements Block, SQLParser, Contextualizable, Composable, Configurable, Initializable
{
  @@ -102,7 +105,11 @@
        * @return
        *
        */
  -    public Select createSelectAction(Request request) {
  +    public Select createSelectAction(SelectRequest request) {
  +        return null;
  +    }
  +
  +    public CreateTable createCreateTableAction(CreateTableRequest request) {
           return null;
       }
   }
  
  
  
  1.2       +5 -1      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/services/SQLParser.java
  
  Index: SQLParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/services/SQLParser.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SQLParser.java	2001/10/28 14:09:21	1.1
  +++ SQLParser.java	2001/10/30 08:40:29	1.2
  @@ -9,12 +9,16 @@
   
   import org.apache.avalon.db.actions.Action;
   import org.apache.avalon.db.actions.Select;
  +import org.apache.avalon.db.actions.CreateTable;
   import org.apache.avalon.db.transport.Request;
  +import org.apache.avalon.db.transport.SelectRequest;
  +import org.apache.avalon.db.transport.CreateTableRequest;
   
   public interface SQLParser {
   
       // Resulting block may depend on ActionCache, DatabasePersistor & IndexGenerator
   
       Action createAction(Request request);
  -    Select createSelectAction(Request request);
  +    Select createSelectAction(SelectRequest request);
  +    CreateTable createCreateTableAction(CreateTableRequest request);
   }
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/transport/CreateTableRequest.java
  
  Index: CreateTableRequest.java
  ===================================================================
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.avalon.db.transport;
  
  
  
  /**
   * Class CreateTableRequest
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version $Revision: 1.1 $
   */
  public class CreateTableRequest extends WriteRequest {
  
      /**
       * Constructor CreateTableRequest
       *
       *
       * @param sql
       *
       */
      public CreateTableRequest(String sql) {
          super(CREATETABLE, sql);
      }
  }
  
  
  

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