private void readCurrentUser() {
    dbHelper = OpenHelperManager.getHelper(getApplicationContext(), WTDbHelper.class);
    RuntimeExceptionDao<User, String> userDao = dbHelper.getUserDao();

    SharedPreferences sp =
        getApplicationContext().getSharedPreferences("SettingInfo", MODE_PRIVATE);

    mUser = userDao.queryForId(sp.getString("CurrentSchoolNumber", ""));
  }
示例#2
0
 /* select by id */
 public static system_messageVo select(DatabaseHelper databaseHelper, int id) {
   RuntimeExceptionDao<system_messageVo, Integer> system_messageDao =
       databaseHelper.getSystem_messageDao();
   try {
     return system_messageDao.queryForId(id);
   } catch (Exception e) {
     e.printStackTrace();
   }
   return null;
 }
 @Override
 public View getView(int position, View convertView) {
   ArticleView view = (ArticleView) convertView;
   if (view == null) {
     view = ArticleView_.build(context);
   }
   Article article = getItem(position);
   Source source = sourceDao.queryForId(article.getSourceId());
   List<Tag> tags = null;
   if (source != null) {
     tags = tagDao.queryForNames(source.getTags());
   }
   view.bind(article, tags);
   return view;
 }
示例#4
0
 public static Person getById(ZulipApp app, int id) {
   RuntimeExceptionDao<Person, Object> dao = app.getDao(Person.class);
   return dao.queryForId(id);
 }
 public static ReviewModel getbyId(int id) {
   return runtimeExceptionDao.queryForId(id);
 }