cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject generics and ObjectContext
Date Tue, 20 Nov 2007 17:02:44 GMT
Now that we have a method like this in ObjectContext:

    <T> T newObject(Class<T> persistentClass)

It is tempting to do this as well:

    List<T> performQuery(Query<T> query);

Unfortunately since the same query can be configured to return either  
objects or DataRows, a fixed definition of "Query<T>" is not  
possible. At least not with the current query API. Wonder if we  
should deprecate "setFetchingDataRows(boolean)" and instead use query  
wrappers for DataRow support. E.g.:

    SelectQuery<Artist> q = new SelectQuery(Artist.class);
    SelectQuery<DataRow> q1 = q.createDataRowQuery();


Thoughts?

Andrus


Mime
View raw message