/** * Constructs a query. A default query with no further parameters will retrieve all AVObjects of * the provided class. * * @param theClassName The name of the class to retrieve AVObjects for. * @return the query object. */ public static <T extends AVObject> AVQuery<T> getQuery(String theClassName) { return new AVQuery<T>(theClassName); }
/** * Constructs a query. A default query with no further parameters will retrieve all AVObjects of * the provided class. * * @param theClassName The name of the class to retrieve AVObjects for. * @return the query object. */ public static <T extends AVObject> AVQuery<T> getQuery(String theClassName) { return new AVQuery<T>(theClassName); }
public static AVQuery<AVInstallation> getQuery() { AVQuery<AVInstallation> query = new AVQuery<AVInstallation>(INSTALLATION_AVNAME); return query; }
/** * Creates a new push notification. The default channel is the empty string, also known as the * global broadcast channel, but this value can be overridden using AVPush.setChannel(String), * AVPush.setChannels(Collection) or AVPush.setQuery(AVQuery). Before sending the push * notification you must call either AVPush.setMessage(String) or AVPush.setData(JSONObject). */ public AVPush() { channelSet = new HashSet<String>(); pushData = new HashMap<String, Object>(); pushTarget = new HashSet<String>(DEVICE_TYPES); pushQuery = new AVQuery(INSTALLATIONTAG); }
/** * Gets a AVQuery over the Role collection. * * @return A new query over the Role collection. */ public static AVQuery<AVRole> getQuery() { AVQuery<AVRole> query = new AVQuery<AVRole>(AVPowerfulUtils.getAVClassName(AVRole.class.getSimpleName())); return query; }
/** * Constructs a query for AVUsers subclasses. */ public static <T extends AVUser> AVQuery<T> getUserQuery(Class<T> clazz) { AVQuery<T> query = new AVQuery<T>(userClassName(), clazz); return query; }
/** * Gets a AVQuery over the Role collection. * * @return A new query over the Role collection. */ public static AVQuery<AVRole> getQuery() { AVQuery<AVRole> query = new AVQuery<AVRole>(AVPowerfulUtils.getAVClassName(AVRole.class.getSimpleName())); return query; }
/** * Constructs a query for AVUsers subclasses. * * @param clazz class type of AVUser subclass for query * @param <T> subclass of AVUser * @return query of AVUser */ public static <T extends AVUser> AVQuery<T> getUserQuery(Class<T> clazz) { AVQuery<T> query = new AVQuery<T>(userClassName(), clazz); return query; }
/** * Create a AVQuery with special sub-class. * * @param clazz The AVObject subclass * @return The AVQuery */ public static <T extends AVObject> AVQuery<T> getQuery(Class<T> clazz) { return new AVQuery<T>(getSubClassName(clazz), clazz); }
/** * Create a AVQuery with special sub-class. * * @param clazz The AVObject subclass * @return The AVQuery */ public static <T extends AVObject> AVQuery<T> getQuery(Class<T> clazz) { return new AVQuery<T>(AVObject.getSubClassName(clazz), clazz); }
/** * Create a AVQuery with special sub-class. * * @param clazz The AVObject subclass * @return The AVQuery */ public static <T extends AVObject> AVQuery<T> getQuery(Class<T> clazz) { return new AVQuery<T>(AVObject.getSubClassName(clazz), clazz); }
/** * Create a AVQuery with special sub-class. * * @param clazz The AVObject subclass * @param <T> AVObject subclass * @return The AVQuery */ public static <T extends AVObject> AVQuery<T> getQuery(Class<T> clazz) { return new AVQuery<T>(getSubClassName(clazz), clazz); }
/** * clone a new query object, which fully same to this. * * @return a new AVQuery object. */ public AVQuery clone() { AVQuery query = new AVQuery(this.className, this.clazz); query.isRunning = false; query.cachePolicy = this.cachePolicy; query.maxCacheAge = this.maxCacheAge; query.queryPath = this.queryPath; query.externalQueryPath = this.externalQueryPath; query.conditions = null != this.conditions? this.conditions.clone(): null; return query; }
public void getRolesInBackground(final AVCallback<List<AVRole>> callback) { AVQuery<AVRole> roleQuery = new AVQuery<AVRole>(AVRole.className); roleQuery.whereEqualTo(AVUSER_ENDPOINT, this); roleQuery.findInBackground(new FindCallback<AVRole>() { @Override public void done(List<AVRole> list, AVException e) { callback.internalDone(list, e); } }); }
/** * Create a query that can be used to query the parent objects in this relation. * * @param parentClassName The parent class name * @param relationKey The relation field key in parent * @param child The child object. * @return A AVQuery that restricts the results to parent objects in this relations. */ public static <M extends AVObject> AVQuery<M> reverseQuery(String parentClassName, String relationKey, AVObject child) { AVQuery<M> query = new AVQuery<M>(parentClassName); query.whereEqualTo(relationKey, AVUtils.mapFromPointerObject(child)); return query; }
/** * Create a query that can be used to query the parent objects in this relation. * * @param parentClassName The parent class name * @param relationKey The relation field key in parent * @param child The child object. * @return A AVQuery that restricts the results to parent objects in this relations. */ public static <M extends AVObject> AVQuery<M> reverseQuery(String parentClassName, String relationKey, AVObject child) { AVQuery<M> query = new AVQuery<M>(parentClassName); query.whereEqualTo(relationKey, AVUtils.mapFromPointerObject(child)); return query; }
@JSONField(serialize = false) public List<AVRole> getRoles() throws AVException { AVQuery<AVRole> roleQuery = new AVQuery<AVRole>(AVRole.className); roleQuery.whereEqualTo(AVUser.AVUSER_ENDPOINT, this); return roleQuery.find(); }
/** * Create a query that can be used to query the parent objects in this relation. * * @param theParentClazz The parent subclass. * @param relationKey The relation field key in parent * @param child The child object. * @return A AVQuery that restricts the results to parent objects in this relations. */ public static <M extends AVObject> AVQuery<M> reverseQuery(Class<M> theParentClazz, String relationKey, AVObject child) { AVQuery<M> query = new AVQuery<M>(AVObject.getSubClassName(theParentClazz), theParentClazz); query.whereEqualTo(relationKey, AVUtils.mapFromPointerObject(child)); return query; }
/** * Create a query that can be used to query the parent objects in this relation. * * @param theParentClazz The parent subclass. * @param relationKey The relation field key in parent * @param child The child object. * @return A AVQuery that restricts the results to parent objects in this relations. */ public static <M extends AVObject> AVQuery<M> reverseQuery(Class<M> theParentClazz, String relationKey, AVObject child) { AVQuery<M> query = new AVQuery<M>(AVObject.getSubClassName(theParentClazz), theParentClazz); query.whereEqualTo(relationKey, AVUtils.mapFromPointerObject(child)); return query; }
/** * Retrieve a AVFile object by object id from AVOSCloud.If the file is not found,it will throw * java.io.FileNotFoundException. * * @param objectId objectId in _File table * @return AVFile AVFile instance * @throws AVException excpetion if _File table object failed to transfer to AVFile object * @throws FileNotFoundException exception if objectId is not invalid * @since 2.0.2 */ public static AVFile withObjectId(String objectId) throws AVException, FileNotFoundException { AVQuery<AVObject> query = new AVQuery<AVObject>("_File"); AVObject object = query.get(objectId); if (object != null && !AVUtils.isBlankString(object.getObjectId())) { AVFile file = createFileFromAVObject(object); return file; } else { throw new FileNotFoundException("Could not find file object by id:" + objectId); } }