/** Gets a list of entity models that are in a group corresponding to the specified group name *@param groupName The name of the group *@return List of ModelEntity instances */ public List getModelEntitiesByGroup(String groupName) { Iterator enames = UtilMisc.toIterator(getModelGroupReader().getEntityNamesByGroup(groupName)); List entities = new LinkedList(); if (enames == null || !enames.hasNext()) return entities; while (enames.hasNext()) { String ename = (String) enames.next(); ModelEntity entity = this.getModelEntity(ename); if (entity != null) entities.add(entity); } return entities; }
/** Gets a list of entity models that are in a group corresponding to the specified group name *@param groupName The name of the group *@return List of ModelEntity instances */ public List getModelEntitiesByGroup(String groupName) { Iterator enames = UtilMisc.toIterator(getModelGroupReader().getEntityNamesByGroup(groupName)); List entities = new LinkedList(); if (enames == null || !enames.hasNext()) return entities; while (enames.hasNext()) { String ename = (String) enames.next(); ModelEntity entity = this.getModelEntity(ename); if (entity != null) entities.add(entity); } return entities; }
/** * Gets a list of entity models that are in a group corresponding to the specified group name. * * @param groupName The name of the group * @return List of ModelEntity instances */ public List<ModelEntity> getModelEntitiesByGroup(final String groupName) { checkIfLocked(); final Iterator<String> enames = UtilMisc.toIterator(getModelGroupReader().getEntityNamesByGroup(groupName)); final List<ModelEntity> entities = new LinkedList<ModelEntity>(); if (enames == null || !enames.hasNext()) return entities; while (enames.hasNext()) { String ename = enames.next(); ModelEntity entity = getModelEntity(ename); if (entity != null) entities.add(entity); } return entities; }
/** Gets a Map of entity name & entity model pairs that are in the named group *@param groupName The name of the group *@return Map of entityName String keys and ModelEntity instance values */ public Map getModelEntityMapByGroup(String groupName) { Iterator enames = UtilMisc.toIterator(getModelGroupReader().getEntityNamesByGroup(groupName)); Map entities = new HashMap(); if (enames == null || !enames.hasNext()) { return entities; } int errorCount = 0; while (enames.hasNext()) { String ename = (String) enames.next(); try { ModelEntity entity = getModelReader().getModelEntity(ename); if (entity != null) { entities.put(entity.getEntityName(), entity); } else { throw new IllegalStateException("Programm Error: entity was null with name " + ename); } } catch (GenericEntityException ex) { errorCount++; Debug.logError("Entity " + ename + " named in Entity Group with name " + groupName + " are not defined in any Entity Definition file"); } } if (errorCount > 0) { Debug.logError(errorCount + " entities were named in ModelGroup but not defined in any EntityModel"); } return entities; }
/** Gets a Map of entity name & entity model pairs that are in the named group *@param groupName The name of the group *@return Map of entityName String keys and ModelEntity instance values */ public Map getModelEntityMapByGroup(String groupName) { Iterator enames = UtilMisc.toIterator(getModelGroupReader().getEntityNamesByGroup(groupName)); Map entities = new HashMap(); if (enames == null || !enames.hasNext()) { return entities; } int errorCount = 0; while (enames.hasNext()) { String ename = (String) enames.next(); try { ModelEntity entity = getModelReader().getModelEntity(ename); if (entity != null) { entities.put(entity.getEntityName(), entity); } else { throw new IllegalStateException("Programm Error: entity was null with name " + ename); } } catch (GenericEntityException ex) { errorCount++; Debug.logError("Entity " + ename + " named in Entity Group with name " + groupName + " are not defined in any Entity Definition file"); } } if (errorCount > 0) { Debug.logError(errorCount + " entities were named in ModelGroup but not defined in any EntityModel"); } return entities; }
Iterator<String> enames = UtilMisc.toIterator(getModelGroupReader().getEntityNamesByGroup(groupName)); Map<String, ModelEntity> entities = new HashMap<String, ModelEntity>();
checkIfLocked(); final Iterator<String> groups = UtilMisc.toIterator(getModelGroupReader().getGroupNames());
Iterator groups = UtilMisc.toIterator(getModelGroupReader().getGroupNames());
Iterator groups = UtilMisc.toIterator(getModelGroupReader().getGroupNames());