+1.

Although having truly generified queries would be useful in many situations, I think it's too late in the dev. cycle for 3.0 to add this now.


Robert

On Oct 16, 2009, at 10/1612:55 PM , Andrus Adamchik wrote:


On Oct 16, 2009, at 8:04 PM, Andrey Razumovsky wrote:

Actually, as already mentioned, we need to do something around CAY-942
(query generics). This is very critical and desired API change

Not sure if we have another more precise Jira (since generics in relationships mentioned in this Jira have already been added).

Anyways, if we are talking about query generics, I did some research and prototyping of that in the past. My conclusion is that to do it right it has to be a rather dramatic change in Cayenne, affecting not simply the code, but a number design concepts. Essentially we have too many variables to squeeze into a rather rigid Java generics engine. To start, here is possible query result types:

? extends Persistent
? extends Object (unfinished POJO implementation)
CayenneDataObject (as in "generic persistence" [1])
DataRow
scalar
Object[] (a mix of scalars and any of the above)

I don't see how we can easily parameterize that in a meaningful way.

So my vote is to postpone this till 3.1 and make it a 3.1 priority to create an appropriate generics based query design, and maybe reduce the number of options. I don't think significantly delaying and radically changing 3.0 (that has been de-facto stable for some time) is a good idea.

Andrus

[1] http://cayenne.apache.org/doc/generic-persistent-class.html



Reply via email to