Class AbstractEntityConditionCache<K,V>

java.lang.Object
org.apache.ofbiz.entity.cache.AbstractCache<EntityCondition,ConcurrentMap<K,V>>
org.apache.ofbiz.entity.cache.AbstractEntityConditionCache<K,V>
Type Parameters:
K - the type parameter
V - the type parameter
Direct Known Subclasses:
EntityListCache, EntityObjectCache

public abstract class AbstractEntityConditionCache<K,V> extends AbstractCache<EntityCondition,ConcurrentMap<K,V>>
The type AbstractEntityConditionCache.
  • Constructor Details

    • AbstractEntityConditionCache

      protected AbstractEntityConditionCache(String delegatorName, String id)
  • Method Details

    • get

      protected V get(String entityName, EntityCondition condition, K key)
      Get v.
      Parameters:
      entityName - the entity name
      condition - the condition
      key - the key
      Returns:
      the v
    • put

      protected V put(String entityName, EntityCondition condition, K key, V value)
      Put v.
      Parameters:
      entityName - the entity name
      condition - the condition
      key - the key
      value - the value
      Returns:
      the v
    • remove

      public void remove(GenericEntity entity)
      Removes all condition caches that include the specified entity.
    • remove

      public void remove(String entityName, EntityCondition condition)
      Remove.
      Parameters:
      entityName - the entity name
      condition - the condition
    • remove

      protected V remove(String entityName, EntityCondition condition, K key)
      Remove v.
      Parameters:
      entityName - the entity name
      condition - the condition
      key - the key
      Returns:
      the v
    • getConditionKey

      public static final EntityCondition getConditionKey(EntityCondition condition)
    • getFrozenConditionKey

      public static final EntityCondition getFrozenConditionKey(EntityCondition condition)
    • getConditionCache

      protected ConcurrentMap<K,V> getConditionCache(String entityName, EntityCondition condition)
      Gets condition cache.
      Parameters:
      entityName - the entity name
      condition - the condition
      Returns:
      the condition cache
    • getOrCreateConditionCache

      protected Map<K,V> getOrCreateConditionCache(String entityName, EntityCondition condition)
      Gets or create condition cache.
      Parameters:
      entityName - the entity name
      condition - the condition
      Returns:
      the or create condition cache
    • isNull

      protected static final <K, V> boolean isNull(Map<K,V> value)
    • getModelCheckValid

      protected ModelEntity getModelCheckValid(GenericEntity oldEntity, GenericEntity newEntity)
      Gets model check valid.
      Parameters:
      oldEntity - the old entity
      newEntity - the new entity
      Returns:
      the model check valid
    • storeHook

      public void storeHook(GenericEntity newEntity)
      Store hook.
      Parameters:
      newEntity - the new entity
    • storeHook

      public void storeHook(GenericEntity oldEntity, GenericEntity newEntity)
      Store hook.
      Parameters:
      oldEntity - the old entity
      newEntity - the new entity if oldValue == null, then this is a new entity if newValue == null, then
    • storeHook

      public void storeHook(GenericPK oldPK, GenericEntity newEntity)
      Store hook.
      Parameters:
      oldPK - the old pk
      newEntity - the new entity if oldValue == null, then this is a new entity if newValue == null, then
    • convert

      protected List<? extends Map<String,Object>> convert(String targetEntityName, GenericEntity entity)
      Convert list.
      Parameters:
      targetEntityName - the target entity name
      entity - the entity
      Returns:
      the list
    • storeHook

      public void storeHook(boolean isPK, GenericEntity oldEntity, GenericEntity newEntity)
      Store hook.
      Parameters:
      isPK - the is pk
      oldEntity - the old entity
      newEntity - the new entity
    • storeHook

      protected <T1 extends Map<String, Object>, T2 extends Map<String, Object>> void storeHook(String entityName, boolean isPK, List<T1> oldValues, List<T2> newValues)
      Store hook.
      Type Parameters:
      T1 - the type parameter
      T2 - the type parameter
      Parameters:
      entityName - the entity name
      isPK - the is pk
      oldValues - the old values
      newValues - the new values