Depending on configuration settings there might be opportunities to use simpler key implementations, for example when multi-tenancy is not being used to avoid the tenant identifier, or when a cache instance is entirely dedicated to a single type to use the primary id only, skipping the role or entity name.
Even with multiple types sharing the same cache, their identifiers could be of the same
org.; in this case the cache container could
use a single type reference to implement a custom equality function without having
to look it up on each equality check: that's a small optimisation but the
equality function is often invoked extremely frequently.
Another reason is to make it more convenient to implement custom serialization protocols when the implementation supports clustering.
org.hibernate.type.Type#getHashCode(Object, SessionFactoryImplementor) , org.hibernate.type.Type#isEqual(Object, Object)
| Modifier and Type | Field and Description |
|---|---|
| public static final DefaultCacheKeysFactory | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public |
| INSTANCE | back to summary |
|---|---|
| public static final DefaultCacheKeysFactory INSTANCE | |
| SHORT_NAME | back to summary |
|---|---|
| public static final String SHORT_NAME | |
| DefaultCacheKeysFactory | back to summary |
|---|---|
| public DefaultCacheKeysFactory() | |
| createCollectionKey | back to summary |
|---|---|
| public Object createCollectionKey(Object id, CollectionPersister persister, SessionFactoryImplementor factory, String tenantIdentifier) Implements org. Deprecated as a consequence of
| |
| createEntityKey | back to summary |
|---|---|
| public Object createEntityKey(Object id, EntityPersister persister, SessionFactoryImplementor factory, String tenantIdentifier) Implements org. Deprecated as a consequence of
| |
| createNaturalIdKey | back to summary |
|---|---|
| public Object createNaturalIdKey(Object naturalIdValues, EntityPersister persister, SharedSessionContractImplementor session) Implements org.
| |
| getCollectionId | back to summary |
|---|---|
| public Object getCollectionId(Object cacheKey) Implements org.
| |
| getEntityId | back to summary |
|---|---|
| public Object getEntityId(Object cacheKey) Implements org.
| |
| getNaturalIdValues | back to summary |
|---|---|
| public Object getNaturalIdValues(Object cacheKey) Implements org.
| |
| staticCreateCollectionKey | back to summary |
|---|---|
| public static Object staticCreateCollectionKey(Object id, CollectionPersister persister, SessionFactoryImplementor factory, String tenantIdentifier)
Deprecated as a consequence of | |
| staticCreateEntityKey | back to summary |
|---|---|
| public static Object staticCreateEntityKey(Object id, EntityPersister persister, SessionFactoryImplementor factory, String tenantIdentifier)
Deprecated as a consequence of | |
| staticCreateNaturalIdKey | back to summary |
|---|---|
| public static Object staticCreateNaturalIdKey(Object naturalIdValues, EntityPersister persister, SharedSessionContractImplementor session) | |
| staticGetCollectionId | back to summary |
|---|---|
| public static Object staticGetCollectionId(Object cacheKey) | |
| staticGetEntityId | back to summary |
|---|---|
| public static Object staticGetEntityId(Object cacheKey) | |
| staticGetNaturalIdValues | back to summary |
|---|---|
| public static Object staticGetNaturalIdValues(Object cacheKey) | |