public static List<ErrorHelpLog> findAll(Context context) { FinalDb db = FinalDb.create(context, ApplicationConfig.DATABASE_NAME, DEBUG); List<ErrorHelpLog> result = db.findAll(ErrorHelpLog.class); if (result != null) { for (ErrorHelpLog lg : result) { lg.setCtx(context); } } return result; }
/** * 失败返回-1 * * @param context Context * @param entity ErrorHelpLog * @return int */ public static int Insert(Context context, ErrorHelpLog entity) { FinalDb db = FinalDb.create(context, ApplicationConfig.DATABASE_NAME, DEBUG); if (db.saveBindId(entity)) { return entity.getId(); } return -1; }