Java Code Examples for com.lidroid.xutils.DbUtils#findFirst()
The following examples show how to use
com.lidroid.xutils.DbUtils#findFirst() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EmojiDb.java From BigApp_Discuz_Android with Apache License 2.0 | 5 votes |
public static EmoticonBean getEmojiByUnicode(Context context, String unicode) { DbUtils dbUtils = DbUtils.create(context, DB_NAME, DB_VERSION, null); try { return dbUtils.findFirst(Selector.from(EmoticonBean.class).where("content", "=", unicode)); } catch (DbException e) { e.printStackTrace(); } return null; }
Example 2
Source File: EmojiDb.java From BigApp_Discuz_Android with Apache License 2.0 | 5 votes |
public static EmoticonBean getEmojiByShortname(Context context, String shortname) { DbUtils dbUtils = DbUtils.create(context, DB_NAME, DB_VERSION, null); try { return dbUtils.findFirst(Selector.from(EmoticonBean.class).where("shortname", "=", shortname)); } catch (DbException e) { e.printStackTrace(); } return null; }
Example 3
Source File: EmojiDb.java From BigApp_Discuz_Android with Apache License 2.0 | 5 votes |
@Deprecated public static List<EmoticonSetBean> getEmojiSets(Context context) { DbUtils dbUtils = DbUtils.create(context, DB_NAME, DB_VERSION, null); try { EmoticonSetBean setBean = dbUtils.findFirst(EmoticonSetBean.class); List<EmoticonBean> beans = getAllEmojis(context); setBean.setEmoticonList(beans); List<EmoticonSetBean> list = new ArrayList<EmoticonSetBean>(); list.add(setBean); return list; } catch (DbException e) { e.printStackTrace(); } return null; }
Example 4
Source File: EmojiDb.java From BigApp_Discuz_Android with Apache License 2.0 | 5 votes |
public static List<EmoticonSetBean> getEmojiSetsByName(Context context, String name) { DbUtils dbUtils = DbUtils.create(context, DB_NAME, DB_VERSION, null); try { EmoticonSetBean setBean = dbUtils.findFirst(Selector.from(EmoticonSetBean.class).where("name", "=", name)); List<EmoticonBean> beans = getAllEmojis(context); setBean.setEmoticonList(beans); List<EmoticonSetBean> list = new ArrayList<EmoticonSetBean>(); list.add(setBean); return list; } catch (DbException e) { e.printStackTrace(); } return null; }
Example 5
Source File: EmojiDb.java From BigApp_Discuz_Android with Apache License 2.0 | 5 votes |
public static List<EmoticonSetBean> getEmojiLibraryByGroup(Context context, String name, String group) { DbUtils dbUtils = DbUtils.create(context, DB_NAME, DB_VERSION, null); try { EmoticonSetBean setBean = dbUtils.findFirst(Selector.from(EmoticonSetBean.class).where("name", "=", name)); List<EmoticonBean> beans = getEmojiGroup(context, group); setBean.setEmoticonList(beans); List<EmoticonSetBean> list = new ArrayList<EmoticonSetBean>(); list.add(setBean); return list; } catch (DbException e) { e.printStackTrace(); } return null; }
Example 6
Source File: DingCaiDAO.java From QiQuYing with Apache License 2.0 | 5 votes |
/** * 检查是否点过赞 * @param userId * @param jokeId * @return */ public DingOrCai getDingOrCai(int userId, int jokeId) { DbUtils db = DbUtils.create(context); DingOrCai dingOrCai = null; try { dingOrCai = db.findFirst(Selector.from(DingOrCai.class).where(WhereBuilder.b("user_id", "=", userId).and("joke_id", "=", jokeId))); Log.d(TAG, "getDingOrCai success"); } catch (DbException e) { Log.d(TAG, "getDingOrCai failure", e); } return dingOrCai; }
Example 7
Source File: CollectDAO.java From QiQuYing with Apache License 2.0 | 5 votes |
/** * 检查是否收藏过 * @param userId * @param jokeId * @return */ public Collect getCollect(int userId, int jokeId) { DbUtils db = DbUtils.create(context); Collect collect = null; try { collect = db.findFirst(Selector.from(Collect.class).where(WhereBuilder.b("user_id", "=", userId).and("joke_id", "=", jokeId))); Log.d(TAG, "getDingOrCai success"); } catch (DbException e) { Log.e(TAG, "getDingOrCai failure", e); } return collect; }