AW: performing count

From: Peter Schröder (Peter.Schroede..reenet-ag.de)
Date: Mon Jun 04 2007 - 02:27:46 EDT

  • Next message: Andrus Adamchik: "Re: Creating Compound PKs"

    +1 from me

    -----Ursprüngliche Nachricht-----
    Von: Michael Gentry [mailto:blacknex..mail.com]
    Gesendet: Freitag, 1. Juni 2007 17:44
    An: use..ayenne.apache.org
    Betreff: Re: performing count

    Looking at that CountQuery class makes me think we should actually add it to
    Cayenne as a utility class. Perhaps with two additional methods added:

    public int getCount();
    public int getCount(DataContext dc);

    That way you could then do:

    CountQuery query = new CountQuery(Artist.class);
    int rowCount = query.getCount();

    or even:

    int rowCount = new CountQuery(Artist.class).getCount();

    I think that would simplify things and needing a count is a pretty comment
    activity. Perhaps for more flexibility, it would be good to have a
    constructor that could take a WHERE clause, too, in case you only need
    counts matching certain criteria.

    Thoughts?

    /dev/mrg



    This archive was generated by hypermail 2.0.0 : Mon Jun 04 2007 - 02:27:49 EDT