db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/query QueryBySQL.java QueryByCriteria.java Query.java QueryByIdentity.java
Date Fri, 14 Mar 2003 16:49:58 GMT
brj         2003/03/14 08:49:57

  Modified:    src/java/org/apache/ojb/broker/query QueryBySQL.java
                        QueryByCriteria.java Query.java
                        QueryByIdentity.java
  Log:
  new methods betOrderBy() and getGroupBy()
  
  Revision  Changes    Path
  1.4       +18 -1     db-ojb/src/java/org/apache/ojb/broker/query/QueryBySQL.java
  
  Index: QueryBySQL.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/QueryBySQL.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- QueryBySQL.java	10 Mar 2003 20:38:09 -0000	1.3
  +++ QueryBySQL.java	14 Mar 2003 16:49:56 -0000	1.4
  @@ -1,5 +1,7 @@
   package org.apache.ojb.broker.query;
   
  +import java.util.List;
  +
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  @@ -128,10 +130,25 @@
   		return false;
   	}
   
  +	/* (non-Javadoc)
  +	 * @see org.apache.ojb.broker.query.Query#getGroupBy()
  +	 */
  +	public List getGroupBy()
  +	{
  +		return null;
  +	}
  +
  +	/* (non-Javadoc)
  +	 * @see org.apache.ojb.broker.query.Query#getOrderBy()
  +	 */
  +	public List getOrderBy()
  +	{
  +		return null;
  +	}
  +
       public String toString()
       {
           return "Query from " + clazz + " sql= " + sql;
       }
  -
   
   }
  
  
  
  1.8       +31 -0     db-ojb/src/java/org/apache/ojb/broker/query/QueryByCriteria.java
  
  Index: QueryByCriteria.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/QueryByCriteria.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- QueryByCriteria.java	10 Mar 2003 20:38:09 -0000	1.7
  +++ QueryByCriteria.java	14 Mar 2003 16:49:56 -0000	1.8
  @@ -61,6 +61,7 @@
   import org.apache.ojb.broker.util.logging.LoggerFactory;
   
   import java.util.HashMap;
  +import java.util.List;
   
   /**
    * represents a search by criteria.
  @@ -313,6 +314,36 @@
   	public void setHavingCriteria(Criteria havingCriteria)
   	{
   		m_havingCriteria = havingCriteria;
  +	}
  +
  +	/* (non-Javadoc)
  +	 * @see org.apache.ojb.broker.query.Query#getGroupBy()
  +	 */
  +	public List getGroupBy()
  +	{
  +        if (getCriteria() != null)
  +        {
  +            return getCriteria().getGroupby();
  +        }
  +        else
  +        {
  +            return null;
  +        }
  +	}
  +
  +	/* (non-Javadoc)
  +	 * @see org.apache.ojb.broker.query.Query#getOrderBy()
  +	 */
  +	public List getOrderBy()
  +	{
  +        if (getCriteria() != null)
  +        {
  +            return getCriteria().getOrderby();
  +        }
  +        else
  +        {
  +            return null;
  +        }
   	}
   
   }
  
  
  
  1.8       +50 -34    db-ojb/src/java/org/apache/ojb/broker/query/Query.java
  
  Index: Query.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/Query.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Query.java	14 Mar 2003 16:40:32 -0000	1.7
  +++ Query.java	14 Mar 2003 16:49:56 -0000	1.8
  @@ -1,5 +1,7 @@
   package org.apache.ojb.broker.query;
   
  +import java.util.List;
  +
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  @@ -86,30 +88,44 @@
   	public static final boolean SCROLLABLE = true;
   	public static final boolean NOT_SCROLLABLE = false;
   
  -    /**
  -     * return the criteria of the query if present or null.
  -     */
  -    public abstract Criteria getCriteria();
  -
  -    /**
  -     * return the criteria of the query if present or null.
  -     */
  -    public abstract Criteria getHavingCriteria();
  -
  -    /**
  -     * return the template Object if present or null
  -     */
  -    public abstract Object getExampleObject();
  -
  -    /**
  -     * return the target class, representing the extend to be searched
  -     */
  -    public abstract Class getSearchClass();
  -
  -    /**
  -     *  return true if select DISTINCT should be used
  -     */
  -    public boolean isDistinct();
  +	/**
  +	 * return the criteria of the query if present or null.
  +	 */
  +	public abstract Criteria getCriteria();
  +
  +	/**
  +	 * return the criteria of the query if present or null.
  +	 */
  +	public abstract Criteria getHavingCriteria();
  +
  +	/**
  +	 * return the template Object if present or null
  +	 */
  +	public abstract Object getExampleObject();
  +
  +	/**
  +	 * return the target class, representing the extend to be searched
  +	 */
  +	public abstract Class getSearchClass();
  +
  +	/**
  +	 *  return true if select DISTINCT should be used
  +	 */
  +	public boolean isDistinct();
  +
  +	/**
  +	 * Answer the orderBy of all Criteria and Sub Criteria the elements are of
  +	 * class Criteria. FieldHelper
  +	 * @return List of Criteria.FieldHelper
  +	 */
  +	public List getOrderBy();
  +
  +	/**
  +	 * Gets the groupby for ReportQueries of all Criteria and Sub Criteria
  +	 * the elements are of class Criteria. FieldHelper
  +	 * @return List of Criteria.FieldHelper
  +	 */
  +	public List getGroupBy();
   
   	/**
   	 *
  @@ -118,10 +134,10 @@
   	 */
   	int getStartAtIndex();
   
  -        /**
  -         * Set the row at which the query should start retrieving results, inclusive.
  -         * @param startAtIndex starting index, inclusive.
  -         */
  +	/**
  +	 * Set the row at which the query should start retrieving results, inclusive.
  +	 * @param startAtIndex starting index, inclusive.
  +	 */
   	void setStartAtIndex(int startAtIndex);
   
   	/**
  @@ -131,13 +147,13 @@
   	 */
   	int getEndAtIndex();
   
  -        /**
  -         * Set the row at which the query should stop retieving results, exlusive.
  -         * @param endAtIndex ending index, exclusive
  -         */
  +	/**
  +	 * Set the row at which the query should stop retieving results, exlusive.
  +	 * @param endAtIndex ending index, exclusive
  +	 */
   	void setEndAtIndex(int endAtIndex);
   
   	void fullSize(int size);
   	int fullSize();
  -	
  +
   }
  
  
  
  1.5       +18 -1     db-ojb/src/java/org/apache/ojb/broker/query/QueryByIdentity.java
  
  Index: QueryByIdentity.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/QueryByIdentity.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- QueryByIdentity.java	10 Mar 2003 20:38:09 -0000	1.4
  +++ QueryByIdentity.java	14 Mar 2003 16:49:56 -0000	1.5
  @@ -54,6 +54,8 @@
    * <http://www.apache.org/>.
    */
   
  +import java.util.List;
  +
   import org.apache.ojb.broker.Identity;
   
   /**
  @@ -144,5 +146,20 @@
   		return false;
   	}
   
  +	/* (non-Javadoc)
  +	 * @see org.apache.ojb.broker.query.Query#getGroupBy()
  +	 */
  +	public List getGroupBy()
  +	{
  +		return null;
  +	}
  +
  +	/* (non-Javadoc)
  +	 * @see org.apache.ojb.broker.query.Query#getOrderBy()
  +	 */
  +	public List getOrderBy()
  +	{
  +		return null;
  +	}
   
   }
  
  
  

Mime
View raw message