本文整理匯總了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;
}