Login | Register
My pages Projects Community openCollabNet

propel
Reply to message

* = Required fields
* Subject
* Body
Attachments
Send reply to
Topic
Author (directly in email)
Please type the letters in the image above.

Original message

Author Cameron Brunner <cameron.brunner@gmail.com>
Full name Cameron Brunner <cameron.brunner@gmail.com>
Date 2006-05-30 17:46:52 PDT
Message On 5/31/06, Alan Pinstein <apinstein at mac dot com> wrote:
> > That is correct, yes. I didn't put up any examples of the Query yet,
> > although you can see one in the ticket comments.
>
> Yeah, that looks nice.
>
> > Basically Query holds stuff that isn't strictly a "criteria". Of
> > course, the line is a little grey when it comes to things like HAVING
> > clause, which is a criteria ... but in those cases, the logic is that
> > Query holds things that don't make sense nested like Criteria.
>
> I wouldn't really consider HAVING a grey area. I think it's only grey
> b/c you defined criteria as the "where" clause, but if you change the
> definition of Criteria to be "result set selectors" which is
> semantically what criteria are anyway, then HAVING fits in nicely.
> Although maybe that means that paging should be moved to criteria as
> well?
>
> The other option would be to make Criteria strictly "where" clause
> stuff, and put HAVING (and LIMIT/OFFSET) into Query.
>
> Also, where does group by go? Does it even need to be handled by
> Criteria? Are criteria *solely* for selecting data which will be used
> in Propel-managed objects?
>
> I think that I am fine conceptually with Criteria / Query being more
> of a "Propel object selector" system than a general way to create
> queries, but others may certainly disagree. We just need to pick
> either direction so that we can state it in the spec. May require
> some further discussion and empirical data from Propel users.

Personally i quite like the idea that criteria can handle group by,
its a lot cleaner and also removes problems of identifier quoting on
the group by clause

eg:
$c = new Criteria();
// category_id
$c->addSelectColumn ( BackgroundPeer::CATEGORY_ID );
// COUNT(blah)
$c->addSelectColumn ( BackgroundPeer::COUNT );
// GROUP BY category_id
$c->addGroupByColumn ( BackgroundPeer::CATEGORY_ID );

is actual code i use so removing group by from it would be frustrating
for me personally.


Cameron