Andrus Adamchik wrote:
>
> On Sep 9, 2005, at 12:28 AM, Gili wrote:
>
>> One thing I think the current Cayenne design does not provide
>> (nor the new one you are proposing) is the ability to control the
>> relationship queries. In your "List Property" example in the Wiki
>> page, how would I specify the query settings getEmployees() should use?
>
>
> Manually set a List implementation that does what you want ?
I was looking for this kind of functionality out-of-the-box in Cayenne.
I know we already use ToManyList under the hood. Would it be possible to
expose some Cayenne-specific interface to end-users which any
relationship List is guaranteed to implement which will allow setting
the query settings I mentioned? These are meant to be "hints" to Cayenne
as to what settings the user thinks are reasonable but it should be free
to ignore them when necessary. I guess I am asking you if this sounds
like a good idea to you and whether you think it would be ok to add this
to Cayenne (I'd put in the initial proof-of-concept work).
It would work something like this... relationships would return type
QueryResult (just a name I made up) instead of List, where QueryResult
is an interface that extends List. Users would then be able to invoke:
// normal operations
List childrenThemes = theme.getChildren()
// or, alternatively...
QueryResult childrenThemes = theme.getChildren();
childrenThemes.setPageSize(10);
childrenThemes.setFetchLimit(50);
Gili
-- http://www.desktopbeautifier.com/
This archive was generated by hypermail 2.0.0 : Fri Sep 09 2005 - 02:40:02 EDT