/** * 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 ); }
/** * 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 ); }