Package org.apache.ofbiz.entity.model
Class ModelReader
java.lang.Object
org.apache.ofbiz.entity.model.ModelReader
- All Implemented Interfaces:
Serializable
Generic Entity - Entity Definition Reader
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEntityToResourceHandler
(String entityName, String loaderName, String location) createRelation
(ModelEntity entity, Element relationElement) getEntitiesByPackage
(Set<String> packageFilterSet, Set<String> entityFilterSet) Get all entities, organized by packageCreates a Set with the entityName of each Entity defined in the specified XML Entity Descriptor file.Creates a Iterator with the entityName of each Entity defined in the specified XML Entity Descriptor file.getEntityResourceHandler
(String entityName) getModelEntity
(String entityName) Gets an Entity object based on a definition from the specified XML Entity descriptor file.getModelEntityNoCheck
(String entityName) static ModelReader
getModelReader
(String delegatorName) getResourceHandlerEntities
(ResourceHandler resourceHandler) void
incrementFieldCount
(int amount) void
rebuilds the resourceHandlerEntities Map of Collections based on the current entityResourceHandlerMap Map, must be done whenever a manual change is made to the entityResourceHandlerMap Map after the initial load to make them consistent again.validateEntityName
(String entityName) Util method to validate an entity name; if no entity is found with the name, characters are stripped from the beginning of the name until a valid entity name is found.
-
Method Details
-
getModelReader
- Throws:
GenericEntityException
-
getEntityCache
- Throws:
GenericEntityException
-
rebuildResourceHandlerEntities
public void rebuildResourceHandlerEntities()rebuilds the resourceHandlerEntities Map of Collections based on the current entityResourceHandlerMap Map, must be done whenever a manual change is made to the entityResourceHandlerMap Map after the initial load to make them consistent again. -
getResourceHandlerEntitiesKeyIterator
-
getResourceHandlerEntities
-
addEntityToResourceHandler
-
getEntityResourceHandler
-
getModelEntity
Gets an Entity object based on a definition from the specified XML Entity descriptor file.- Parameters:
entityName
- The entityName of the Entity definition to use.- Returns:
- An Entity object describing the specified entity of the specified descriptor file.
- Throws:
GenericEntityException
-
getModelEntityNoCheck
-
getEntityNamesIterator
Creates a Iterator with the entityName of each Entity defined in the specified XML Entity Descriptor file.- Returns:
- A Iterator of entityName Strings
- Throws:
GenericEntityException
-
getEntityNames
Creates a Set with the entityName of each Entity defined in the specified XML Entity Descriptor file.- Returns:
- A Set of entityName Strings
- Throws:
GenericEntityException
-
getEntitiesByPackage
public Map<String,TreeSet<String>> getEntitiesByPackage(Set<String> packageFilterSet, Set<String> entityFilterSet) throws GenericEntityException Get all entities, organized by package- Throws:
GenericEntityException
-
validateEntityName
Util method to validate an entity name; if no entity is found with the name, characters are stripped from the beginning of the name until a valid entity name is found. It is intended to be used to determine the entity name from a relation name.- Returns:
- A valid entityName or null
- Throws:
GenericEntityException
-
createRelation
-
incrementFieldCount
public void incrementFieldCount(int amount)
-