Deprecating SelectQuery custom attributes option

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Dec 01 2008 - 14:07:48 EST

  • Next message: Kevin Menard: "[VOTE] 3.0M5 Release"

    Another thing I'd like to officially tag as "legacy" - SelectQuery
    "customDbAttributes" option that would allow to fetch a subset of
    columns as a DataRow. It's always been a hack and now there is a more
    or less direct replacement - EJBQL that allows to select individual
    *object* attributes. In fact it is more powerful, as it allows to
    traverse relationships:

       String ejbql = "select p.estimatedPrice, p.toArtist.artistName from
    Painting p order by p.estimatedPrice";
       EJBQLQuery query = new EJBQLQuery(ejbql);
       List<Object[]> data = context.performQuery(query);

    Also note that the returned result consists of Object[]'s, not
    DataRows. This can be much easier to parse in the calling code in many
    situations (with this morning trunk commits, potentially any type of
    query can generate an Object[] result... I'd like to start using that
    myself to get a feel of how much more usable this is compared to
    DataRows. Certainly less wasteful CPU and memory-wise).

    Anyways, unless I hear strong objections, I am going to deprecate
    SelectQuery custom attributes.

    Andrus



    This archive was generated by hypermail 2.0.0 : Mon Dec 01 2008 - 14:08:23 EST