org.hibernate.cache
Class CacheKey
java.lang.Object
org.hibernate.cache.CacheKey
- All Implemented Interfaces:
- java.io.Serializable
public class CacheKey
- extends java.lang.Object
- implements java.io.Serializable
Allows multiple entity classes / collection roles to be
stored in the same cache region. Also allows for composite
keys which do not properly implement equals()/hashCode().
- Author:
- Gavin King
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
CacheKey
public CacheKey(java.io.Serializable id,
Type type,
java.lang.String entityOrRoleName,
EntityMode entityMode,
SessionFactoryImplementor factory)
- Construct a new key for a collection or entity instance.
Note that an entity name should always be the root entity
name, not a subclass entity name.
- Parameters:
id
- The identifier associated with the cached datatype
- The Hibernate type mappingentityOrRoleName
- The entity or collection-role name.entityMode
- The entiyt mode of the originating sessionfactory
- The session factory for which we are caching
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
getKey
public java.io.Serializable getKey()
getEntityOrRoleName
public java.lang.String getEntityOrRoleName()
Copyright © 2008 Hibernate.org. All Rights Reserved.