0

私は AppEngine を使用しており、次の方法でデータ エンティティをクエリしたいと考えています。

  • Bool データ「オプション」は False です。
  • Date 'registrationTimestamp' の昇順。

私のコード:

Query query = pm.newQuery(DeviceInfo.class);
query.setFilter("optional == False");
query.setOrdering("registrationTimestamp asc");
List<DeviceInfo> datas = (List<DeviceInfo>)query.execute();

データを見ると「オプション」がTrueになっているデータがあります。「オプション」がTrueであるエントリを除外したい。setFilter("optional == False") が機能していないようです。

必要なクエリを実行するにはどうすればよいですか?

編集

DataNucleus が推奨する DEBUG レベルのログを取得しました。

org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints: Bundle "org.datanucleus.jpa" has an optional dependency to "org.datanucleus.enhancer" but it cannot be resolved
org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints: Bundle "org.datanucleus" has an optional dependency to "org.eclipse.equinox.registry" but it cannot be resolved
org.datanucleus.plugin.NonManagedPluginRegistry resolveConstraints: Bundle "org.datanucleus" has an optional dependency to "org.eclipse.core.runtime" but it cannot be resolved
org.datanucleus.PersistenceConfiguration setProperty: Property datanucleus.rdbms.sql.allowAllSQLStatements unknown - will be ignored
org.datanucleus.PersistenceConfiguration setProperty: Property datanucleus.rdbms.stringDefaultLength unknown - will be ignored
org.datanucleus.PersistenceConfiguration setProperty: Property datanucleus.appengine.autoCreateDatastoreTxns unknown - will be ignored
org.datanucleus.ObjectManagerFactoryImpl logConfiguration: ================= Persistence Configuration ===============
org.datanucleus.ObjectManagerFactoryImpl logConfiguration: DataNucleus Persistence Factory - Vendor: "DataNucleus"  Version: "1.1.5"
org.datanucleus.ObjectManagerFactoryImpl logConfiguration: DataNucleus Persistence Factory initialised for datastore URL="appengine" driver="" userName=""
org.datanucleus.ObjectManagerFactoryImpl logConfiguration: ===========================================================
org.datanucleus.PersistenceConfiguration setProperty: Property datanucleus.query.cached unknown - will be ignored
org.datanucleus.jdo.metadata.JDOMetaDataManager <init>: Registering listener for metadata initialisation
org.datanucleus.jdo.metadata.JDOAnnotationReader processClassAnnotations: Class "net.xxxxxxxxx.xxxxxxx.server.DeviceInfo" has been specified with JDO annotations so using those.
org.datanucleus.store.appengine.MetaDataValidator validate: Performing appengine-specific metadata validation for net.xxxxxxxxx.xxxxxx.server.DeviceInfo
org.datanucleus.store.appengine.MetaDataValidator validate: Finished performing appengine-specific metadata validation for net.xxxxxxxxx.xxxxxx.server.DeviceInfo
org.datanucleus.store.StoreDataManager registerStoreData: Managing Persistence of Class : net.xxxxxxxxx.xxxxxxx.server.DeviceInfo [Table : <class name="DeviceInfo"
       identity-type="application"
       objectid-class="javax.jdo.identity.ObjectIdentity"
       persistence-modifier="persistence-capable"
>
<inheritance strategy="new-table">
</inheritance>
<field name="deviceRegistrationID"
       persistence-modifier="persistent"
       null-value="none"
       default-fetch-group="true"
       embedded="true"
       unique="false">
</field>
<field name="gcm"
       persistence-modifier="persistent"
       null-value="none"
       default-fetch-group="true"
       embedded="true"
       unique="false">
</field>
<field name="key"
       persistence-modifier="persistent"
       primary-key="true"
       null-value="none"
       default-fetch-group="true"
       embedded="false"
       unique="false">
</field>
<field name="optional"
       persistence-modifier="persistent"
       null-value="none"
       default-fetch-group="true"
       embedded="true"
       unique="false">
</field>
<field name="registrationTimestamp"
       persistence-modifier="persistent"
       null-value="none"
       default-fetch-group="true"
       embedded="true"
       unique="false">
</field>
</class>
, InheritanceStrategy : new-table]
org.datanucleus.store.StoreDataManager registerStoreData: Managing Persistence of Class : net.xxxxxxxxx.xxxxxxx.server.DeviceInfo [Table : <class name="DeviceInfo"
       identity-type="application"
       objectid-class="javax.jdo.identity.ObjectIdentity"
       persistence-modifier="persistence-capable"
>
<inheritance strategy="new-table">
</inheritance>
<field name="deviceRegistrationID"
       persistence-modifier="persistent"
       null-value="none"
       default-fetch-group="true"
       embedded="true"
       unique="false">
</field>
<field name="gcm"
       persistence-modifier="persistent"
       null-value="none"
       default-fetch-group="true"
       embedded="true"
       unique="false">
</field>
<field name="key"
       persistence-modifier="persistent"
       primary-key="true"
       null-value="none"
       default-fetch-group="true"
       embedded="false"
       unique="false">
</field>
<field name="optional"
       persistence-modifier="persistent"
       null-value="none"
       default-fetch-group="true"
       embedded="true"
       unique="false">
</field>
<field name="registrationTimestamp"
       persistence-modifier="persistent"
       null-value="none"
       default-fetch-group="true"
       embedded="true"
       unique="false">
</field>
</class>
, InheritanceStrategy : new-table]
org.datanucleus.jdo.metadata.JDOMetaDataManager$MetaDataRegisterClassListener registerClass: Listener found initialisation for persistable class net.xxxxxxxxx.xxxxxxx.server.DeviceInfo
com.google.appengine.api.datastore.QueryResultsSourceImpl logChunkSizeWarning: This query does not have a chunk size set in FetchOptions and has returned over 1000 results.  If result sets of this size are common for this query, consider setting a chunk size to improve performance.
  To disable this warning set the following system property in appengine-web.xml (the value of the property doesn't matter): 'appengine.datastore.disableChunkSizeWarning'
4

1 に答える 1