我在执行下面的查询的浏览器上收到此错误,但没有 ".order("position") 它可以工作(但结果显然没有排序)。
Uncaught com.google.web.bindery.event.shared.UmbrellaException: Exception caught: Server Error: no matching index found.
The suggested index for this query is:
<datastore-index kind="Box" ancestor="false" source="manual">
<property name="diagram_id" direction="asc"/>
<property name="position" direction="asc"/>
</datastore-index>
BoxDao.java
public List<Box> listFromDiagram(String diagramId)
{
Objectify ofy = ObjectifyService.begin();
// List of boxes of that diagram ordered by position asc
Query<Box> q=ofy.query(Box.class).filter("diagram_id",diagramId).order("position");
List<Box> results = q.list();
return results;
}
盒子.java
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Indexed;
@Entity
public class Box extends DatastoreObject{
@Indexed private String boxId;
@Indexed private String diagram_id;
private String title;
@Indexed private int position;
[...]
}
文件“datastore-indexes.xml”是空的......有什么想法吗?谢谢