private void getFirstInBackground(boolean sync, GetCallback<T> callback) { this.assembleParameters(); Map<String, String> parameters = getParameters(); parameters.put("limit", Integer.toString(1));
private void getFirstInBackground(boolean sync, GetCallback<T> callback) { this.assembleParameters(); Map<String, String> parameters = getParameters(); parameters.put("limit", Integer.toString(1));
private void generateQueryPath() { // This method is only used for cache and currently only storage service use cache if (AVUtils.isBlankString(queryPath)) { conditions.assembleParameters(); queryPath = PaasClient.storageInstance().buildUrl(queryPath(), new AVRequestParams(getParameters())); } }
private void generateQueryPath() { // This method is only used for cache and currently only storage service use cache if (AVUtils.isBlankString(queryPath)) { conditions.assembleParameters(); queryPath = PaasClient.storageInstance().buildUrl(queryPath(), new AVRequestParams(getParameters())); } }
final List<T> result = new ArrayList<T>(); queryPath = PaasClient.storageInstance().getObject(path, new AVRequestParams(getParameters()), true, null, new GenericObjectCallback() { @Override
final List<T> result = new ArrayList<T>(); queryPath = PaasClient.storageInstance().getObject(path, new AVRequestParams(getParameters()), true, null, new GenericObjectCallback() { @Override
PaasClient.storageInstance().getObject(path, new AVRequestParams(getParameters()), false, null, new GenericObjectCallback() { @Override
PaasClient.storageInstance().getObject(path, new AVRequestParams(getParameters()), false, null, new GenericObjectCallback() { @Override
/** * Gets a query that can be used to query the subclass objects in this relation. * * @param clazz The AVObject subclass. * @return A AVQuery that restricts the results to objects in this relations. */ public AVQuery<T> getQuery(Class<T> clazz) { if (getParent() == null || AVUtils.isBlankString(getParent().getObjectId())) { throw new IllegalStateException("unable to encode an association with an unsaved AVObject"); } Map<String, Object> map = new HashMap<String, Object>() { { put("object", AVUtils.mapFromPointerObject(AVRelation.this.getParent())); put("key", AVRelation.this.getKey()); } }; Map<String, Object> result = new HashMap<String, Object>(); result.put("$relatedTo", map); String targetClassName = getTargetClass(); if (AVUtils.isBlankString(getTargetClass())) { targetClassName = getParent().getClassName(); } AVQuery<T> query = new AVQuery<T>(targetClassName, clazz); query.addWhereItem("$relatedTo", null, map); if (AVUtils.isBlankString(getTargetClass())) { query.getParameters().put("redirectClassNameForKey", this.getKey()); } return query; }
/** * Gets a query that can be used to query the subclass objects in this relation. * * @param clazz The AVObject subclass. * @return A AVQuery that restricts the results to objects in this relations. */ public AVQuery<T> getQuery(Class<T> clazz) { if (getParent() == null || AVUtils.isBlankString(getParent().getObjectId())) { throw new IllegalStateException("unable to encode an association with an unsaved AVObject"); } Map<String, Object> map = new HashMap<String, Object>() { { put("object", AVUtils.mapFromPointerObject(AVRelation.this.getParent())); put("key", AVRelation.this.getKey()); } }; Map<String, Object> result = new HashMap<String, Object>(); result.put("$relatedTo", map); String targetClassName = getTargetClass(); if (AVUtils.isBlankString(getTargetClass())) { targetClassName = getParent().getClassName(); } AVQuery<T> query = new AVQuery<T>(targetClassName, clazz); query.addWhereItem("$relatedTo", null, map); if (AVUtils.isBlankString(getTargetClass())) { query.getParameters().put("redirectClassNameForKey", this.getKey()); } return query; }
final GetCallback<T> internalCallback = callback; this.assembleParameters(); PaasClient.storageInstance().getObject(path, new AVRequestParams(getParameters()), sync, null, new GenericObjectCallback() { @Override
final GetCallback<T> internalCallback = callback; this.assembleParameters(); PaasClient.storageInstance().getObject(path, new AVRequestParams(getParameters()), sync, null, new GenericObjectCallback() { @Override