Re: generics and ObjectContext

From: Mikaël Cluseau (mikae..sinc.dyndns.org)
Date: Tue Nov 20 2007 - 14:55:18 EST

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

    Le mardi 20 novembre 2007 à 21:11 +0200, Andrus Adamchik a écrit :

    > I guess any query that does not take a class (SelectQuery may also be
    > entity-name based) would be Query<?>, resulting in List<?> returned.

    Query<Persistent>, indeed, since you can't put "new Query<?>()". Thus,
    someone could write about anything he wants, and I think it is a
    feature, since it allows you to say "I know what it will be". I.e. new
    SelectQuery<User>("User").

    I think only "SelectQuery" should the parametrized, and require a class
    to be constructed.

    Has the "setFetchingDataRow" been discussed ? Because
    context.performQuery wouldn't return the same kind on List with the same
    query object.

    ---- Random thoughts around that ----

    You may to consider that the query can have the "perform*" methods in
    the following way (may have been discussed in Jira, I dunno), and to
    allow chain commands :

    ObjectContext context = ...;
    List<User> results = new SelectQuery<User>(User.class)
            .andQualifier("registrationTime<?", new Date())
            .addOrder("registrationTime", "desc"),
            .addOrder("login")
            .fetch(); // or List<DataRow> [...].fetchRows();

    Making Query iterable instead of using performIteratedQuery would be
    better, too.

    Cheers,

    -- 
    Mikaël Cluseau <mc.isi.n..mail.com>
    ISI.NC
    



    This archive was generated by hypermail 2.0.0 : Tue Nov 20 2007 - 14:56:16 EST