Hello,
I Got a problem when quering data with the key <fileName> . The error
is below  :

com.google.appengine.api.datastore.DatastoreNeedIndexException: no
matching index found..
    <datastore-index kind="Picture" ancestor="false" source="manual">
        <property name="__key__" direction="desc"/>
    </datastore-index>

The index is not found, but i have declared it in the file <datastore-
indexes.xml> like this :

  <?xml version="1.0" encoding="UTF-8"?>
  <datastore-indexes  autoGenerate="true">
    <datastore-index kind="Picture" ancestor="false">
        <property name="fileName" direction="desc" />
    </datastore-index>
  </datastore-indexes>

The query is :

 PersistenceManager pm = PMF.get().getPersistenceManager();
 javax.jdo.Query query = pm.newQuery(Picture.class);
 query.setOrdering("fileName desc");
 List<Picture> Pictures = (List<Picture>)
pm.newQuery(query).execute();

The java class Picture is :

  @PersistenceCapable(identityType = IdentityType.APPLICATION)
  public class Picture {
        private static final Logger log =
Logger.getLogger(Picture.class.getName());

       @PrimaryKey
        private String fileName;
       ...

   }

thanks for your help

-- 
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