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/basic/data BasicView.java
Date Fri, 14 Dec 2001 21:31:53 GMT
hammant     01/12/14 13:31:52

  Modified:    apps/db/src/java/org/apache/avalon/db/basic/actions
                        BasicCreateView.java
               apps/db/src/java/org/apache/avalon/db/basic/data
                        BasicView.java
  Log:
  create view working again
  
  Revision  Changes    Path
  1.16      +9 -7      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/actions/BasicCreateView.java
  
  Index: BasicCreateView.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/actions/BasicCreateView.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- BasicCreateView.java	2001/12/06 00:54:45	1.15
  +++ BasicCreateView.java	2001/12/14 21:31:52	1.16
  @@ -15,6 +15,7 @@
   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.data.DataException;
   import org.apache.avalon.db.data.impl.AbstractQueryable;
   import org.apache.avalon.db.basic.data.BasicTable;
   import org.apache.avalon.db.basic.data.BasicView;
  @@ -28,7 +29,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.15 $
  + * @version $Revision: 1.16 $
    */
   public class BasicCreateView extends BasicCreateQueryable implements CreateView {
   
  @@ -55,12 +56,13 @@
   
           System.out.println("cv execute");
   
  -        BasicView view = new BasicView(mViewName, mColumns, mOnQueryable, mBasicCriteria);
  -        view.enableLogging(this.getLogger());
  -
  -
  -
  -        mDatabasePersistor.addQueryable(mViewName, view);
  +        try {
  +            BasicView view = new BasicView(mViewName, mColumns, mOnQueryable, mBasicCriteria);
  +            view.enableLogging(this.getLogger());
  +            mDatabasePersistor.addQueryable(mViewName, view);
  +        } catch (DataException de) {
  +            throw new ActionException("Data Exception : " + de.getMessage());
  +        }
   
       }
   
  
  
  
  1.10      +9 -2      jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/data/BasicView.java
  
  Index: BasicView.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/db/src/java/org/apache/avalon/db/basic/data/BasicView.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- BasicView.java	2001/11/29 10:35:44	1.9
  +++ BasicView.java	2001/12/14 21:31:52	1.10
  @@ -25,7 +25,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.9 $
  + * @version $Revision: 1.10 $
    */
   public class BasicView extends AbstractView {
   
  @@ -33,7 +33,7 @@
       private Queryable mQueryable;
       private RowListener mRowListener;
   
  -    public BasicView(String name, Column[] columns, Queryable queryable, BasicCriteria
basicCriteria) {
  +    public BasicView(String name, Column[] columns, Queryable queryable, BasicCriteria
basicCriteria) throws DataException {
           super(name, columns);
           mBasicCriteria = basicCriteria;
           mQueryable = queryable;
  @@ -129,6 +129,13 @@
               }
           };
           queryable.addRowListener(mRowListener);
  +        Iterator it = queryable.getRows().iterator();
  +        while (it.hasNext()) {
  +            Row row = (Row) it.next();
  +            if(mBasicCriteria.testDataRow((BasicRow) row)) {
  +                addRow(row);
  +            }
  +        }
       }
   
       public Queryable getSourceQueryable() {
  
  
  

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