first of all you cannot use two set filter parameter

qry2.setFilter("key == keyParam");
qry2.setFilter("initialVersion <= version");

this is invalid.
qry2.setFilter("key == keyParam && initialVersion <= version");
combine them in one like that
and you cannot use two declare paramether either.

here is an example
http://openimageserver.svn.sourceforge.net/viewvc/openimageserver/OpenImageServer/tags/0.2.94%20beta/src/ois/model/impl/ModelManagerImpl.java?revision=98&view=markup
in line 188 you can see the query you are looking for (in
getImageFileByName method)

On May 30, 5:47 pm, Dormand <[email protected]> wrote:
> Hi, I have a persistance class. now i want to query with its key and
> other one field.
> I have tried in this waya
>
> Query qry2 = pm.newQuery(File.class);
> qry2.setFilter("key == keyParam");
> qry2.setFilter("initialVersion <= version");
> qry2.declareParameters("com.google.appengine.api.datastore.Key
> keyParam, long version");
>
> fileList = (List<File>) qry2.execute(key, version);
>
> but it do not show any result

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to