generics and ObjectContext

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Nov 20 2007 - 12:02:44 EST

  • Next message: Kevin Menard: "Re: generics and ObjectContext"

    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



    This archive was generated by hypermail 2.0.0 : Tue Nov 20 2007 - 12:03:22 EST