/** * 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. * * @param id The identifier associated with the cached data * @param type The Hibernate type mapping * @param entityOrRoleName The entity or collection-role name. * @param tenantId The tenant identifier associated this data. * @param factory The session factory for which we are caching */ CacheKeyImplementation( final Object id, final Type type, final String entityOrRoleName, final String tenantId, final SessionFactoryImplementor factory) { this.id = id; this.type = type; this.entityOrRoleName = entityOrRoleName; this.tenantId = tenantId; this.hashCode = calculateHashCode( type, factory ); }
public static Object staticGetCollectionId(Object cacheKey) { return ((CacheKeyImplementation) cacheKey).getId(); }
public static Object staticCreateEntityKey(Object id, EntityPersister persister, SessionFactoryImplementor factory, String tenantIdentifier) { return new CacheKeyImplementation( id, persister.getIdentifierType(), persister.getRootEntityName(), tenantIdentifier, factory ); }
public static Object staticCreateCollectionKey(Object id, CollectionPersister persister, SessionFactoryImplementor factory, String tenantIdentifier) { return new CacheKeyImplementation( id, persister.getKeyType(), persister.getRole(), tenantIdentifier, factory ); }
public static Object staticGetEntityId(Object cacheKey) { return ((CacheKeyImplementation) cacheKey).getId(); }
public static Object staticCreateCollectionKey( Object id, PersistentCollectionDescriptor descriptor, SessionFactoryImplementor factory, String tenantIdentifier) { return new CacheKeyImplementation( id, descriptor.getKeyJavaTypeDescriptor(), descriptor.getNavigableRole(), tenantIdentifier ); }
/** * 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. * * @param id The identifier associated with the cached data * @param idJavaTypeDescriptor The JavaTypeDescriptor type mapping * @param entityOrRoleName The entity or collection-role name. * @param tenantId The tenant identifier associated this data. */ CacheKeyImplementation( final Object id, final JavaTypeDescriptor idJavaTypeDescriptor, final NavigableRole entityOrRoleName, final String tenantId) { this.id = id; this.idJavaTypeDescriptor = idJavaTypeDescriptor; this.navigableRole = entityOrRoleName; this.tenantId = tenantId; this.hashCode = calculateHashCode( idJavaTypeDescriptor, id, tenantId ); }
public static Object staticGetCollectionId(Object cacheKey) { return ( (CacheKeyImplementation) cacheKey ).getId(); }
public static Object staticCreateEntityKey( Object id, EntityHierarchy entityHierarchy, SessionFactoryImplementor factory, String tenantIdentifier) { return new CacheKeyImplementation( id, entityHierarchy.getIdentifierDescriptor().getJavaTypeDescriptor(), entityHierarchy.getRootEntityType().getNavigableRole(), tenantIdentifier ); }
public static Object staticGetEntityId(Object cacheKey) { return ( (CacheKeyImplementation) cacheKey ).getId(); }