Beispiel #1
0
 public static void initHelper(Context context) {
   if (helper == null) {
     helper = new OrmliteDbHelper(context);
     dbConnection = new AndroidDatabaseConnection(helper.getWritableDatabase(), true);
   }
 }
Beispiel #2
0
 /**
  * 功能描述:获取实体类的DAO实例
  *
  * @param <D>
  * @param <T>
  * @param context
  * @param clazz
  * @return
  * @throws SQLException
  */
 public static <D extends com.j256.ormlite.dao.Dao<T, ?>, T> D getDao(
     Context context, Class<T> clazz) throws SQLException {
   return helper.getDao(clazz);
 }