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 CreateAggregateViewRequest.java Request.java
Date Sat, 24 Nov 2001 20:26:12 GMT
hammant     01/11/24 12:26:12

  Modified:    apps/db/src/java/org/apache/avalon/db/data/impl
                        AbstractAggregateRow.java AbstractTableRow.java
                        AbstractView.java
               apps/db/src/java/org/apache/avalon/db/test Tester.java
               apps/db/src/java/org/apache/avalon/db/transport Request.java
  Added:       apps/db/src/java/org/apache/avalon/db/actions
                        CreateAggregateView.java
               apps/db/src/java/org/apache/avalon/db/basic/actions
                        BasicCreateAggregateView.java
               apps/db/src/java/org/apache/avalon/db/basic/data
                        BasicAggregateRow.java BasicAggregateView.java
               apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql
                        BasicLXSQLCreateAggregateViewHandler.java
               apps/db/src/java/org/apache/avalon/db/data Key.java
               apps/db/src/java/org/apache/avalon/db/data/impl
                        AbstractAggregateView.java DefaultKey.java
               apps/db/src/java/org/apache/avalon/db/transport
                        CreateAggregateViewRequest.java
  Log:
  Aggregate views (start of)
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/actions/CreateAggregateView.java
  
  Index: CreateAggregateView.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.actions;
  
  
  
  /**
   * Interface CreateAggregateView
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version * $Revision: 1.1 $
   */
  public interface CreateAggregateView extends Create {
  
  }
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/actions/BasicCreateAggregateView.java
  
  Index: BasicCreateAggregateView.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.basic.actions;
  
  import org.apache.avalon.db.actions.ActionException;
  import org.apache.avalon.db.actions.CreateAggregateView;
  import org.apache.avalon.db.data.Column;
  import org.apache.avalon.db.data.Table;
  import org.apache.avalon.db.data.View;
  import org.apache.avalon.db.data.Queryable;
  import org.apache.avalon.db.basic.data.BasicTable;
  import org.apache.avalon.db.basic.data.BasicView;
  import org.apache.avalon.db.services.DatabasePersistor;
  
  import java.util.Vector;
  
  
  /**
   * Class BCELCreateTable
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version $Revision: 1.1 $
   */
  public class BasicCreateAggregateView extends BasicCreateQueryable implements CreateAggregateView
{
  
      private String mViewName, mOnName;
      private SimpleWhereClause mSimpleWhereClause;
  
      public BasicCreateAggregateView(String viewName, String onName, Column[] columns ,SimpleWhereClause
simpleWhereClause) {
          super(columns);
          mViewName = viewName;
          mOnName = onName;
          mSimpleWhereClause = simpleWhereClause;
      }
  
      public void initialize() throws ActionException {
      }
  
      /**
       * Method execute
       *
       *
       */
      public void execute() throws ActionException {
  
          System.out.println("cav execute");
  
          Queryable queryable = mDatabasePersistor.getQueryable(mOnName);
  
          BasicView view = new BasicView(mViewName, mColumns, queryable ,mSimpleWhereClause);
          view.enableLogging(this.getLogger());
  
  
  
          mDatabasePersistor.addQueryable(mViewName, view);
  
      }
  
      public void setDatabasePersistor(DatabasePersistor databasePersistor) {
          super.setDatabasePersistor(databasePersistor);
  
      }
  
