当前位置: 首页>>代码示例>>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;未经允许,请勿转载。