cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Huss <johnth...@gmail.com>
Subject Re: svn commit: r1509274 - /cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
Date Thu, 01 Aug 2013 18:47:36 GMT
I'm not using it right now, but a good while ago Hugi, a former WO guy,
posted a subclass called ChainableOrdering that added a few methods that
provided a more fluent API for combining Orderings.  I had changed
Ordering.orderList to accept subclasses, but not SelectQuery, so it seemed
good to make it consistent as well.  Anyway, you never know what someone
might come up with.


On Thu, Aug 1, 2013 at 12:21 PM, Andrus Adamchik <andrus@objectstyle.org>wrote:

> Not that I have any objections, but I am wondering what good does it do
> for you to subclass Ordering?
>
> Andrus
>
>
> On Aug 1, 2013, at 6:03 PM, johnthuss@apache.org wrote:
>
> > Author: johnthuss
> > Date: Thu Aug  1 15:03:33 2013
> > New Revision: 1509274
> >
> > URL: http://svn.apache.org/r1509274
> > Log:
> > Allow an Ordering subclass to be used where Ordering is accepted
> >
> > Modified:
> >
>  cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
> >
> > Modified:
> cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
> > URL:
> http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java?rev=1509274&r1=1509273&r2=1509274&view=diff
> >
> ==============================================================================
> > ---
> cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
> (original)
> > +++
> cayenne/main/trunk/framework/cayenne-core-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
> Thu Aug  1 15:03:33 2013
> > @@ -91,7 +91,7 @@ public class SelectQuery<T> extends Qual
> >      *
> >      * @since 3.2
> >      */
> > -    public static <T> SelectQuery<T> query(Class<T> rootClass,
> Expression qualifier, List<Ordering> orderings) {
> > +    public static <T> SelectQuery<T> query(Class<T> rootClass,
> Expression qualifier, List<? extends Ordering> orderings) {
> >         return new SelectQuery<T>(rootClass, qualifier, orderings);
> >     }
> >
> > @@ -173,7 +173,7 @@ public class SelectQuery<T> extends Qual
> >      *            defines how to order the results, may be null.
> >      * @since 3.1
> >      */
> > -    public SelectQuery(ObjEntity root, Expression qualifier,
> List<Ordering> orderings) {
> > +    public SelectQuery(ObjEntity root, Expression qualifier, List<?
> extends Ordering> orderings) {
> >         this();
> >         this.init(root, qualifier);
> >         addOrderings(orderings);
> > @@ -215,7 +215,7 @@ public class SelectQuery<T> extends Qual
> >      *            defines how to order the results, may be null.
> >      * @since 3.1
> >      */
> > -    public SelectQuery(Class<T> rootClass, Expression qualifier,
> List<Ordering> orderings) {
> > +    public SelectQuery(Class<T> rootClass, Expression qualifier, List<?
> extends Ordering> orderings) {
> >         init(rootClass, qualifier);
> >         addOrderings(orderings);
> >     }
> > @@ -257,7 +257,7 @@ public class SelectQuery<T> extends Qual
> >      *            defines how to order the results, may be null.
> >      * @since 3.1
> >      */
> > -    public SelectQuery(DbEntity root, Expression qualifier,
> List<Ordering> orderings) {
> > +    public SelectQuery(DbEntity root, Expression qualifier, List<?
> extends Ordering> orderings) {
> >         this();
> >         this.init(root, qualifier);
> >         addOrderings(orderings);
> > @@ -290,7 +290,7 @@ public class SelectQuery<T> extends Qual
> >      *            defines how to order the results, may be null.
> >      * @since 3.1
> >      */
> > -    public SelectQuery(String objEntityName, Expression qualifier,
> List<Ordering> orderings) {
> > +    public SelectQuery(String objEntityName, Expression qualifier,
> List<? extends Ordering> orderings) {
> >         init(objEntityName, qualifier);
> >         addOrderings(orderings);
> >     }
> > @@ -497,7 +497,7 @@ public class SelectQuery<T> extends Qual
> >     /**
> >      * Adds a list of orderings.
> >      */
> > -    public void addOrderings(List<Ordering> orderings) {
> > +    public void addOrderings(List<? extends Ordering> orderings) {
> >         // If the supplied list of orderings is null, do not attempt to
> add
> >         // to the collection (addAll() will NPE otherwise).
> >         if (orderings != null)
> >
> >
> >
>
>

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message