Hi Dormand.
I've tried using this:
//previous declaration.
private static final PersistenceManagerFactory pmfInstance =
JDOHelper.getPersistenceManagerFactory("transactions-optional");
PersistenceManager pm =
getPersistanceManagerFactory().getPersistenceManager();
Object foundObject=null;
try {
// the getObjectById metho receives your key to make
the search.
Key k=<The Key of your object>;
foundObject = pm.getObjectById(classType, k);
}
finally{
pm.close();
return return foundObject;
}
in the other hand, I've tried to make the query just the same as
you've, but, somewhy, it didn't work out. So I decide to do it by the
given method by the Persistent Manager Object.
Hope this helps.
Rgds.
R
On May 30, 8:47 am, 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.