本文整理汇总了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;
}