eclipseのpluginを使ってローカル環境で開発を行っている場合、ローカル環境でクエリを行った際に自動的にWEB-INF/appengine-generated以下に"datastore-indexes-auto.xml"というファイルが作成されます。
以下がそのdatastore-indexes-auto.xmlの例です。
<!-- Indices written at Mon, 30 Nov 2009 05:59:46 UTC -->
<datastore-indexes>
<!-- Used 1 time in query history -->
<datastore-index kind="Hoge" ancestor="false" source="auto">
<property name="hoge" direction="asc"/>
<property name="fuga" direction="asc"/>
</datastore-index>
</datastore-indexes>
これをそのまま移動、リネームしてWEB-INF/datastore-indexes.xmlにすれば使える・・・と思っていたのですが、どうやらこれではいけないようです。
<!-- Indices written at Mon, 30 Nov 2009 05:59:46 UTC --> <datastore-indexes autoGenerate="false"> ... </datastore-indexes>このように、datastore-indexes要素に"autoGenerate"属性が書かれていないとエラーになります。これはWEB-INF/auto-generated/datastore-indexes-auto.xmlを自動生成させるかどうかを設定する値ですが、WEB-INF/datastore-indexes.xmlでは必須になっています。
せっかく自動生成してくれるのだから、そのまま持ってきても動くように生成してほしいところですが…自動生成されたxmlをそのまま使おうとする際には気をつけましょう。



0 コメント:
コメントを投稿