/** * Select all data. * * @return the list of Items */ public Map<String, Chatter> selectAllChatterMap() { Map<String, Chatter> map = new HashMap<String, Chatter>(); Cursor cursor = this.db.rawQuery("SELECT * FROM " + TABLE_CHATTER, null); if (cursor.moveToFirst()) { do { Chatter c = new Chatter(); c.setId(cursor.getLong(0)); c.setChatterId(cursor.getString(1)); c.setActor(cursor.getString(2)); c.setPost(cursor.getString(3)); c.setCommentCount(cursor.getInt(4)); c.setLikeCount(cursor.getInt(5)); c.setCreateTime(cursor.getLong(6)); map.put(c.getChatterId(), c); } while (cursor.moveToNext()); } if (cursor != null && !cursor.isClosed()) { cursor.close(); } return map; }
/** * Select all data. * * @return the list of Items */ public List<Chatter> selectAllChatter() { List<Chatter> list = new ArrayList<Chatter>(); Cursor cursor = this.db.rawQuery("SELECT * FROM " + TABLE_CHATTER, null); if (cursor.moveToFirst()) { do { Chatter c = new Chatter(); c.setId(cursor.getLong(0)); c.setChatterId(cursor.getString(1)); c.setActor(cursor.getString(2)); c.setPost(cursor.getString(3)); c.setCommentCount(cursor.getInt(4)); c.setLikeCount(cursor.getInt(5)); c.setCreateTime(cursor.getLong(6)); list.add(c); } while (cursor.moveToNext()); } if (cursor != null && !cursor.isClosed()) { cursor.close(); } return list; }