db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer JdbcAccess.java
Date Sat, 28 Dec 2002 11:28:02 GMT
arminw      2002/12/28 03:28:01

  Modified:    src/java/org/apache/ojb/soda QueryImpl.java
               src/java/org/apache/ojb/broker/singlevm
                        PersistenceBrokerImpl.java
               src/java/org/apache/ojb/broker/accesslayer JdbcAccess.java
  Log:
  use OJBRuntimeException instead
  of RuntimeException
  
  Revision  Changes    Path
  1.3       +116 -115  jakarta-ojb/src/java/org/apache/ojb/soda/QueryImpl.java
  
  Index: QueryImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/soda/QueryImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- QueryImpl.java	17 Jun 2002 19:34:33 -0000	1.2
  +++ QueryImpl.java	28 Dec 2002 11:28:00 -0000	1.3
  @@ -1,4 +1,4 @@
  -package org.apache.ojb.soda;
  +package org.apache.ojb.soda;
   
   /* ====================================================================
    * The Apache Software License, Version 1.1
  @@ -53,117 +53,118 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    */
  -
  -import java.io.Serializable;
  -
  -import org.odbms.Constraint;
  -import org.odbms.ObjectSet;
  -import org.odbms.Query;
  -
  -/**
  - * @version 	1.0
  - * @author Thomas Mahler
  - */
  -public class QueryImpl implements Query, Serializable
  -{
  -
  -	private org.apache.ojb.broker.query.Query ojbQuery = null;
  -	
  -	private int limitCount = -1;
  -	
  -    /**
  -     * Constructor for QueryImpl.
  -     */
  -    public QueryImpl()
  -    {
  -        super();
  -    }
  -
  -    /**
  -     * wrapping constructor. needed only as long we
  -     * don't support the soda constraint stuff.
  -     */
  -    public QueryImpl(org.apache.ojb.broker.query.Query query)
  -    {
  -        super();
  -        ojbQuery = query;
  -    }
  -
  -
  -    /*
  -     * @see Query#constrain(Object)
  -     */
  -    public Constraint constrain(Object example)
  -    {
  -        return null;
  -    }
  -
  -    /*
  -     * @see Query#execute()
  -     */
  -    public ObjectSet execute()
  -    {
  -        // in future versions soda queries will be translated
  -        // into org.apache.ojb.broker.query.Query objects and placed
  -        // into the ojbQuery member variable.
  -        
  -        if (ojbQuery != null)
  -        {
  -            return new ObjectSetImpl(ojbQuery, limitCount);
  -        }
  -        else throw new RuntimeException("internal ojbQuery not filled. Can't execute this
query yet!");
  -    }
  -
  -    /*
  -     * @see Query#descendant(String)
  -     */
  -    public Query descendant(String path)
  -    {
  -        return this;
  -    }
  -
  -    /*
  -     * @see Query#parent(String)
  -     */
  -    public Query parent(String path)
  -    {
  -        return this;
  -    }
  -
  -    /*
  -     * @see Query#limitSize(int)
  -     */
  -    public Query limitSize(int count)
  -    {
  -        limitCount = count;
  -        return this;
  -    }
  -
  -    /*
  -     * @see Query#orderAscending()
  -     */
  -    public Query orderAscending()
  -    {
  -        return this;
  -    }
  -
  -    /*
  -     * @see Query#orderDescending()
  -     */
  -    public Query orderDescending()
  -    {
  -        return this;
  -    }
  -
  -
  -    /**
  -     * Sets the ojbQuery, needed only as long we
  -     * don't support the soda constraint stuff.
  -     * @param ojbQuery The ojbQuery to set
  -     */
  -    public void setOjbQuery(org.apache.ojb.broker.query.Query ojbQuery)
  -    {
  -        this.ojbQuery = ojbQuery;
  -    }
  -
  -}
  +
  +import java.io.Serializable;
  +
  +import org.odbms.Constraint;
  +import org.odbms.ObjectSet;
  +import org.odbms.Query;
  +import org.apache.ojb.broker.OJBRuntimeException;
  +
  +/**
  + * @version 	1.0
  + * @author Thomas Mahler
  + */
  +public class QueryImpl implements Query, Serializable
  +{
  +
  +	private org.apache.ojb.broker.query.Query ojbQuery = null;
  +
  +	private int limitCount = -1;
  +
  +    /**
  +     * Constructor for QueryImpl.
  +     */
  +    public QueryImpl()
  +    {
  +        super();
  +    }
  +
  +    /**
  +     * wrapping constructor. needed only as long we
  +     * don't support the soda constraint stuff.
  +     */
  +    public QueryImpl(org.apache.ojb.broker.query.Query query)
  +    {
  +        super();
  +        ojbQuery = query;
  +    }
  +
  +
  +    /*
  +     * @see Query#constrain(Object)
  +     */
  +    public Constraint constrain(Object example)
  +    {
  +        return null;
  +    }
  +
  +    /*
  +     * @see Query#execute()
  +     */
  +    public ObjectSet execute()
  +    {
  +        // in future versions soda queries will be translated
  +        // into org.apache.ojb.broker.query.Query objects and placed
  +        // into the ojbQuery member variable.
  +
  +        if (ojbQuery != null)
  +        {
  +            return new ObjectSetImpl(ojbQuery, limitCount);
  +        }
  +        else throw new OJBRuntimeException("internal ojbQuery not filled. Can't execute
this query yet!");
  +    }
  +
  +    /*
  +     * @see Query#descendant(String)
  +     */
  +    public Query descendant(String path)
  +    {
  +        return this;
  +    }
  +
  +    /*
  +     * @see Query#parent(String)
  +     */
  +    public Query parent(String path)
  +    {
  +        return this;
  +    }
  +
  +    /*
  +     * @see Query#limitSize(int)
  +     */
  +    public Query limitSize(int count)
  +    {
  +        limitCount = count;
  +        return this;
  +    }
  +
  +    /*
  +     * @see Query#orderAscending()
  +     */
  +    public Query orderAscending()
  +    {
  +        return this;
  +    }
  +
  +    /*
  +     * @see Query#orderDescending()
  +     */
  +    public Query orderDescending()
  +    {
  +        return this;
  +    }
  +
  +
  +    /**
  +     * Sets the ojbQuery, needed only as long we
  +     * don't support the soda constraint stuff.
  +     * @param ojbQuery The ojbQuery to set
  +     */
  +    public void setOjbQuery(org.apache.ojb.broker.query.Query ojbQuery)
  +    {
  +        this.ojbQuery = ojbQuery;
  +    }
  +
  +}
  
  
  
  1.98      +7 -6      jakarta-ojb/src/java/org/apache/ojb/broker/singlevm/PersistenceBrokerImpl.java
  
  Index: PersistenceBrokerImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/singlevm/PersistenceBrokerImpl.java,v
  retrieving revision 1.97
  retrieving revision 1.98
  diff -u -r1.97 -r1.98
  --- PersistenceBrokerImpl.java	24 Dec 2002 13:20:03 -0000	1.97
  +++ PersistenceBrokerImpl.java	28 Dec 2002 11:28:01 -0000	1.98
  @@ -75,6 +75,7 @@
   import org.apache.ojb.broker.TransactionInProgressException;
   import org.apache.ojb.broker.TransactionNotInProgressException;
   import org.apache.ojb.broker.VirtualProxy;
  +import org.apache.ojb.broker.OJBRuntimeException;
   import org.apache.ojb.broker.accesslayer.*;
   import org.apache.ojb.broker.accesslayer.sql.SqlGenerator;
   import org.apache.ojb.broker.accesslayer.sql.SqlGeneratorFactory;
  @@ -560,7 +561,7 @@
                           }
                           else
                           {
  -                            throw new RuntimeException(
  +                            throw new OJBRuntimeException(
                                       col.getClass()
                                       + " can not be managed by OJB, use Array, Collection
or ManageableCollection instead !");
                           }
  @@ -704,8 +705,9 @@
   
       /**
        * Store collections of objects poiting to <b>obj</b>.
  -     * All object which have a FK poiting to this object (Via CollectionDescriptors) will
be stored if auto-update is true <b>AND</b>
  -     * the member field containing the object reference if NOT null.
  +     * All object which have a FK poiting to this object (Via CollectionDescriptors)
  +     * will be stored if auto-update is true <b>AND</b>
  +     * the member field containing the object reference is NOT null.
        *
        * @param obj Object which we will store collections for
        * @param vecCds vector of ObjectRederenceDescriptors
  @@ -758,7 +760,7 @@
                   }
                   else
                   {
  -                    throw new RuntimeException(
  +                    throw new OJBRuntimeException(
                               col.getClass()
                               + " can not be managed by OJB, use Array, Collection or ManageableCollection
instead !");
                   }
  @@ -927,7 +929,6 @@
               deleteStmt = sqlGenerator.getDeleteStatement(table, pkColumns, pkValues, fkColumns,
fkValues);
               dbAccess.executeUpdateSQL(deleteStmt, cld);
           }
  -
       }
   
       /**
  
  
  
  1.27      +4 -4      jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer/JdbcAccess.java
  
  Index: JdbcAccess.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/accesslayer/JdbcAccess.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- JdbcAccess.java	28 Dec 2002 10:52:27 -0000	1.26
  +++ JdbcAccess.java	28 Dec 2002 11:28:01 -0000	1.27
  @@ -67,6 +67,7 @@
   import org.apache.ojb.broker.PersistenceBroker;
   import org.apache.ojb.broker.PersistenceBrokerException;
   import org.apache.ojb.broker.PersistenceBrokerSQLException;
  +import org.apache.ojb.broker.OJBRuntimeException;
   import org.apache.ojb.broker.metadata.ClassDescriptor;
   import org.apache.ojb.broker.metadata.FieldDescriptor;
   import org.apache.ojb.broker.query.Query;
  @@ -331,7 +332,6 @@
           throws PersistenceBrokerException
       {
           if (logger.isDebugEnabled()) logger.debug("executeUpdateSQL: " + sqlStatement);
  -
           int result;
           Statement stmt = null;
           try
  @@ -611,7 +611,7 @@
                   }
               default :
                   {
  -                    throw new RuntimeException(
  +                    throw new OJBRuntimeException(
                           "The type "
                               + jdbcType
                               + " for attribute "
  @@ -753,7 +753,7 @@
                   }
               default :
                   {
  -                    throw new RuntimeException(
  +                    throw new OJBRuntimeException(
                           "The type "
                               + jdbcType
                               + " for attribute "
  
  
  

Mime
View raw message