      public int getRecordCount() {
          //return basicSelect.get..
          return 0; //TODO
      }
  }
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/data/BasicAggregateRow.java
  
  Index: BasicAggregateRow.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.basic.data;
  
  import org.apache.avalon.db.data.impl.AbstractAggregateRow;
  import org.apache.avalon.db.data.Column;
  import org.apache.avalon.db.data.Row;
  
  import java.util.Vector;
  import java.io.Serializable;
  
  public class BasicAggregateRow extends AbstractAggregateRow {
  
      protected Vector mRow;
      protected Column[] mColumns;
     
      private BasicTable mBasicTable;
  
      public BasicAggregateRow(BasicTable basicTable, Vector row) {
          super(basicTable);
          mBasicTable = basicTable;
          mColumns = basicTable.getColumns();
          mRow = row;
      }
  
      public Object getValue(String columnName) {
          for (int x = 0; x < mColumns.length; x++) {
              if (mColumns[x].getColumnName().equals(columnName)) {
                  return mRow.elementAt(x);
              }
          }
          return null; //TODO
      }
  
      public Column getColumn(String columnName) {
          return getColumn(columnName,true);
      }
  
      public Column getColumn(String columnName, boolean throwExcpt) {
          return mBasicTable.getColumn(columnName, throwExcpt);
      }
  
      public int getColumsLength() {
          return mColumns.length;
      }
  
      public Object getValue(int idx) {
          return mRow.elementAt(idx);
      }
  }
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/data/BasicAggregateView.java
  
  Index: BasicAggregateView.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.basic.data;
  
  import org.apache.avalon.db.data.impl.AbstractView;
  import org.apache.avalon.db.data.impl.AbstractAggregateView;
  import org.apache.avalon.db.data.Column;
  import org.apache.avalon.db.data.Queryable;
  import org.apache.avalon.db.data.RowListener;
  import org.apache.avalon.db.data.Row;
  import org.apache.avalon.db.data.DataException;
  import org.apache.avalon.db.basic.actions.BasicSelect;
  import org.apache.avalon.db.basic.actions.SimpleWhereClause;
  import org.apache.avalon.db.basic.actions.SimpleWhereClauseMatchingRowCallback;
  
  import java.util.Collection;
  import java.util.Iterator;
  
  /**
   * Class BasicView
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version $Revision: 1.1 $
   */
  public class BasicAggregateView extends AbstractAggregateView {
  
      private SimpleWhereClause mSimpleWhereClause;
      private Queryable mQueryable;
      private RowListener mRowListener;
  
      public BasicAggregateView(String name, Column[] columns, Queryable queryable, SimpleWhereClause
whereClause) {
          super(name, columns);
          mSimpleWhereClause = whereClause;
          mQueryable = queryable;
  
          mRowListener = new RowListener() {
              public void rowAdded(Queryable queryable, Row row) {
                  try {
                      if(mSimpleWhereClause.testDataRow((BasicRow) row)) {
                          addRow(row);
                      }
                  } catch (DataException de) {
                      getLogger().debug("(BasicView) Some exception during rowAdded",de);
                  }
              }
              public void rowDeleted(Queryable queryable, Row row) {
                  if(rowExists(row)) {
                      deleteRow(row);
                  }
              }
  
              public void rowChanged(Queryable queryable, Row row) {
                  try {
                      boolean exists = rowExists(row);
                      if(mSimpleWhereClause.testDataRow((BasicRow) row)) {
                          if (exists) {
                              // do nothing
                          } else {
                              deleteRow(row);
                          }
                      } else {
                          if (exists) {
                              addRow(row);
                          } else {
                              // do nothing
                          }
                      }
                  } catch (DataException de) {
                      getLogger().debug("(BasicView) Some exception during rowChanged",de);
                  }
              }
  
              public void rowsAdded(Queryable queryable, Collection rows) {
                  SimpleWhereClauseMatchingRowCallback cb = new SimpleWhereClauseMatchingRowCallback()
{
                      public void rowMatches(BasicRow row, boolean matches) {
                          if (matches) {
                              addRow(row);
                          } else {
                              deleteRow(row);
                          }
                      }
                  };
                  try {
                      mSimpleWhereClause.testDataRows(rows.iterator(), cb);
                  } catch (DataException de) {
                      getLogger().debug("(BasicView) Some exception during rowsAdded",de);
                  }
              }
  
              public void rowsDeleted(Queryable queryable, Collection rows) {
                  Iterator it = rows.iterator();
                  while (it.hasNext()) {
                      Row row = (Row) it.next();
                      if(rowExists(row)) {
                          deleteRow(row);
                      }
                  }
              }
  
              public void rowsChanged(Queryable queryable, Collection rows) {
                  SimpleWhereClauseMatchingRowCallback cb = new SimpleWhereClauseMatchingRowCallback()
{
                      public void rowMatches(BasicRow row, boolean matches) {
                          boolean exists = rowExists(row);
                          if (matches) {
                              if (exists) {
                                  // do nothing
                              } else {
                                  addRow(row);
                              }
                          } else {
                              if (exists) {
                                  deleteRow(row);
                              } else {
                                  // do nothing
                              }
                          }
                      }
                  };
                  try {
                      mSimpleWhereClause.testDataRows(rows.iterator(), cb);
                  } catch (DataException de) {
                      getLogger().debug("(BasicView) Some exception during rowsChanged",de);
                  }
              }
          };
          queryable.addRowListener(mRowListener);
      }
  
      public Queryable getSourceQueryable() {
          return mQueryable;
      }
  
  }
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/handlers/lxsql/BasicLXSQLCreateAggregateViewHandler.java
  
  Index: BasicLXSQLCreateAggregateViewHandler.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.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.BasicSelect;
  import org.apache.avalon.db.basic.actions.BasicCreateAggregateView;
  import org.apache.avalon.db.services.DatabasePersistor;
  import org.apache.avalon.db.transport.Reply;
  import org.apache.avalon.db.transport.Request;
  import org.apache.avalon.db.transport.WriteReply;
  import org.apache.avalon.db.transport.CreateAggregateViewRequest;
  import org.apache.avalon.db.actions.ActionException;
  import org.apache.avalon.db.actions.CreateAggregateView;
  import org.apache.avalon.db.data.Column;
  import org.apache.avalon.db.server.DBRequestContext;
  
  import org.w3c.dom.Document;
  import org.w3c.dom.Element;
  import org.w3c.dom.NodeList;
  
  
  /**
   * Class BasicLXSQLCreateAggregateViewHandler
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version $Revision: 1.1 $
   */
  public class BasicLXSQLCreateAggregateViewHandler extends BasicLXSQLQueryableHandler {
  
      /**
       * Constructor BasicLXSQLCreateAggregateViewHandler
       *
       *
       * @param parser
       * @param databasePersistor
       *
       */
      public BasicLXSQLCreateAggregateViewHandler(BasicLXSQLParser parser,
                                         DatabasePersistor databasePersistor) {
          super(parser, databasePersistor);
      }
  
      /**
       * Method handleRequest
       *
       *
       * @param request
       *
       * @return
       *
       * @throws ActionException
       *
       */
      public Reply handleRequest(DBRequestContext context, Request request) throws ActionException
{
  
          CreateAggregateViewRequest cavr = (CreateAggregateViewRequest) request;
          Document doc = mParser.parseLXSQLString(cavr.getSql());
          Element rootElement = doc.getDocumentElement();
          String viewName = rootElement.getAttribute("name");
          String onName = rootElement.getAttribute("on");
  
          if (mDatabasePersistor.queryableExists(viewName)) {
              throw new ActionException("View " + viewName + " already exists as a Table/View/Index");
          } else {
  
              Column[] columns = null;
              NodeList subRootNodes = rootElement.getChildNodes();
              for (int i = 0; i < subRootNodes.getLength(); i++) {
                  System.out.println(">>>"+subRootNodes.item(i).getNodeName());
                  if (subRootNodes.item(i).getNodeName().equals("columns")) {
                      columns = this.getColumns((Element) subRootNodes.item(i));
                  }
              }
  
              SimpleWhereClause swc = new SimpleWhereClause(rootElement);
              swc.enableLogging(super.getLogger());
  
  
              CreateAggregateView action = new BasicCreateAggregateView(viewName, onName,
columns ,swc);
  
              mParser.initializeAction(action);
              action.execute();
  
              return new WriteReply(action.getRecordCount());
          }
      }
  }
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/Key.java
  
  Index: Key.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;
  
  
  
  /**
   * Interface Key
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version * $Revision: 1.1 $
   */
  public interface Key extends Comparable {
  
      void addKeyElem(int pos, Object value);
  
  }
  
  
  
  1.2       +7 -1      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/AbstractAggregateRow.java
  
  Index: AbstractAggregateRow.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/AbstractAggregateRow.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractAggregateRow.java	2001/11/24 18:37:01	1.1
  +++ AbstractAggregateRow.java	2001/11/24 20:26:12	1.2
  @@ -19,7 +19,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 abstract class AbstractAggregateRow implements AggregateRow {
   
  @@ -27,11 +27,17 @@
   
       protected Vector mSourceRows = new Vector();
   
  +    protected DefaultKey mDefaultKey;
  +
       public AbstractAggregateRow(AbstractQueryable abstractQueryable) {
           mAbstractQueryable = abstractQueryable;
       }
   
       public Collection getSourceRows() {
           return mSourceRows;
  +    }
  +
  +    public DefaultKey getDefaultKey() {
  +        return mDefaultKey;
       }
   }
  
  
  
  1.5       +1 -19     jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/AbstractTableRow.java
  
  Index: AbstractTableRow.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/AbstractTableRow.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractTableRow.java	2001/11/18 14:18:02	1.4
  +++ AbstractTableRow.java	2001/11/24 20:26:12	1.5
  @@ -19,7 +19,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 abstract class AbstractTableRow implements Row {
   
  @@ -29,22 +29,4 @@
           mAbstractQueryable = abstractQueryable;
       }
   
  -    /**
  -     * Method testLength
  -     *
  -     *
  -     * @param name
  -     * @param value
  -     * @param maxLen
  -     *
  -     * @throws ValidationException
  -     *
  -     */
  -    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.5       +5 -5      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/AbstractView.java
  
  Index: AbstractView.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/AbstractView.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractView.java	2001/11/23 13:32:32	1.4
  +++ AbstractView.java	2001/11/24 20:26:12	1.5
  @@ -23,12 +23,12 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public abstract class AbstractView extends AbstractQueryable implements View {
   
   
  -    private Vector rows = new Vector();
  +    private Vector mRows = new Vector();
   
       /**
        * Constructor AbstractView
  @@ -43,15 +43,15 @@
       }
   
       public void addRow(AbstractTableRow atr) {
  -        rows.add(atr);
  +        mRows.add(atr);
       }
   
       public void removeRow(AbstractTableRow atr) {
  -        rows.remove(atr);
  +        mRows.remove(atr);
       }
   
       public Collection getRows() {
  -        return Collections.unmodifiableCollection(rows);
  +        return Collections.unmodifiableCollection(mRows);
       }
   
   
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/AbstractAggregateView.java
  
  Index: AbstractAggregateView.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.Queryable;
  import org.apache.avalon.db.data.Column;
  import org.apache.avalon.db.data.View;
  
  import java.util.Vector;
  import java.util.Collections;
  import java.util.Collection;
  import java.util.HashMap;
  
  
  /**
   * Class AbstractAggregateView
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version $Revision: 1.1 $
   */
  public abstract class AbstractAggregateView extends AbstractQueryable implements View {
  
  
      private HashMap mAggregateRows = new HashMap();
  
      /**
       * Constructor AbstractAggregateView
       *
       *
       * @param name
       * @param columns
       *
       */
      public AbstractAggregateView(String name, Column[] columns) {
          super(name, columns);
      }
  
      public void addRow(AbstractAggregateRow aar) {
          mAggregateRows.put(aar.getDefaultKey(), aar);
      }
  
      public void removeRow(AbstractTableRow atr) {
          mAggregateRows.remove(atr);
      }
  
      public Collection getRows() {
          return Collections.unmodifiableCollection(mAggregateRows.values());
      }
  
  
  
  }
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/data/impl/DefaultKey.java
  
  Index: DefaultKey.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.Key;
  
  /**
   * Class DefaultKey
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version $Revision: 1.1 $
   */
  public class DefaultKey implements Key {
  
      private Object[] mKeyElems;
  
      public DefaultKey(int elems) {
          mKeyElems = new Object[elems];
      }
  
      public void addKeyElem(int pos, Object value) {
          mKeyElems[pos] = value;
      }
  
      public int hashCode() {
          StringBuffer sb = new StringBuffer();
          for (int i = 0; i < mKeyElems.length; i++ ) {
              sb.append(mKeyElems[i].hashCode());
          }
          return sb.toString().hashCode();
      }
  
      public boolean equals(Object obj) {
          DefaultKey dk = (DefaultKey) obj;
          if (dk.mKeyElems.length != mKeyElems.length) {
              return false; // never happen?
          }
          for (int i = 0; i < mKeyElems.length; i++) {
              if (!dk.mKeyElems[i].equals(mKeyElems[i])) {
                  return false;
              }
          }
          return true;
      }
  
      public int compareTo(Object o) {
          DefaultKey dk = (DefaultKey) o; // never not a DK?
          if (dk.mKeyElems.length != mKeyElems.length) {
              throw new RuntimeException("Not comparable dummy");
          }
          for (int i = 0; i < mKeyElems.length; i++) {
              Comparable c0 = (Comparable) dk.mKeyElems[i];
              Comparable c1 = (Comparable) mKeyElems[i];
              int interimVal = c0.compareTo(c1);
              if (interimVal != 0) {
                  return interimVal;
              }
          }
          return 0;
      }
  }
  
  
  
  1.29      +15 -0     jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/test/Tester.java
  
  Index: Tester.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/test/Tester.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- Tester.java	2001/11/23 15:42:51	1.28
  +++ Tester.java	2001/11/24 20:26:12	1.29
  @@ -193,6 +193,21 @@
           }
           rs.close();
   
  +        System.err.println("VIEW 2 (surname aggregate)");
  +        st = mCon.createStatement();
  +        view = "<create-aggregate-view name=\"FlintstonesAggView\" on=\"Flintstones\">"
