ColdBox/coldbox-platform — pull request #107 by existdissolve (2012-10-21 20:28:26+00:00)
Title: DetachedCriteria/SqlProjection for CB ORM

RE: https://groups.google.com/d/msg/coldbox/Do_PfxCkzhU/J55UfmXn-VMJ

A while back, I posted a suggestion in a thread seeking feature requests for CB 4. I suggested support for DetachedCriteria/Subqueries/etc., and I finally got around to putting together some ideas about this.

In general, the changes I've added allow more or less two things:

* Create a true subquery criteria via DetachedCriteria
* Create a sqlProjection CriteriaBuilder-style via DetachedCriteria

I've also added in sqlProjection and sqlGroupProjection to withProjections(), and tests should be in the pull request as well.

If you're interested, I put together a mini-website that explains my motivation for pursuing this, as well as live examples of the additions in action: http://cfgloss.com/subquery. The code for the site is here: https://github.com/existdissolve/ColdBox-CriteriaBuilder-Subqueries-Examples

When you get a chance to take a look, please let me know your thoughts. I'm definitely excited to help out however I can, and especially to learn, so any suggestions/constructive criticisms/etc. that you have would be very much appreciated!

Thanks!