Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [propel-dev] Criteria proposal

propel
Discussion topic

Back to topic list

Re: [propel-dev] Criteria proposal

Reply

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.)

Hans

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
>

« Previous message in topic | 10 of 25 | Next message in topic »

Messages

Show all messages in topic

Criteria proposal hlellelid Hans Lellelid 2006-05-26 11:37:28 PDT
     Re: [propel-dev] Criteria proposal Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2006-05-26 22:12:34 PDT
         Re: [propel-dev] Criteria proposal =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2006-05-27 04:30:33 PDT
             Re: [propel-dev] Criteria proposal Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2006-05-27 05:02:31 PDT
                 Re: [propel-dev] Criteria proposal =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com> 2006-05-27 08:17:09 PDT
                     Re: [propel-dev] Criteria proposal hlellelid Hans Lellelid 2006-05-27 09:43:15 PDT
     Re: [propel-dev] Criteria proposal Ants Aasma <ants dot aasma at gmail dot com> Ants Aasma <ants dot aasma at gmail dot com> 2006-05-27 12:47:55 PDT
         Re: [propel-dev] Criteria proposal hlellelid Hans Lellelid 2006-05-27 14:21:23 PDT
     Re: [propel-dev] Criteria proposal Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-05-29 09:03:50 PDT
         Re: [propel-dev] Criteria proposal hlellelid Hans Lellelid 2006-05-29 11:51:30 PDT
         Re: [propel-dev] Criteria proposal hlellelid Hans Lellelid 2006-05-30 06:24:56 PDT
             Re: [propel-dev] Criteria proposal Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-05-30 07:16:34 PDT
                 Re: [propel-dev] Criteria proposal hlellelid Hans Lellelid 2006-05-30 07:48:57 PDT
                     Re: [propel-dev] Criteria proposal Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2006-05-30 17:09:25 PDT
                     Re: [propel-dev] Criteria proposal Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-05-30 17:34:24 PDT
                         Re: [propel-dev] Criteria proposal Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2006-05-30 17:46:52 PDT
                         Re: [propel-dev] Criteria proposal hlellelid Hans Lellelid 2006-05-30 18:43:06 PDT
                             Re: [propel-dev] Criteria proposal tamcy <7am dot online at gmail dot com> tamcy <7am dot online at gmail dot com> 2006-05-31 00:02:11 PDT
                                 Re: [propel-dev] Criteria proposal hlellelid Hans Lellelid 2006-05-31 04:36:50 PDT
                             Re: [propel-dev] Criteria proposal Ants Aasma <ants dot aasma at gmail dot com> Ants Aasma <ants dot aasma at gmail dot com> 2006-05-31 04:06:51 PDT
                                 Re: [propel-dev] Criteria proposal Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-05-31 05:12:11 PDT
                                 Re: [propel-dev] Criteria proposal hlellelid Hans Lellelid 2006-05-31 05:49:59 PDT
                                     Re: [propel-dev] Criteria proposal Alan Pinstein <apinstein at mac dot com> Alan Pinstein <apinstein at mac dot com> 2006-05-31 06:05:32 PDT
                                         Re: [propel-dev] Criteria proposal hlellelid Hans Lellelid 2006-05-31 06:21:31 PDT
                                         Re: [propel-dev] Criteria proposal Ants Aasma <ants dot aasma at gmail dot com> Ants Aasma <ants dot aasma at gmail dot com> 2006-05-31 09:09:12 PDT
Messages per page: