private KnouNoticeInfo setChangeKnouNoticeFileInfo(KnouNoticeInfo knouNoticeInfo) { try { Dao<KnouNoticeInfo, Long> knouNoticeInfoDao = this.getHelper().getKnouNoticeInfoDao(); ForeignCollection<KnouNoticeFileInfo> attacheFiles = knouNoticeInfo.AttacheFiles; if (attacheFiles == null) { attacheFiles = knouNoticeInfoDao.getEmptyForeignCollection("AttacheFiles"); } attacheFiles.clear(); for (int i = 0; i < knouNoticeInfo.AttacheFileArrayList.size(); i++) { KnouNoticeFileInfo knouNoticeFileInfo = knouNoticeInfo.AttacheFileArrayList.get(i); knouNoticeFileInfo._KNOU_NOTICE_ID = knouNoticeInfo; attacheFiles.add(knouNoticeFileInfo); } } catch (Exception e) { e.printStackTrace(); } return knouNoticeInfo; }
public boolean setParamValue(String paramName, int value) { boolean result = false; if (!TextUtils.isEmpty(paramName) && params != null) { GRWorkoutDayExerciseParamModel param = getParam(paramName); if (param != null) { param.setIntValue(value); try { result = (params.update(param) > 0); } catch (SQLException e) { Log.e(TAG, "Can't update/insert parameter " + paramName, e); result = false; } } else { GRWorkoutDayExerciseParamModel newParam = new GRWorkoutDayExerciseParamModel(paramName, value); result = params.add(newParam); } } return result; }