本文整理汇总了Java中com.google.appengine.api.datastore.PreparedQuery.countEntities方法的典型用法代码示例。如果您正苦于以下问题:Java PreparedQuery.countEntities方法的具体用法?Java PreparedQuery.countEntities怎么用?Java PreparedQuery.countEntities使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.appengine.api.datastore.PreparedQuery
的用法示例。
在下文中一共展示了PreparedQuery.countEntities方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isInStore
import com.google.appengine.api.datastore.PreparedQuery; //导入方法依赖的package包/类
public boolean isInStore() {
final DatastoreQuery query = getMatchingQuery();
final Store store = new Store();
final PreparedQuery preparedQuery = store.prepare(query);
final FetchOptions fetchOptions = FetchOptions.Builder.withDefaults();
final int count = preparedQuery.countEntities(fetchOptions);
return (count > 0);
}
示例2: countOptions
import com.google.appengine.api.datastore.PreparedQuery; //导入方法依赖的package包/类
public static int countOptions(final PageId source) {
final DatastoreQuery query = new DatastoreQuery(KIND_NAME);
final Filter filter = getSourceFilter(source);
query.setFilter(filter);
final Store store = new Store();
final PreparedQuery preparedQuery = store.prepare(query);
final FetchOptions fetchOptions = FetchOptions.Builder.withDefaults();
return preparedQuery.countEntities(fetchOptions);
}
示例3: countAllPagesWrittenBy
import com.google.appengine.api.datastore.PreparedQuery; //导入方法依赖的package包/类
public static int countAllPagesWrittenBy(final String authorId) {
final DatastoreQuery query = new DatastoreQuery(KIND_NAME);
final Filter filter = getAuthorIdFilter(authorId);
query.setFilter(filter);
final Store store = new Store();
final PreparedQuery preparedQuery = store.prepare(query);
final FetchOptions fetchOptions = FetchOptions.Builder.withDefaults();
return preparedQuery.countEntities(fetchOptions);
}
示例4: countAllPages
import com.google.appengine.api.datastore.PreparedQuery; //导入方法依赖的package包/类
public static int countAllPages() {
final DatastoreQuery query = new DatastoreQuery(KIND_NAME);
final Store store = new Store();
final PreparedQuery preparedQuery = store.prepare(query);
final FetchOptions fetchOptions = FetchOptions.Builder.withDefaults();
return preparedQuery.countEntities(fetchOptions);
}
示例5: countVersions
import com.google.appengine.api.datastore.PreparedQuery; //导入方法依赖的package包/类
public static int countVersions(final int num) {
final DatastoreQuery query = new DatastoreQuery(KIND_NAME);
final Filter filter = getIdNumFilter(num);
query.setFilter(filter);
final Store store = new Store();
final PreparedQuery preparedQuery = store.prepare(query);
final FetchOptions fetchOptions = FetchOptions.Builder.withDefaults();
return preparedQuery.countEntities(fetchOptions);
}
示例6: countAllBeginnings
import com.google.appengine.api.datastore.PreparedQuery; //导入方法依赖的package包/类
public static int countAllBeginnings() {
final DatastoreQuery query = new DatastoreQuery(KIND_NAME);
query.setKeysOnly();
final Store store = new Store();
final PreparedQuery preparedQuery = store.prepare(query);
final FetchOptions fetchOptions = FetchOptions.Builder.withDefaults();
return preparedQuery.countEntities(fetchOptions);
}
示例7: countNewNotificationsForRecipient
import com.google.appengine.api.datastore.PreparedQuery; //导入方法依赖的package包/类
public static int countNewNotificationsForRecipient(
final String recipientId) {
final DatastoreQuery query = new DatastoreQuery(KIND_NAME);
final Filter recipientFilter = getRecipientFilter(recipientId);
final boolean isNew = true;
final Filter isNewFilter = getIsNewFilter(isNew);
final Filter filter;
filter = CompositeFilterOperator.and(recipientFilter, isNewFilter);
query.setFilter(filter);
final Store store = new Store();
final PreparedQuery preparedQuery = store.prepare(query);
final FetchOptions fetchOptions = FetchOptions.Builder.withDefaults();
return preparedQuery.countEntities(fetchOptions);
}
示例8: countFirstPagesMatchingTag
import com.google.appengine.api.datastore.PreparedQuery; //导入方法依赖的package包/类
public static int countFirstPagesMatchingTag(final String tag) {
final PreparedQuery preparedQuery = getPreparedQueryForFirstPagesMatchingTag(
tag);
final FetchOptions fetchOptions = FetchOptions.Builder.withDefaults();
return preparedQuery.countEntities(fetchOptions);
}