+
  +                         "<keys>" +
  +                             "<column name=\"surname\" type=\"varchar\" max=\"20\"/>"
+
  +                         "</keys>" +
  +                         "<columns>" +
  +                             "<count as=\"surCount\"/>" +
  +                         "</columns>" +
  +                      "</create-aggregate-view>";
  +
  +        st.execute(view);
  +        System.out.println("  Update Count : " + st.getUpdateCount());
  +        st.close();
  +
   
       }
   
  
  
  
  1.15      +2 -1      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/transport/Request.java
  
  Index: Request.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/transport/Request.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Request.java	2001/11/23 14:41:08	1.14
  +++ Request.java	2001/11/24 20:26:12	1.15
  @@ -18,7 +18,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.14 $
  + * @version $Revision: 1.15 $
    */
   public abstract class Request implements Serializable {
   
  @@ -51,6 +51,7 @@
       public static final int ESTABLISHCONNECTION = 136;
       public static final int CLOSESTATEMENT = 137;
       public static final int MAKESTATEMENT = 138;
  +    public static final int CREATEAGGREGATEVIEW = 139;
   
       private int mRequestCode;
       private String mRequestContextID;
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/transport/CreateAggregateViewRequest.java
  
  Index: CreateAggregateViewRequest.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 CreateAggregateViewRequest
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version $Revision: 1.1 $
   */
  public class CreateAggregateViewRequest extends WriteRequest {
  
      /**
       * Constructor CreateAggregateViewRequest
       *
       *
       * @param sql
       *
       */
      public CreateAggregateViewRequest(String sql) {
          super(CREATEAGGREGATEVIEW, 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