本文整理匯總了Java中com.parse.ParseQuery.getFirst方法的典型用法代碼示例。如果您正苦於以下問題:Java ParseQuery.getFirst方法的具體用法?Java ParseQuery.getFirst怎麽用?Java ParseQuery.getFirst使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.parse.ParseQuery
的用法示例。
在下文中一共展示了ParseQuery.getFirst方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doAsyncTask
import com.parse.ParseQuery; //導入方法依賴的package包/類
@Override
protected List<String> doAsyncTask(String... params) {
final List<String> lista = new ArrayList<String>();
state = params[0];
try {
ParseQuery<ParseObject> query = ParseQuery.getQuery("State");
query.whereEqualTo("name", state);
ParseObject parseObject = query.getFirst();
ParseQuery<ParseObject> queryCity = ParseQuery.getQuery("City");
queryCity.whereEqualTo("id_state", parseObject.getInt("id_state"));
List<ParseObject> parseObjects = queryCity.find();
for (ParseObject p : parseObjects){
lista.add(p.getString("name_city"));
}
return lista;
} catch (Exception e) {
return null;
}
}
示例2: load
import com.parse.ParseQuery; //導入方法依賴的package包/類
public void load(){
ParseQuery<CustomUser> query = ParseQuery.getQuery(CustomUser.class);
query.fromPin(USER);
try {
if(query.count() == 0){
return;
}
user = query.getFirst();
} catch (ParseException e) {
}
}
示例3: doAsyncTask
import com.parse.ParseQuery; //導入方法依賴的package包/類
@Override
protected List<Feriado> doAsyncTask(String... params) {
state = params[0];
city = params[1];
try {
List<Feriado> list = new ArrayList<>();
if(state !=null && !state.equals("")&& city!=null && !city.equals("")) {
ParseQuery<ParseObject> query = ParseQuery.getQuery("State");
query.whereEqualTo("name", state);
ParseObject parseObject = query.getFirst();
ParseQuery<ParseObject> queryCity = ParseQuery.getQuery("City");
queryCity.whereEqualTo("id_state", parseObject.getInt("id_state"));
queryCity.whereContains("name_city", city);
ParseObject parseCity = queryCity.getFirst();
ParseQuery<ParseObject> queryHoliday = ParseQuery.getQuery("Holiday");
queryHoliday.whereEqualTo("id_state", parseObject.getInt("id_state"));
queryHoliday.whereEqualTo("id_city", parseCity.getInt("id_city"));
List<ParseObject> parseObjects = queryHoliday.find();
ParseQuery<ParseObject> queryStateHoliday = ParseQuery.getQuery("StateHoliday");
queryStateHoliday.whereEqualTo("id_state", parseObject.getInt("id_state"));
parseObjects.addAll(queryStateHoliday.find());
for (ParseObject p : parseObjects) {
Feriado feriado = new Feriado();
feriado.setData(p.getString("date"));
feriado.setNome(p.getString("name"));
list.add(feriado);
}
}
return list;
} catch (Exception e) {
return null;
}
}
示例4: checkSearchQueryExists
import com.parse.ParseQuery; //導入方法依賴的package包/類
public boolean checkSearchQueryExists(String text) {
ParseQuery<Search> query = Search.getQuery();
query.fromLocalDatastore();
query.whereEqualTo(Search.SEARCH_TEXT, text);
try {
if (query.getFirst() != null) {
return true;
}
} catch (ParseException e) {
Timber.e("Parse Exception.");
}
return false;
}