Login | Register
My pages Projects Community openCollabNet

Reply to message

2020-03-13: This site is going to be decommissioned and shut down very soon. Please copy and archive any data you wish to keep ASAP

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

Original message

Author hlellelid
Full name Hans Lellelid
Date 2006-05-29 11:51:30 PDT
Message Hi Alan,

Sure, I'll put together some more complex examples. In particular, the
logical complex stuff that was so painful before (getNewCriterion(....))
should now be very simple; I'll put together some before & after
examples (Criteria vs. Criteria2).

Also, the new model should make custom SQL straightforward, so I'll put
together some examples of that.

The new Criteria/Query system is still built around Propel, though, so
there's no support for things like custom select columns that are
functions. We could add this, but I'm not sure if it has any
application in Propel & I don't want to complicate the code for
scenarios that will never happen. That said, I think we should make the
package extensible so that people could build off of it for their own
query-building applications.

The basic distinction between Criteria and my Query class (open for
renaming suggestions) is that Criteria handles stuff that goes in a
WHERE-clause. That way, Criteria can be used for UPDATE and DELETE
statements in addition to SELECT queries. The Query class handles
things like adding select columns, specifying order-by, limit, offset,
group by, having, etc. The Query class is instantiated with a Criteria
object, so there is a sense that every query has some Criteria
associated with it -- and, of course, that Criteria object could have
nested Criteria, etc.

Hope that helps make Query a bit clearer. (Check out the more recent
email & ticket for more up-to-date examples than the wiki page.)


Alan Pinstein wrote:
> Thanks for kicking this off.
> I posted something about a year ago (I can't believe I've been using
> Propel for a year!) and I think most of the comments are still relevant:
> http://propel.tigris​.org/servlets/ReadMs​g?list=dev&msgNo​=609
> You've got a good start, but as you've mentioned, Criteria is currently
> good at simple things but not a complex ones. Yet your examples on the
> planning page are still relatively simply queries.
> I think we should think about the interface for the more complicated
> parts as well:
> 1) Joining and table aliasing
> 2) Sorting and pagination
> Can you explain the Query* classes more?
> I'd be happy to contribute time to flushing out design over the next few
> weeks.
> Thanks!
> Alan
> On May 26, 2006, at 2:37 PM, Hans Lellelid wrote:
>> Hi -
>> I put together a rough proposal/strategy for a new Criteria API on the
>> wiki page.
>> http://propel.phpdb.​org/trac/wiki/Develo​pment/Criteria
>> The implementation is still only very loosely conceptual and it doesn't
>> address all the functionality of the current system yet. It does,
>> however, provide a more consistent & somewhat more intuitive system
>> (both to use & to develop, in my opinion). The design is based loosely
>> on the Hibernate Criteria API and the way that the logical expressions
>> are handled by Phing's Condition system.
>> I think it's a good starting point, and would be interested in any
>> comments at this point.
>> Hans
>> --------------------​--------------------​--------------------​---------
>> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
>> For additional commands, e-mail: dev-help at propel dot tigris dot org
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org