當前位置: 首頁>>代碼示例>>Java>>正文


Java ParseQuery.getFirst方法代碼示例

本文整理匯總了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;
    }
}
 
開發者ID:emivaljr,項目名稱:hojenaoapp,代碼行數:20,代碼來源:CityAsyncTask.java

示例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) {

    }
}
 
開發者ID:donniepropst,項目名稱:note.cntxt,代碼行數:14,代碼來源:UserAccount.java

示例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;
    }
}
 
開發者ID:emivaljr,項目名稱:hojenaoapp,代碼行數:35,代碼來源:HolidayAsyncTask.java

示例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;
}
 
開發者ID:matthew-compton,項目名稱:PhotoGalleryPlusPlus,代碼行數:14,代碼來源:DataManager.java


注:本文中的com.parse.ParseQuery.getFirst方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。