db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject Re: PATH QueryByCriteria
Date Mon, 05 Jul 2004 15:51:07 GMT
hi robert,

the methods are committed.

thanks
jakob

Robert S. Sfeir wrote:
> Hey guys,
> 
> Was wondering if someone could throw this little enhancement in for me. 
>  All it is is 2 new methods to allow people, including me :-), to submit 
> a String[] to orderByAscending and orderByDescending to facilitate 
> dynamic queries.  Yes this can be done via your own code, but hey why 
> not make it easier for folks.
> 
> R
> 
> 
> ------------------------------------------------------------------------
> 
> Index: QueryByCriteria.java
> ===================================================================
> RCS file: /home/cvspublic/db-ojb/src/java/org/apache/ojb/broker/query/QueryByCriteria.java,v
> retrieving revision 1.26
> diff -u -r1.26 QueryByCriteria.java
> --- QueryByCriteria.java	9 Jun 2004 20:00:44 -0000	1.26
> +++ QueryByCriteria.java	5 Jul 2004 02:43:24 -0000
> @@ -450,6 +450,26 @@
>      }
>  
>      /**
> +     * Adds an array  of fields for orderBy ASCENDING
> +     * @param  fieldName    Array of field names to be used
> +     */
> +    public void addOrderByAscending(String[] fieldNames)
> +    {
> +        for(int i = 0; i< fieldNames.length; i++ )
> +            addOrderBy(fieldNames[i], true);
> +    }
> +
> +    /**
> +     * Adds a field for orderBy DESCENDING
> +     * @param  fieldName    Array of field names to be used
> +     */
> +    public void addOrderByDescending(String[] fieldNames)
> +    {
> +        for(int i = 0; i< fieldNames.length; i++ )
> +            addOrderBy(fieldNames[i], false);
> +    }
> +
> +    /**
>       * Adds a field for orderBy DESCENDING
>       * @param  fieldName    The field name to be used
>       */
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message