diff --git a/hibernate-core/src/main/java/org/hibernate/cache/MutableCacheKeyBuilder.java b/hibernate-core/src/main/java/org/hibernate/cache/MutableCacheKeyBuilder.java new file mode 100644 index 0000000000..2cb526fe4f --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/cache/MutableCacheKeyBuilder.java @@ -0,0 +1,31 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * License: GNU Lesser General Public License (LGPL), version 2.1 or later. + * See the lgpl.txt file in the root directory or . + */ +package org.hibernate.cache; + +import java.io.Serializable; + +import org.hibernate.cache.spi.QueryResultsCache; + +/** + * A builder that generates a Serializable Object to be used as a key into the {@linkplain QueryResultsCache + * query results cache}. + */ + +public interface MutableCacheKeyBuilder extends Serializable { + + void addValue(Object value); + + + void addHashCode(int hashCode); + + /** + * creates an Object to be used as a key into the {@linkplain QueryResultsCache + * query results cache}. + */ + Serializable build(); + +} diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/BasicValuedMapping.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/BasicValuedMapping.java index e3026f41ed..607f1a287a 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/BasicValuedMapping.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/BasicValuedMapping.java @@ -6,9 +6,15 @@ */ package org.hibernate.metamodel.mapping; +import java.io.Serializable; import java.util.Collections; import java.util.List; +import org.hibernate.cache.MutableCacheKeyBuilder; +import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.type.descriptor.converter.spi.BasicValueConverter; +import org.hibernate.type.descriptor.java.JavaType; + /** * Any basic-typed ValueMapping. Generally this would be one of