/** * Saves a new/modified list entry If sortOrder is not set it will be set to be the next available * sortOrder according to listID and parentID * * @param systemStateBean * @param locale * @return */ static synchronized Integer save(TSystemStateBean systemStateBean, Locale locale) { boolean isNew = systemStateBean.getObjectID() == null; if (systemStateBean.getSortorder() == null) { Integer sortOrder = systemStateDAO.getNextSortOrder(systemStateBean.getEntityflag()); systemStateBean.setSortorder(sortOrder); } Integer objectID = systemStateDAO.save(systemStateBean); if (isNew) { systemStateBean.setObjectID(objectID); } else { // The localization is loaded from localized resources table, and if not found, // from the localized property files, and if not found from the "native" table. // The value should be saved also with the default locale only if it is edited // (new entities have no correspondence in the localized property files) LocalizeBL.saveSystemStateLocalizedResource( systemStateBean.getEntityflag(), systemStateBean.getObjectID(), systemStateBean.getLabel(), locale); } // cache and possible lucene update in other cluster nodes LookupContainer.resetSystemStateMap(systemStateBean.getEntityflag()); ClusterMarkChangesBL.markDirtySystemStatesListEntryInCluster( systemStateBean.getEntityflag(), objectID); return objectID; }
/** * sets an associated TSystemStateBean object * * @param v TSystemStateBean */ public void setTSystemStateBean(TSystemStateBean v) { if (v == null) { setStatus((Integer) null); } else { setStatus(v.getObjectID()); } aTSystemStateBean = v; }
/** * Gets the status flag for an objectID * * @param statusID * @return */ public static Integer getStatusFlagForStatusID(Integer entityType, Integer statusID) { List<TSystemStateBean> systemStateList = LookupContainer.getSystemStateList(entityType); if (systemStateList != null) { for (TSystemStateBean systemStateBean : systemStateList) { Integer objectID = systemStateBean.getObjectID(); if (objectID.equals(statusID)) { return systemStateBean.getStateflag(); } } } TSystemStateBean systemStateBean = systemStateDAO.loadByPrimaryKey(statusID); if (systemStateBean != null) { return systemStateBean.getStateflag(); } return null; }