While tweaking QueryMetadata is often useful for custom queries, in
this case it is not needed. Two most-often used concrete query
classes, SelectQuery and SQLTemplate, define 'setFetchLimit' method
and 'setPageSize' method.
More on QueryMetadata... It is intended for Cayenne runtime to make
sense of an unknown query, not for query configuration. So usually
each concrete query provides setters for the subset of parameters
that make sense for this query, and then the query itself generates
appropriate metadata, hiding many details from the users.
Andrus
On Apr 16, 2007, at 2:50 PM, jerome moliere wrote:
Hi all,
playing around with cayenne, I'd like to set fetching limits and
page sizes
for my queries,
this seems to be done through QueryMetadata , but this interface
does not
provide any setter ..
So I'd like to know the proper way for forging its own metadata to
be passed
to the Query to be run...
I've seen a BaseMutableQueryMetadata class, but I guess I should
not be
obliged to make some uggly donwcasts, isn't it ?
Is there a way to hook in the Cayenne queries generation mechanism to
configure the QueryMetaData to be used with my own settings ?
Did'nt see this, but I may be blind -)
Thanks for your help
cheers
jerome
--
Jerome Moliere - Mentor/J
http://romjethoughts.blogspot.com/
auteur Eyrolles