Пример #1
0
 /**
  * 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;
 }
Пример #2
0
 /**
  * Get the stateIDs by entityType an state flags
  *
  * @param entityType
  * @param stateFlag
  * @return
  */
 public static List<TSystemStateBean> getSystemStatesByByEntityAndStateFlags(
     Integer entityType, int[] stateFlagArr) {
   List<TSystemStateBean> systemList = LookupContainer.getSystemStateList(entityType);
   List<TSystemStateBean> systemListByStateFlag = new LinkedList<TSystemStateBean>();
   Set<Integer> stateFlagsSet = GeneralUtils.createSetFromIntArr(stateFlagArr);
   if (systemList != null) {
     for (TSystemStateBean systemStateBean : systemList) {
       Integer stateFlag = systemStateBean.getStateflag();
       if (stateFlagsSet.contains(stateFlag)) {
         systemListByStateFlag.add(systemStateBean);
       }
     }
   }
   return systemListByStateFlag; // systemStateDAO.loadWithStateFlagForEntity(entityType,
                                 // stateFlag);
 }