使用JDO查询时,要为查询涉及到的字段配置索引。否则报com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found..
在war/WEB-INF/下新建datastore-indexes-auto.xml
内容类似如下:
说明:
1、FanOrder为实体类
2、property为查询时使用到的属性
在war/WEB-INF/下新建datastore-indexes-auto.xml
内容类似如下:
<datastore-indexes>
<datastore-index kind="FanOrder" ancestor="false" source="auto">
<property name="username" direction="asc"/>
<property name="state" direction="asc"/>
<property name="orderDate" direction="desc"/>
</datastore-index>
</datastore-indexes>
说明:
1、FanOrder为实体类
2、property为查询时使用到的属性