`
忧里修斯
  • 浏览: 426986 次
  • 性别: Icon_minigender_1
社区版块
存档分类
最新评论

使用JDO查询,datastore-indexes-auto.xml

阅读更多
使用JDO查询时,要为查询涉及到的字段配置索引。否则报com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found..

在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为查询时使用到的属性
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics