本文整理汇总了Java中com.google.apphosting.api.ApiProxy.OverQuotaException类的典型用法代码示例。如果您正苦于以下问题:Java OverQuotaException类的具体用法?Java OverQuotaException怎么用?Java OverQuotaException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OverQuotaException类属于com.google.apphosting.api.ApiProxy包,在下文中一共展示了OverQuotaException类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasRelation
import com.google.apphosting.api.ApiProxy.OverQuotaException; //导入依赖的package包/类
/**
* Determine whether this relation already exists.
*
* @return false because we don't care about naming collisions.
* @throws ODKDatastoreException
*/
@Override
public boolean hasRelation(String schema, String tableName, User user) throws ODKDatastoreException {
List<com.google.appengine.api.datastore.Entity> gaeKeys = null;
try {
com.google.appengine.api.datastore.Query query = new com.google.appengine.api.datastore.Query(
schema + "." + tableName);
query.setKeysOnly();
PreparedQuery preparedQuery = ds.prepare(query);
gaeKeys = preparedQuery.asList(FetchOptions.Builder.withLimit(2));
} catch (OverQuotaException e) {
throw new ODKOverQuotaException(e);
} catch (Exception ex) {
// No-op
}
if (gaeKeys == null || gaeKeys.size() == 0)
return false;
return true;
}