Class FirstLevelCache


  • public class FirstLevelCache
    extends Object
    First level cache for versioned entities, versions reader-scoped. Each entity is uniquely identified by a revision number and entity id.
    • Constructor Detail

      • FirstLevelCache

        public FirstLevelCache()
    • Method Detail

      • putOnEntityNameCache

        public void putOnEntityNameCache​(Object id,
                                         Number revision,
                                         Object entity,
                                         String entityName)
        Adds the entityName into the cache. The key is a triple make with primaryKey, revision and entity
        Parameters:
        id - primaryKey
        revision - revision number
        entity - object retrieved by envers
        entityName - value of the cache
      • getFromEntityNameCache

        public String getFromEntityNameCache​(Object id,
                                             Number revision,
                                             Object entity)
        Gets the entityName from the cache. The key is a triple make with primaryKey, revision and entity
        Parameters:
        id - primaryKey
        revision - revision number
        entity - object retrieved by envers
        Returns:
        The appropriate entity name
      • containsEntityName

        public boolean containsEntityName​(Object id,
                                          Number revision,
                                          Object entity)
        Parameters:
        id - primaryKey
        revision - revision number
        entity - object retrieved by envers
        Returns:
        true if entityNameCache contains the triple