Class GenericDelegator

java.lang.Object
org.ofbiz.core.entity.GenericDelegator
All Implemented Interfaces:
DelegatorInterface
Direct Known Subclasses:
LockedDatabaseGenericDelegator

public class GenericDelegator extends Object implements DelegatorInterface
Generic Data Source Delegator.

TODO The thread safety in here (and everywhere in ofbiz) is crap, improper double checked locking, modification of maps while other threads may be reading them, this class is not thread safe at all.

Since:
1.0
Author:
David E. Jones, Chris Maurer, Andy Zeneski
  • Field Details

  • Constructor Details

    • GenericDelegator

      protected GenericDelegator()
    • GenericDelegator

      protected GenericDelegator(String delegatorName) throws GenericEntityException
      Contructor is protected to enforce creation through the factory method.
      Parameters:
      delegatorName - the name of the server configuration that corresponds to this delegator
      Throws:
      GenericEntityException
  • Method Details

    • getGenericDelegator

      public static GenericDelegator getGenericDelegator(String delegatorName)
      Factory method for a GenericDelegator with the given name.
      Parameters:
      delegatorName - the name of the server configuration that corresponds to this delegator
      Returns:
      a non-null instance
      Throws:
      RuntimeException - if the delegator could not be instantiated
    • removeGenericDelegator

      public static void removeGenericDelegator(String delegatorName)
      Removes any references to the delegator with the given name.
      Parameters:
      delegatorName - the name of the server configuration that corresponds to this delegator
    • lock

      public static void lock()
    • unlock

      public static void unlock()
    • isLocked

      public static boolean isLocked()
    • initialiseAndCheckDatabase

      public void initialiseAndCheckDatabase()
      If you got an instance of GenericDelegator while the whole thing was locked, you need to make sure you call this once it becomes unlocked before you do anything.
    • getDelegatorName

      public String getDelegatorName()
      Gets the name of the server configuration that corresponds to this delegator.
      Specified by:
      getDelegatorName in interface DelegatorInterface
      Returns:
      server configuration name
    • getDelegatorInfo

      protected EntityConfigUtil.DelegatorInfo getDelegatorInfo()
    • getModelReader

      public ModelReader getModelReader()
      Gets the instance of ModelReader that corresponds to this delegator.
      Specified by:
      getModelReader in interface DelegatorInterface
      Returns:
      ModelReader that corresponds to this delegator
    • getModelGroupReader

      public ModelGroupReader getModelGroupReader()
      Gets the instance of ModelGroupReader that corresponds to this delegator.
      Specified by:
      getModelGroupReader in interface DelegatorInterface
      Returns:
      ModelGroupReader that corresponds to this delegator
    • getModelEntity

      public ModelEntity getModelEntity(String entityName)
      Gets the instance of ModelEntity that corresponds to this delegator and the specified entityName.
      Specified by:
      getModelEntity in interface DelegatorInterface
      Parameters:
      entityName - The name of the entity to get
      Returns:
      ModelEntity that corresponds to this delegator and the specified entityName
    • getEntityGroupName

      public String getEntityGroupName(String entityName)
      Gets the helper name that corresponds to this delegator and the specified entityName.
      Specified by:
      getEntityGroupName in interface DelegatorInterface
      Parameters:
      entityName - The name of the entity to get the helper for
      Returns:
      String with the helper name that corresponds to this delegator and the specified entityName
    • getModelEntitiesByGroup

      public List<ModelEntity> getModelEntitiesByGroup(String groupName)
      Gets a list of entity models that are in a group corresponding to the specified group name.
      Specified by:
      getModelEntitiesByGroup in interface DelegatorInterface
      Parameters:
      groupName - The name of the group
      Returns:
      List of ModelEntity instances
    • getModelEntityMapByGroup

      public Map<String,ModelEntity> getModelEntityMapByGroup(String groupName)
      Gets a Map of entity name & entity model pairs that are in the named group.
      Specified by:
      getModelEntityMapByGroup in interface DelegatorInterface
      Parameters:
      groupName - The name of the group
      Returns:
      Map of entityName String keys and ModelEntity instance values
    • getGroupHelperName

      public String getGroupHelperName(String groupName)
      Gets the helper name that corresponds to this delegator and the specified entityName.
      Specified by:
      getGroupHelperName in interface DelegatorInterface
      Parameters:
      groupName - The name of the group to get the helper name for
      Returns:
      String with the helper name that corresponds to this delegator and the specified entityName
    • getEntityHelperName

      public String getEntityHelperName(String entityName)
      Gets the helper name that corresponds to this delegator and the specified entityName.
      Specified by:
      getEntityHelperName in interface DelegatorInterface
      Parameters:
      entityName - The name of the entity to get the helper name for
      Returns:
      String with the helper name that corresponds to this delegator and the specified entityName
    • getEntityHelperName

      public String getEntityHelperName(ModelEntity entity)
      Gets the helper name that corresponds to this delegator and the specified entity.
      Specified by:
      getEntityHelperName in interface DelegatorInterface
      Parameters:
      entity - the entity for which to get the helper (can be null)
      Returns:
      String with the helper name that corresponds to this delegator and the specified entity
    • getEntityHelper

      public GenericHelper getEntityHelper(String entityName) throws GenericEntityException
      Gets the helper that corresponds to this delegator and the specified entityName.
      Specified by:
      getEntityHelper in interface DelegatorInterface
      Parameters:
      entityName - The name of the entity to get the helper for
      Returns:
      GenericHelper that corresponds to this delegator and the specified entityName
      Throws:
      GenericEntityException
    • getEntityHelper

      public GenericHelper getEntityHelper(ModelEntity entity) throws GenericEntityException
      Gets the helper that corresponds to this delegator and the specified entity.
      Specified by:
      getEntityHelper in interface DelegatorInterface
      Parameters:
      entity - The entity for which to get the helper (required)
      Returns:
      GenericHelper that corresponds to this delegator and the specified entity
      Throws:
      GenericEntityException
    • getEntityFieldType

      public ModelFieldType getEntityFieldType(ModelEntity entity, String type) throws GenericEntityException
      Gets a field type instance by name from the helper that corresponds to the specified entity.
      Specified by:
      getEntityFieldType in interface DelegatorInterface
      Parameters:
      entity - The entity
      type - The name of the type
      Returns:
      ModelFieldType instance for the named type from the helper that corresponds to the specified entity
      Throws:
      GenericEntityException
    • getEntityFieldTypeNames

      public Collection<String> getEntityFieldTypeNames(ModelEntity entity) throws GenericEntityException
      Gets field type names from the helper that corresponds to the specified entity.
      Specified by:
      getEntityFieldTypeNames in interface DelegatorInterface
      Parameters:
      entity - The entity
      Returns:
      Collection of field type names from the helper that corresponds to the specified entity
      Throws:
      GenericEntityException
    • makeValue

      public GenericValue makeValue(String entityName, Map<String,?> fields)
      Creates a Entity in the form of a GenericValue without persisting it.
      Specified by:
      makeValue in interface DelegatorInterface
      Parameters:
      entityName - the type of entity to create (must exist in the model)
      fields - the entity fields and their values (can be null)
      Returns:
      the created value
    • makePK

      public GenericPK makePK(String entityName, Map<String,?> fields)
      Creates a Primary Key in the form of a GenericPK without persisting it.
      Specified by:
      makePK in interface DelegatorInterface
      Parameters:
      entityName - the type of entity for which to create a PK (must exist in the model)
      fields - the primary key fields and their values (can be null)
      Returns:
      the created PK
    • create

      public GenericValue create(String entityName, Map<String,?> fields) throws GenericEntityException
      Creates a Entity in the form of a GenericValue and write it to the database.
      Specified by:
      create in interface DelegatorInterface
      Parameters:
      entityName - the type of entity to create (if null, this method does nothing)
      fields - the field values to use (if null, this method does nothing)
      Returns:
      the created instance
      Throws:
      GenericEntityException
    • create

      public GenericValue create(GenericValue value) throws GenericEntityException
      Creates a Entity in the form of a GenericValue and write it to the datasource.
      Specified by:
      create in interface DelegatorInterface
      Parameters:
      value - The GenericValue to create a value in the datasource from
      Returns:
      GenericValue instance containing the new instance
      Throws:
      GenericEntityException
    • create

      public GenericValue create(GenericValue value, boolean doCacheClear) throws GenericEntityException
      Creates a Entity in the form of a GenericValue and write it to the datasource.
      Specified by:
      create in interface DelegatorInterface
      Parameters:
      value - The GenericValue from which to create a value in the datasource (required)
      doCacheClear - whether to automatically clear cache entries related to this operation
      Returns:
      GenericValue instance containing the new instance
      Throws:
      GenericEntityException
    • create

      public GenericValue create(GenericPK primaryKey) throws GenericEntityException
      Creates a Entity in the form of a GenericValue and write it to the datasource.
      Specified by:
      create in interface DelegatorInterface
      Parameters:
      primaryKey - The GenericPK to create a value in the datasource from
      Returns:
      GenericValue instance containing the new instance
      Throws:
      GenericEntityException
    • create

      public GenericValue create(GenericPK primaryKey, boolean doCacheClear) throws GenericEntityException
      Creates a Entity in the form of a GenericValue and write it to the datasource.
      Specified by:
      create in interface DelegatorInterface
      Parameters:
      primaryKey - the PK from which to create a value in the datasource (required)
      doCacheClear - whether to clear related cache entries for this primaryKey to be created
      Returns:
      GenericValue instance containing the new instance
      Throws:
      GenericEntityException
    • findByPrimaryKey

      public GenericValue findByPrimaryKey(GenericPK primaryKey) throws GenericEntityException
      Find a Generic Entity by its Primary Key.
      Specified by:
      findByPrimaryKey in interface DelegatorInterface
      Parameters:
      primaryKey - The primary key to find by.
      Returns:
      The GenericValue corresponding to the primaryKey
      Throws:
      GenericEntityException
    • findByPrimaryKeyCache

      public GenericValue findByPrimaryKeyCache(GenericPK primaryKey) throws GenericEntityException
      Find a cached Generic Entity by its Primary Key.
      Specified by:
      findByPrimaryKeyCache in interface DelegatorInterface
      Parameters:
      primaryKey - The primary key to find by.
      Returns:
      The GenericValue corresponding to the primaryKey
      Throws:
      GenericEntityException
    • findByPrimaryKey

      public GenericValue findByPrimaryKey(String entityName, Map<String,?> fields) throws GenericEntityException
      Find a Generic Entity by its Primary Key.
      Specified by:
      findByPrimaryKey in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      fields - The fields of the named entity to query by with their corresponging values
      Returns:
      The GenericValue corresponding to the primaryKey
      Throws:
      GenericEntityException
    • findByPrimaryKeyCache

      public GenericValue findByPrimaryKeyCache(String entityName, Map<String,?> fields) throws GenericEntityException
      Find a CACHED Generic Entity by its Primary Key.
      Specified by:
      findByPrimaryKeyCache in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      fields - The fields of the named entity to query by with their corresponging values
      Returns:
      The GenericValue corresponding to the primaryKey
      Throws:
      GenericEntityException
    • findByPrimaryKeyPartial

      public GenericValue findByPrimaryKeyPartial(GenericPK primaryKey, Set<String> keys) throws GenericEntityException
      Find a Generic Entity by its Primary Key and only returns the values requested by the passed keys (names).
      Specified by:
      findByPrimaryKeyPartial in interface DelegatorInterface
      Parameters:
      primaryKey - The primary key to find by.
      keys - The keys, or names, of the values to retrieve; only these values will be retrieved
      Returns:
      The GenericValue corresponding to the primaryKey
      Throws:
      GenericEntityException
    • findAllByPrimaryKeys

      public List<GenericValue> findAllByPrimaryKeys(Collection<? extends GenericPK> primaryKeys) throws GenericEntityException
      Find a number of Generic Value objects by their Primary Keys, all at once.
      Specified by:
      findAllByPrimaryKeys in interface DelegatorInterface
      Parameters:
      primaryKeys - A Collection of primary keys to find by.
      Returns:
      List of GenericValue objects corresponding to the passed primaryKey objects
      Throws:
      GenericEntityException
    • findAllByPrimaryKeysCache

      public List<GenericValue> findAllByPrimaryKeysCache(Collection<? extends GenericPK> primaryKeys) throws GenericEntityException
      Find a number of Generic Value objects by their Primary Keys, all at once; this first looks in the local cache for each PK and if there then it puts it in the return list rather than putting it in the batch to send to a given helper.
      Specified by:
      findAllByPrimaryKeysCache in interface DelegatorInterface
      Parameters:
      primaryKeys - A Collection of primary keys to find by.
      Returns:
      List of GenericValue objects corresponding to the passed primaryKey objects
      Throws:
      GenericEntityException
    • findAll

      public List<GenericValue> findAll(String entityName) throws GenericEntityException
      Finds all Generic entities of the given type.
      Specified by:
      findAll in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      Returns:
      all entities of the given type
      Throws:
      GenericEntityException
    • findAll

      public List<GenericValue> findAll(String entityName, List<String> orderBy) throws GenericEntityException
      Finds all Generic entities of the given type, optionally sorted.
      Specified by:
      findAll in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      orderBy - the entity fields by which to order the query; optionally add " ASC" for ascending or " DESC" for descending to each field name
      Returns:
      List containing all Generic entities
      Throws:
      GenericEntityException
    • findAllCache

      public List<GenericValue> findAllCache(String entityName) throws GenericEntityException
      Finds all Generic entities of the given type, looking first in the cache.
      Specified by:
      findAllCache in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      Returns:
      List containing all Generic entities
      Throws:
      GenericEntityException
    • findAllCache

      public List<GenericValue> findAllCache(String entityName, List<String> orderBy) throws GenericEntityException
      Finds all Generic entities, looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields.
      Specified by:
      findAllCache in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      orderBy - The fields of the named entity by which to order the query; optionally add " ASC" for ascending or " DESC" for descending
      Returns:
      all Generic entities
      Throws:
      GenericEntityException
    • findByAnd

      public List<GenericValue> findByAnd(String entityName, Map<String,?> fields) throws GenericEntityException
      Finds Generic Entity records by all of the specified fields (ie: combined using AND).
      Specified by:
      findByAnd in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      fields - The fields of the named entity to query by with their corresponging values
      Returns:
      List of GenericValue instances that match the query
      Throws:
      GenericEntityException
    • findByOr

      public List<GenericValue> findByOr(String entityName, Map<String,?> fields) throws GenericEntityException
      Finds Generic Entity records by any of the specified fields (i.e. combined using OR).
      Specified by:
      findByOr in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      fields - The fields of the named entity to query by with their corresponging values
      Returns:
      List of GenericValue instances that match the query
      Throws:
      GenericEntityException
    • findByAnd

      public List<GenericValue> findByAnd(String entityName, Map<String,?> fields, List<String> orderBy) throws GenericEntityException
      Finds Generic Entity records by all of the specified fields (i.e. combined using AND).
      Specified by:
      findByAnd in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      fields - the names and values of the fields by which to query (can be null)
      orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
      Returns:
      List of GenericValue instances that match the query
      Throws:
      GenericEntityException
    • findByAnd

      public List<GenericValue> findByAnd(ModelEntity modelEntity, Map<String,?> fields, List<String> orderBy) throws GenericEntityException
      Finds any entities matching the given criteria.
      Specified by:
      findByAnd in interface DelegatorInterface
      Parameters:
      modelEntity - the type of entity to find (required)
      fields - the names and values of the fields by which to query (can be null)
      orderBy - the names of fields by which to sort the results (can be null)
      Returns:
      any matching entities
      Throws:
      GenericEntityException
    • findByOr

      public List<GenericValue> findByOr(String entityName, Map<String,?> fields, List<String> orderBy) throws GenericEntityException
      Finds Generic Entity records by all of the specified fields (i.e. combined using OR).
      Specified by:
      findByOr in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      fields - The fields of the named entity to query by with their corresponging values
      orderBy - The fields of the named entity to order the query by; optionally add a " ASC" for ascending or " DESC" for descending
      Returns:
      List of GenericValue instances that match the query
      Throws:
      GenericEntityException
    • findByAndCache

      public List<GenericValue> findByAndCache(String entityName, Map<String,?> fields) throws GenericEntityException
      Finds Generic Entity records by all of the specified fields (i.e. combined using AND), looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields.
      Specified by:
      findByAndCache in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      fields - The fields of the named entity to query by with their corresponging values
      Returns:
      List of GenericValue instances that match the query
      Throws:
      GenericEntityException
    • findByAndCache

      public List<GenericValue> findByAndCache(String entityName, Map<String,?> fields, List<String> orderBy) throws GenericEntityException
      Finds Generic Entity records by all of the specified fields (i.e. combined using AND), looking first in the cache; uses orderBy for lookup, but only keys results on the entityName and fields.
      Specified by:
      findByAndCache in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      fields - The fields of the named entity to query by with their corresponging values
      orderBy - The fields of the named entity to order the query by; optionally add " ASC" for ascending or " DESC" for descending
      Returns:
      List of GenericValue instances that match the query
      Throws:
      GenericEntityException
    • findByAnd

      public List<GenericValue> findByAnd(String entityName, List<? extends EntityCondition> expressions) throws GenericEntityException
      Finds Generic Entity records by all of the specified expressions (ie: combined using AND).
      Specified by:
      findByAnd in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      expressions - The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare to
      Returns:
      List of GenericValue instances that match the query
      Throws:
      GenericEntityException
    • findByAnd

      public List<GenericValue> findByAnd(String entityName, List<? extends EntityCondition> expressions, List<String> orderBy) throws GenericEntityException
      Finds Generic Entity records by all of the specified expressions (i.e. combined using AND).
      Specified by:
      findByAnd in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      expressions - The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare to
      orderBy - The fields of the named entity to order the query by; optionally add " ASC" for ascending or " DESC" for descending
      Returns:
      List of GenericValue instances that match the query
      Throws:
      GenericEntityException
    • findByOr

      public List<GenericValue> findByOr(String entityName, List<? extends EntityCondition> expressions) throws GenericEntityException
      Finds Generic Entity records by all of the specified expressions (i.e. combined using OR).
      Specified by:
      findByOr in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      expressions - The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare to
      Returns:
      List of GenericValue instances that match the query
      Throws:
      GenericEntityException
    • findByOr

      public List<GenericValue> findByOr(String entityName, List<? extends EntityCondition> expressions, List<String> orderBy) throws GenericEntityException
      Finds Generic Entity records by all of the specified expressions (i.e. combined using OR).
      Specified by:
      findByOr in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      expressions - The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare to
      orderBy - The fields of the named entity to order the query by; optionally add " ASC" for ascending or " DESC" for descending
      Returns:
      List of GenericValue instances that match the query
      Throws:
      GenericEntityException
    • findByLike

      public List<GenericValue> findByLike(String entityName, Map<String,?> fields) throws GenericEntityException
      Specified by:
      findByLike in interface DelegatorInterface
      Throws:
      GenericEntityException
    • findByLike

      public List<GenericValue> findByLike(String entityName, Map<String,?> fields, List<String> orderBy) throws GenericEntityException
      Specified by:
      findByLike in interface DelegatorInterface
      Throws:
      GenericEntityException
    • findByCondition

      public List<GenericValue> findByCondition(String entityName, EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) throws GenericEntityException
      Finds any GenericValues matching the given conditions.
      Specified by:
      findByCondition in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity model XML file
      entityCondition - The EntityCondition object that specifies how to constrain this query
      fieldsToSelect - The fields of the named entity to get from the database; if empty or null all fields will be retreived
      orderBy - The fields of the named entity by which to order the query; optionally add " ASC" for ascending or " DESC" for descending
      Returns:
      any matching values
      Throws:
      GenericEntityException
    • countByAnd

      public int countByAnd(String entityName, String fieldName, List<? extends EntityCondition> expressions, EntityFindOptions findOptions) throws GenericEntityException
      Returns the count of the results that match all of the specified expressions (i.e. combined using AND).
      Specified by:
      countByAnd in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity model XML file
      fieldName - The field of the named entity to count, if null this is equivalent to count(*)
      expressions - The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare to
      findOptions - An instance of EntityFindOptions that specifies advanced query options. The only option that is used is distinct, in which case a select (distinct fieldname) is issued.

      If you issue a distinct without a fieldName, it will be ignored because select count (distinct *) makes no sense

      Returns:
      the number of rows that match the query
      Throws:
      GenericEntityException
    • countByOr

      public int countByOr(String entityName, String fieldName, List<? extends EntityCondition> expressions, EntityFindOptions findOptions) throws GenericEntityException
      Returns the count of the results that match any of the specified expressions (i.e. combined using OR).
      Specified by:
      countByOr in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity model XML file
      fieldName - The field of the named entity to count, if null this is equivalent to count(*)
      expressions - The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare to
      findOptions - An instance of EntityFindOptions that specifies advanced query options. The only option that is used is distinct, in which case a select (distinct fieldname) is issued.

      If you issue a distinct without a fieldName, it will be ignored because select count (distinct *) makes no sense

      Returns:
      the number of rows that match the query
      Throws:
      GenericEntityException
    • countByCondition

      public int countByCondition(String entityName, String fieldName, EntityCondition entityCondition, EntityFindOptions findOptions) throws GenericEntityException
      Returns the count of the results that match any of the specified expressions (ie: combined using OR).
      Specified by:
      countByCondition in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity model XML file
      fieldName - The field of the named entity to count, if null this is equivalent to count(*)
      entityCondition - The EntityCondition object that specifies how to constrain this query The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare to
      findOptions - An instance of EntityFindOptions that specifies advanced query options. The only option that is used is distinct, in which case a select (distinct fieldname) is issued.

      If you issue a distinct without a fieldName, it will be ignored as select count (distinct *) makes no sense

      Returns:
      the number of rows that match the query
      Throws:
      GenericEntityException
    • countAll

      public int countAll(String entityName) throws GenericEntityException
      Returns the row count of the specified entity.
      Specified by:
      countAll in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity model XML file
      Returns:
      the number of rows in the table
      Throws:
      GenericEntityException
    • findListIteratorByCondition

      public EntityListIterator findListIteratorByCondition(String entityName, EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) throws GenericEntityException
      Finds GenericValues by the given conditions.
      Specified by:
      findListIteratorByCondition in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity model XML file
      entityCondition - The EntityCondition object that specifies how to constrain this query before any groupings are done (if this is a view entity with group-by aliases)
      fieldsToSelect - The fields of the named entity to get from the database; if empty or null all fields will be retreived
      orderBy - The fields of the named entity to order the query by; optionally add " ASC" for ascending or " DESC" for descending
      Returns:
      EntityListIterator representing the result of the query: NOTE THAT THIS MUST BE CLOSED WHEN YOU ARE DONE WITH IT, AND DON'T LEAVE IT OPEN TOO LONG BECAUSE IT WILL MAINTAIN A DATABASE CONNECTION.
      Throws:
      GenericEntityException
    • findListIteratorByCondition

      public EntityListIterator findListIteratorByCondition(String entityName, EntityCondition whereEntityCondition, EntityCondition havingEntityCondition, Collection<String> fieldsToSelect, List<String> orderBy, EntityFindOptions findOptions) throws GenericEntityException
      Finds GenericValues by the given conditions.
      Specified by:
      findListIteratorByCondition in interface DelegatorInterface
      Parameters:
      entityName - The ModelEntity of the Entity as defined in the entity XML file
      whereEntityCondition - The EntityCondition object that specifies how to constrain this query before any groupings are done (if this is a view entity with group-by aliases)
      havingEntityCondition - The EntityCondition object that specifies how to constrain this query after any groupings are done (if this is a view entity with group-by aliases)
      fieldsToSelect - The fields of the named entity to get from the database; if empty or null all fields will be retreived
      orderBy - The fields of the named entity to order the query by; optionally add " ASC" for ascending or " DESC" for descending
      findOptions - An instance of EntityFindOptions that specifies advanced query options. See the EntityFindOptions JavaDoc for more details.
      Returns:
      EntityListIterator representing the result of the query: NOTE THAT THIS MUST BE CLOSED WHEN YOU ARE DONE WITH IT, AND DON'T LEAVE IT OPEN TOO LONG BECAUSE IT WILL MAINTAIN A DATABASE CONNECTION.
      Throws:
      GenericEntityException
      See Also:
    • removeByPrimaryKey

      public int removeByPrimaryKey(GenericPK primaryKey) throws GenericEntityException
      Remove a Generic Entity corresponding to the primaryKey.
      Specified by:
      removeByPrimaryKey in interface DelegatorInterface
      Parameters:
      primaryKey - The primary key of the entity to remove.
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • removeByPrimaryKey

      public int removeByPrimaryKey(GenericPK primaryKey, boolean doCacheClear) throws GenericEntityException
      Remove a Generic Entity corresponding to the primaryKey.
      Specified by:
      removeByPrimaryKey in interface DelegatorInterface
      Parameters:
      primaryKey - The primary key of the entity to remove.
      doCacheClear - boolean that specifies whether to clear cache entries for this primaryKey to be removed
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • removeValue

      public int removeValue(GenericValue value) throws GenericEntityException
      Remove a Generic Value from the database.
      Specified by:
      removeValue in interface DelegatorInterface
      Parameters:
      value - The GenericValue object of the entity to remove.
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • removeValue

      public int removeValue(GenericValue value, boolean doCacheClear) throws GenericEntityException
      Remove a Generic Value from the database.
      Specified by:
      removeValue in interface DelegatorInterface
      Parameters:
      value - The GenericValue object of the entity to remove.
      doCacheClear - boolean that specifies whether to clear cache entries for this value to be removed
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • removeByAnd

      public int removeByAnd(String entityName, Map<String,?> fields) throws GenericEntityException
      Removes/deletes Generic Entity records found by all of the specified fields (ie: combined using AND).
      Specified by:
      removeByAnd in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      fields - The fields of the named entity to query by with their corresponging values
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • removeByAnd

      public int removeByAnd(String entityName, Map<String,?> fields, boolean doCacheClear) throws GenericEntityException
      Removes/deletes Generic Entity records found by all of the specified fields (ie: combined using AND).
      Specified by:
      removeByAnd in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      fields - The fields of the named entity to query by with their corresponging values
      doCacheClear - boolean that specifies whether to clear cache entries for this value to be removed
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • removeByCondition

      public int removeByCondition(String entityName, EntityCondition whereCondition) throws GenericEntityException
      Removes/deletes Generic Entity records found by matching the EntityCondition.
      Specified by:
      removeByCondition in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      whereCondition - The EntityCondition object that specifies how to constrain this query
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • removeByCondition

      public int removeByCondition(String entityName, EntityCondition whereCondition, boolean doCacheClear) throws GenericEntityException
      Removes/deletes Generic Entity records found by matching the EntityCondition.
      Specified by:
      removeByCondition in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      whereCondition - The EntityCondition object that specifies how to constrain this query
      doCacheClear - boolean that specifies whether to clear cache entries for this value to be removed
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • getMultiRelation

      public List<GenericValue> getMultiRelation(GenericValue value, String relationNameOne, String relationNameTwo, List<String> orderBy) throws GenericEntityException
      Get the named Related Entity for the GenericValue from the persistent store across another Relation. Helps to get related Values in a multi-to-multi relationship.
      Specified by:
      getMultiRelation in interface DelegatorInterface
      Parameters:
      relationNameOne - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file, for first relation
      relationNameTwo - String containing the relation name for second relation
      value - GenericValue instance containing the entity
      orderBy - The fields of the named entity to order the query by; may be null; optionally add a " ASC" for ascending or " DESC" for descending
      Returns:
      List of GenericValue instances as specified in the relation definition
      Throws:
      GenericEntityException
    • getMultiRelation

      public List<GenericValue> getMultiRelation(GenericValue value, String relationNameOne, String relationNameTwo) throws GenericEntityException
      Get the named Related Entity for the GenericValue from the persistent store across another Relation. Helps to get related Values in a multi-to-multi relationship.
      Specified by:
      getMultiRelation in interface DelegatorInterface
      Parameters:
      relationNameOne - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file, for first relation
      relationNameTwo - String containing the relation name for second relation
      value - GenericValue instance containing the entity
      Returns:
      List of GenericValue instances as specified in the relation definition
      Throws:
      GenericEntityException
    • getRelated

      public List<GenericValue> getRelated(String relationName, GenericValue value) throws GenericEntityException
      Get the named Related Entity for the GenericValue from the persistent store
      Specified by:
      getRelated in interface DelegatorInterface
      Parameters:
      relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
      value - GenericValue instance containing the entity
      Returns:
      List of GenericValue instances as specified in the relation definition
      Throws:
      GenericEntityException
    • getRelatedByAnd

      public List<GenericValue> getRelatedByAnd(String relationName, Map<String,?> byAndFields, GenericValue value) throws GenericEntityException
      Get the named Related Entity for the GenericValue from the persistent store.
      Specified by:
      getRelatedByAnd in interface DelegatorInterface
      Parameters:
      relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
      byAndFields - the fields that must equal in order to keep; may be null
      value - GenericValue instance containing the entity
      Returns:
      List of GenericValue instances as specified in the relation definition
      Throws:
      GenericEntityException
    • getRelatedOrderBy

      public List<GenericValue> getRelatedOrderBy(String relationName, List<String> orderBy, GenericValue value) throws GenericEntityException
      Get the named Related Entity for the GenericValue from the persistent store.
      Specified by:
      getRelatedOrderBy in interface DelegatorInterface
      Parameters:
      relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
      orderBy - The fields of the named entity to order the query by; may be null; optionally add a " ASC" for ascending or " DESC" for descending
      value - GenericValue instance containing the entity
      Returns:
      List of GenericValue instances as specified in the relation definition
      Throws:
      GenericEntityException
    • getRelated

      public List<GenericValue> getRelated(String relationName, Map<String,?> byAndFields, List<String> orderBy, GenericValue value) throws GenericEntityException
      Get the named Related Entity for the GenericValue from the persistent store.
      Specified by:
      getRelated in interface DelegatorInterface
      Parameters:
      relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
      byAndFields - the fields that must equal in order to keep; may be null
      orderBy - The fields of the named entity to order the query by; may be null; optionally add a " ASC" for ascending or " DESC" for descending
      value - GenericValue instance containing the entity
      Returns:
      List of GenericValue instances as specified in the relation definition
      Throws:
      GenericEntityException
    • getRelatedDummyPK

      public GenericPK getRelatedDummyPK(String relationName, Map<String,?> byAndFields, GenericValue value) throws GenericEntityException
      Get a dummy primary key for the named Related Entity for the GenericValue.
      Specified by:
      getRelatedDummyPK in interface DelegatorInterface
      Parameters:
      relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
      byAndFields - the fields that must equal in order to keep; may be null
      value - GenericValue instance containing the entity
      Returns:
      GenericPK containing a possibly incomplete PrimaryKey object representing the related entity or entities
      Throws:
      GenericEntityException
    • getRelatedCache

      public List<GenericValue> getRelatedCache(String relationName, GenericValue value) throws GenericEntityException
      Get the named Related Entity for the GenericValue from the persistent store, checking first in the cache to see if the desired value is there.
      Specified by:
      getRelatedCache in interface DelegatorInterface
      Parameters:
      relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
      value - GenericValue instance containing the entity
      Returns:
      List of GenericValue instances as specified in the relation definition
      Throws:
      GenericEntityException
    • getRelatedOne

      public GenericValue getRelatedOne(String relationName, GenericValue value) throws GenericEntityException
      Get related entity where relation is of type one, uses findByPrimaryKey.
      Specified by:
      getRelatedOne in interface DelegatorInterface
      Parameters:
      relationName - the name of the relation to get (required)
      value - the value whose relation to get (required)
      Throws:
      IllegalArgumentException - if the list found has more than one item
      GenericEntityException
    • getRelatedOneCache

      public GenericValue getRelatedOneCache(String relationName, GenericValue value) throws GenericEntityException
      Get related entity where relation is of type one, uses findByPrimaryKey, checking first in the cache to see if the desired value is there.
      Specified by:
      getRelatedOneCache in interface DelegatorInterface
      Parameters:
      relationName - the name of the relation to get (required)
      value - the value whose relation to get (required)
      Throws:
      IllegalArgumentException - if the list found has more than one item
      GenericEntityException
    • removeRelated

      public int removeRelated(String relationName, GenericValue value) throws GenericEntityException
      Remove the named Related Entity for the GenericValue from the persistent store.
      Specified by:
      removeRelated in interface DelegatorInterface
      Parameters:
      relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
      value - GenericValue instance containing the entity
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • removeRelated

      public int removeRelated(String relationName, GenericValue value, boolean doCacheClear) throws GenericEntityException
      Remove the named Related Entity for the GenericValue from the persistent store.
      Specified by:
      removeRelated in interface DelegatorInterface
      Parameters:
      relationName - String containing the relation name which is the combination of relation.title and relation.rel-entity-name as specified in the entity XML definition file
      value - GenericValue instance containing the entity
      doCacheClear - boolean that specifies whether to clear cache entries for this value to be removed
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • refresh

      public void refresh(GenericValue value) throws GenericEntityException
      Refresh the Entity for the GenericValue from the persistent store.
      Specified by:
      refresh in interface DelegatorInterface
      Parameters:
      value - GenericValue instance containing the entity to refresh
      Throws:
      GenericEntityException
    • refresh

      public void refresh(GenericValue value, boolean doCacheClear) throws GenericEntityException
      Refresh the Entity for the GenericValue from the persistent store.
      Specified by:
      refresh in interface DelegatorInterface
      Parameters:
      value - GenericValue instance containing the entity to refresh
      doCacheClear - whether to automatically clear cache entries related to this operation
      Throws:
      GenericEntityException
    • store

      public int store(GenericValue value) throws GenericEntityException
      Store the Entity from the GenericValue to the persistent store.
      Specified by:
      store in interface DelegatorInterface
      Parameters:
      value - GenericValue instance containing the entity
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • store

      public int store(GenericValue value, boolean doCacheClear) throws GenericEntityException
      Store the Entity from the GenericValue to the persistent store.
      Specified by:
      store in interface DelegatorInterface
      Parameters:
      value - GenericValue instance containing the entity
      doCacheClear - whether to automatically clear cache entries related to this operation
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • storeAll

      public int storeAll(List<? extends GenericValue> values) throws GenericEntityException
      Store the Entities from the List GenericValue instances to the persistent store.
      This is different than the normal store method in that the store method only does an update, while the storeAll method checks to see if each entity exists, then either does an insert or an update as appropriate.
      These updates all happen in one transaction, so they will either all succeed or all fail, if the data source supports transactions. This is just like to othersToStore feature of the GenericEntity on a create or store.
      Specified by:
      storeAll in interface DelegatorInterface
      Parameters:
      values - List of GenericValue instances containing the entities to store
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • storeAll

      public int storeAll(List<? extends GenericValue> values, boolean doCacheClear) throws GenericEntityException
      Store the Entities from the List GenericValue instances to the persistent store.
      This is different than the normal store method in that the store method only does an update, while the storeAll method checks to see if each entity exists, then either does an insert or an update as appropriate.
      These updates all happen in one transaction, so they will either all succeed or all fail, if the data source supports transactions. This is just like to othersToStore feature of the GenericEntity on a create or store.
      Specified by:
      storeAll in interface DelegatorInterface
      Parameters:
      values - List of GenericValue instances containing the entities to store
      doCacheClear - whether to automatically clear cache entries related to this operation
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • removeAll

      public int removeAll(List<? extends GenericEntity> dummyPKs) throws GenericEntityException
      Remove the Entities from the List from the persistent store.
      The List contains GenericEntity objects, can be either GenericPK or GenericValue.
      If a certain entity contains a complete primary key, the entity in the datasource corresponding to that primary key will be removed, this is like a removeByPrimary Key.
      On the other hand, if a certain entity is an incomplete or non primary key, if will behave like the removeByAnd method.
      These updates all happen in one transaction, so they will either all succeed or all fail, if the data source supports transactions.
      Specified by:
      removeAll in interface DelegatorInterface
      Parameters:
      dummyPKs - Collection of GenericEntity instances containing the entities or by and fields to remove
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • removeAll

      public int removeAll(List<? extends GenericEntity> dummyPKs, boolean doCacheClear) throws GenericEntityException
      Remove the Entities from the List from the persistent store.
      The List contains GenericEntity objects, can be either GenericPK or GenericValue.
      If a certain entity contains a complete primary key, the entity in the datasource corresponding to that primary key will be removed, this is like a removeByPrimary Key.
      On the other hand, if a certain entity is an incomplete or non primary key, if will behave like the removeByAnd method.
      These updates all happen in one transaction, so they will either all succeed or all fail, if the data source supports transactions.
      Specified by:
      removeAll in interface DelegatorInterface
      Parameters:
      dummyPKs - Collection of GenericEntity instances containing the entities or by and fields to remove
      doCacheClear - whether to automatically clear cache entries related to this operation
      Returns:
      int representing number of rows affected by this operation
      Throws:
      GenericEntityException
    • clearAllCaches

      public void clearAllCaches()
      This method is a shortcut to completely clear all entity engine caches. For performance reasons this should not be called very often.
      Specified by:
      clearAllCaches in interface DelegatorInterface
    • clearAllCaches

      public void clearAllCaches(boolean distribute)
      Specified by:
      clearAllCaches in interface DelegatorInterface
    • clearCacheLine

      public void clearCacheLine(String entityName, Map<String,?> fields)
      Remove a CACHED Generic Entity (List) from the cache, either a PK, ByAnd, or All
      Specified by:
      clearCacheLine in interface DelegatorInterface
      Parameters:
      entityName - The Name of the Entity as defined in the entity XML file
      fields - The fields of the named entity to query by with their corresponging values
    • clearCacheLineFlexible

      public void clearCacheLineFlexible(GenericEntity dummyPK)
      Remove a CACHED Generic Entity from the cache by its primary key. Checks whether the passed GenericPK is a complete primary key; if it is, then the cache line will be removed from the primaryKeyCache; if it is NOT a complete primary key it will remove the cache line from the andCache. If the fields map is empty, then the allCache for the entity will be cleared.
      Specified by:
      clearCacheLineFlexible in interface DelegatorInterface
      Parameters:
      dummyPK - The dummy primary key to clear by.
    • clearCacheLineFlexible

      public void clearCacheLineFlexible(GenericEntity dummyPK, boolean distribute)
      Specified by:
      clearCacheLineFlexible in interface DelegatorInterface
    • clearCacheLine

      public void clearCacheLine(GenericPK primaryKey)
      Remove a CACHED Generic Entity from the cache by its primary key, does NOT check to see if the passed GenericPK is a complete primary key. Also tries to clear the corresponding all cache entry.
      Specified by:
      clearCacheLine in interface DelegatorInterface
      Parameters:
      primaryKey - The primary key to clear by.
    • clearCacheLine

      public void clearCacheLine(GenericPK primaryKey, boolean distribute)
      Specified by:
      clearCacheLine in interface DelegatorInterface
    • clearCacheLine

      public void clearCacheLine(GenericValue value)
      Remove a CACHED GenericValue from as many caches as it can. Automatically tries to remove entries from the all cache, the by primary key cache, and the "by and" cache. This is the ONLY method that tries to clear automatically from the by and cache.
      Specified by:
      clearCacheLine in interface DelegatorInterface
      Parameters:
      value - The primary key to clear by.
    • clearCacheLine

      public void clearCacheLine(GenericValue value, boolean distribute)
      Specified by:
      clearCacheLine in interface DelegatorInterface
    • getFieldNameSetsCopy

      public Set<Set<String>> getFieldNameSetsCopy(String entityName)
      Gets a Set of Sets of fieldNames used in the by and cache for the given entityName.
      Specified by:
      getFieldNameSetsCopy in interface DelegatorInterface
      Parameters:
      entityName - the entity for which to get the field names (can be null)
      Returns:
      null if the field name is null or simply unknown
    • clearAllCacheLinesByDummyPK

      public void clearAllCacheLinesByDummyPK(Collection<? extends GenericEntity> dummyPKs)
      Specified by:
      clearAllCacheLinesByDummyPK in interface DelegatorInterface
    • clearAllCacheLinesByValue

      public void clearAllCacheLinesByValue(Collection<? extends GenericValue> values)
      Specified by:
      clearAllCacheLinesByValue in interface DelegatorInterface
    • getFromPrimaryKeyCache

      public GenericValue getFromPrimaryKeyCache(GenericPK primaryKey)
      Specified by:
      getFromPrimaryKeyCache in interface DelegatorInterface
    • getFromAllCache

      public List<GenericValue> getFromAllCache(String entityName)
      Specified by:
      getFromAllCache in interface DelegatorInterface
    • getFromAndCache

      public List<GenericValue> getFromAndCache(String entityName, Map<String,?> fields)
      Specified by:
      getFromAndCache in interface DelegatorInterface
    • getFromAndCache

      public List<GenericValue> getFromAndCache(ModelEntity entity, Map<String,?> fields)
      Specified by:
      getFromAndCache in interface DelegatorInterface
    • putInPrimaryKeyCache

      public void putInPrimaryKeyCache(GenericPK primaryKey, GenericValue value)
      Specified by:
      putInPrimaryKeyCache in interface DelegatorInterface
    • putAllInPrimaryKeyCache

      public void putAllInPrimaryKeyCache(List<? extends GenericValue> values)
      Specified by:
      putAllInPrimaryKeyCache in interface DelegatorInterface
    • putInAllCache

      public void putInAllCache(String entityName, List<? extends GenericValue> values)
      Specified by:
      putInAllCache in interface DelegatorInterface
    • putInAllCache

      public void putInAllCache(ModelEntity entity, List<? extends GenericValue> values)
      Specified by:
      putInAllCache in interface DelegatorInterface
    • putInAndCache

      public void putInAndCache(String entityName, Map<String,?> fields, List<? extends GenericValue> values)
      Specified by:
      putInAndCache in interface DelegatorInterface
    • putInAndCache

      public void putInAndCache(ModelEntity entity, Map<String,?> fields, List<? extends GenericValue> values)
      Specified by:
      putInAndCache in interface DelegatorInterface
    • readXmlDocument

      Parses the given XML file for entities. Does not insert them into the database.
      Parameters:
      url - the URL of the XML file (can be null)
      Returns:
      null if a null URL was given, otherwise the parsed entities
      Throws:
      SAXException
      ParserConfigurationException
      IOException
    • makeValues

      public List<GenericValue> makeValues(Document document)
      Parses the given XML document for entities. Does not insert them into the database.
      Parameters:
      document - the document to parse (can be null)
      Returns:
      null if a null document was given, otherwise the parsed entities
    • makePK

      public GenericPK makePK(Element element)
    • makeValue

      public GenericValue makeValue(Element element)
    • getNextSeqId

      public Long getNextSeqId(String seqName, boolean clusterMode)
      Description copied from interface: DelegatorInterface
      Get the next guaranteed unique seq id from the sequence with the given sequence name; if the named sequence doesn't exist, it will be created.

      If the instance should be running in cluster mode then it will try a SELECT FOR UPDATE approach to retrieving the next bank of sequence ids, to avoid potential collisions with other nodes.

      If not in cluster mode, this is not required, and the existing JVM synchronization locking is enough.

      It will be in clusterMode if true is passed as a parameter, or if EntityConfigUtil.DelegatorInfo.useDistributedCacheClear is enabled

      Specified by:
      getNextSeqId in interface DelegatorInterface
      Parameters:
      seqName - The name of the sequence to get the next seq id from
      clusterMode - Is this a node in a clustered instance or not
      Returns:
      Long with the next seq id for the given sequence name
    • setSequencer

      public void setSequencer(SequenceUtil sequencer)
      Allows you to pass a SequenceUtil class (possibly one that overrides the getNextSeqId method); if null is passed will effectively refresh the sequencer.
      Specified by:
      setSequencer in interface DelegatorInterface
      Parameters:
      sequencer - the sequencer to set
    • refreshSequencer

      public void refreshSequencer()
      Refreshes the ID sequencer clearing all cached bank values.
      Specified by:
      refreshSequencer in interface DelegatorInterface
    • getPrimaryKeyCache

      public UtilCache<GenericEntity,GenericValue> getPrimaryKeyCache()
      Specified by:
      getPrimaryKeyCache in interface DelegatorInterface
    • getAndCache

      public UtilCache<GenericPK,List<GenericValue>> getAndCache()
      Specified by:
      getAndCache in interface DelegatorInterface
    • getAllCache

      public UtilCache<String,List<GenericValue>> getAllCache()
      Specified by:
      getAllCache in interface DelegatorInterface
    • transform

      public List<GenericValue> transform(String entityName, EntityCondition entityCondition, List<String> orderBy, String lockField, Transformation transformation) throws GenericEntityException
      Description copied from interface: DelegatorInterface
      Applies the given transformation to any entities matching the given condition.
      Specified by:
      transform in interface DelegatorInterface
      Parameters:
      entityName - the type of entity to transform (required)
      entityCondition - the condition that selects the entities to transform (null means transform all)
      orderBy - the order in which the entities should be selected for updating (null means no ordering)
      lockField - the entity field to use for optimistic locking; the value of this field will be read between the SELECT and the UPDATE to determine whether another process has updated one of the target records in the meantime; if so, the transformation will be reapplied and another UPDATE attempted
      transformation - the transformation to apply (required)
      Returns:
      the transformed entities in the order they were selected (never null)
      Throws:
      GenericEntityException
    • getSqlEscapeHelper

      public SqlEscapeHelper getSqlEscapeHelper()
      Specified by:
      getSqlEscapeHelper in interface DelegatorInterface