While using SQLObject, I find myself CONSTANTLY wanting to use Group By 
in selects for my SQLObject classes. I know that Oleg has mentioned 
before that Group By's don't make sense in select for a SQL object, but 
I think they do! As long as you are selecting all of the rows from the 
table that correspond to the given SQLObject, why should SQLObject care 
if you are using a Group By or not? It can still take those results and 
turn them into instances of your SQLObject class if you have selected 
all of the necessary rows. That's all it should care about.

The reason why I want Group By so badly is because there are some 
orderings that can only be accomplished by using them. Group By changes 
the behaviou of the accumulation functions that are used in the Order By 
statement, allowing you to do things like sort by the number of objects 
joined in a one-to-many or many-to-many relationship, or sort by the 
latest reply date in a forum.

Anyway, I guess what I'm asking is, why can't I just give an arbitrary 
select statement to a SQLObject class and have it return me the 
SelectResults instance for the records described? As long as I make sure 
to select tablename.* for the class in question, everything should be fine?

But this isn't allowed, and it's making my life really difficult.

The "ORM" way of going through each parent record and manually counting 
the joined objects and then programmatically sorting the resulting list 
is REALLY inefficient when compared to a single query.

Any thoughts on this? Am I not seeing a huge issue here? This would be 
such a nice feature!

- Sean


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to