Package org.hibernate.cache.internal
Class CacheKeyImplementation
- java.lang.Object
-
- org.hibernate.cache.internal.CacheKeyImplementation
-
- All Implemented Interfaces:
Serializable
@Internal public final class CacheKeyImplementation extends Object implements 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(). This was named org.hibernate.cache.spi.CacheKey in Hibernate until version 5. Temporarily maintained as a reference while all components catch up with the refactoring to the caching interfaces.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CacheKeyImplementation(Object id, Serializable disassembledKey, Type type, String entityOrRoleName, String tenantId)
Construct a new key for a collection or entity instance.CacheKeyImplementation(Object id, String entityOrRoleName, String tenantId, int hashCode)
Construct a new key for a collection or entity instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
String
getEntityOrRoleName()
Object
getId()
String
getTenantId()
int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
CacheKeyImplementation
@Internal public CacheKeyImplementation(Object id, Serializable disassembledKey, Type type, String entityOrRoleName, String tenantId)
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 datadisassembledKey
-type
- The Hibernate type mappingentityOrRoleName
- The entity or collection-role name.tenantId
- The tenant identifier associated with this data.
-
CacheKeyImplementation
@Internal public CacheKeyImplementation(Object id, String entityOrRoleName, String tenantId, int hashCode)
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 dataentityOrRoleName
- The entity or collection-role name.tenantId
- The tenant identifier associated with this data.hashCode
- the pre-calculated hash code
-
-
Method Detail
-
getId
public Object getId()
-
-