Class BasicCollectionJavaType<C extends Collection<E>,E>
java.lang.Object
org.hibernate.type.descriptor.java.AbstractJavaType<C>
org.hibernate.type.descriptor.java.spi.BasicCollectionJavaType<C,E>
- All Implemented Interfaces:
Serializable,BasicJavaType<C>,BasicPluralJavaType<E>,JavaType<C>
@Incubating
public class BasicCollectionJavaType<C extends Collection<E>,E>
extends AbstractJavaType<C>
implements BasicPluralJavaType<E>
Descriptor for handling persistent collections.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.type.descriptor.java.JavaType
JavaType.CoercionContext -
Constructor Summary
ConstructorsConstructorDescriptionBasicCollectionJavaType(ParameterizedType type, JavaType<E> componentJavaType, CollectionSemantics<C, E> semantics) -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine if two instances are equalintextractHashCode(C value) Extract a proper hash code for the given value.extractLoggableRepresentation(C value) Extract a loggable representation of the given value.fromString(CharSequence charSequence) Get the Java type descriptor for the element typegetRecommendedJdbcType(JdbcTypeIndicators indicators) Obtain the "recommended"SQL type descriptorfor this Java type.booleanDetermines if this Java type is wider than the given Java type, that is, if the given type can be safely widened to this type.BasicType<?>resolveType(TypeConfiguration typeConfiguration, Dialect dialect, BasicType<E> elementType, ColumnTypeInformation columnTypeInformation, JdbcTypeIndicators stdIndicators) Creates a container type for the given element type<X> Xunwrap(C value, Class<X> type, WrapperOptions options) Unwrap an instance of our handled Java type into the requested type.<X> Cwrap(X value, WrapperOptions options) Wrap a value as our handled Java type.Methods inherited from class org.hibernate.type.descriptor.java.AbstractJavaType
getComparator, getJavaType, getMutabilityPlan, unknownUnwrap, unknownWrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.type.descriptor.java.JavaType
appendEncodedString, coerce, createJavaType, fromEncodedString, getCheckCondition, getDefaultSqlLength, getDefaultSqlPrecision, getDefaultSqlScale, getDefaultValue, getJavaTypeClass, getLongSqlLength, getReplacement, getTypeName, isInstance, isTemporalType, useObjectEqualsHashCode
-
Constructor Details
-
BasicCollectionJavaType
public BasicCollectionJavaType(ParameterizedType type, JavaType<E> componentJavaType, CollectionSemantics<C, E> semantics)
-
-
Method Details
-
getElementJavaType
Description copied from interface:BasicPluralJavaTypeGet the Java type descriptor for the element type- Specified by:
getElementJavaTypein interfaceBasicPluralJavaType<C extends Collection<E>>
-
getRecommendedJdbcType
Description copied from interface:BasicJavaTypeObtain the "recommended"SQL type descriptorfor this Java type. Often, but not always, the source of this recommendation is the JDBC specification.- Specified by:
getRecommendedJdbcTypein interfaceBasicJavaType<C extends Collection<E>>- Specified by:
getRecommendedJdbcTypein interfaceJavaType<C extends Collection<E>>- Parameters:
indicators- Contextual information- Returns:
- The recommended SQL type descriptor
-
getSemantics
-
isWider
Description copied from interface:JavaTypeDetermines if this Java type is wider than the given Java type, that is, if the given type can be safely widened to this type.- Specified by:
isWiderin interfaceJavaType<C extends Collection<E>>
-
resolveType
public BasicType<?> resolveType(TypeConfiguration typeConfiguration, Dialect dialect, BasicType<E> elementType, ColumnTypeInformation columnTypeInformation, JdbcTypeIndicators stdIndicators) Description copied from interface:BasicPluralJavaTypeCreates a container type for the given element type- Specified by:
resolveTypein interfaceBasicPluralJavaType<C extends Collection<E>>
-
extractLoggableRepresentation
Description copied from interface:JavaTypeExtract a loggable representation of the given value.- Specified by:
extractLoggableRepresentationin interfaceJavaType<C extends Collection<E>>- Overrides:
extractLoggableRepresentationin classAbstractJavaType<C extends Collection<E>>- Parameters:
value- The value for which to extract a loggable representation.- Returns:
- The loggable representation
-
areEqual
Description copied from interface:JavaTypeDetermine if two instances are equal- Specified by:
areEqualin interfaceJavaType<C extends Collection<E>>- Overrides:
areEqualin classAbstractJavaType<C extends Collection<E>>- Parameters:
one- One instanceanother- The other instance- Returns:
- True if the two are considered equal; false otherwise.
-
extractHashCode
Description copied from interface:JavaTypeExtract a proper hash code for the given value.- Specified by:
extractHashCodein interfaceJavaType<C extends Collection<E>>- Overrides:
extractHashCodein classAbstractJavaType<C extends Collection<E>>- Parameters:
value- The value for which to extract a hash code.- Returns:
- The extracted hash code.
-
toString
- Specified by:
toStringin interfaceJavaType<C extends Collection<E>>
-
fromString
- Specified by:
fromStringin interfaceBasicJavaType<C extends Collection<E>>- Specified by:
fromStringin interfaceJavaType<C extends Collection<E>>
-
unwrap
Description copied from interface:JavaTypeUnwrap an instance of our handled Java type into the requested type.As an example, if this is a
JavaType<Integer>and we are asked to unwrap theInteger valueas aLong, we would return something likeLong.valueOf( value.longValue() ).Intended use is during
PreparedStatementbinding.- Specified by:
unwrapin interfaceJavaType<C extends Collection<E>>- Type Parameters:
X- The conversion type.- Parameters:
value- The value to unwraptype- The type as which to unwrapoptions- The options- Returns:
- The unwrapped value.
-
wrap
Description copied from interface:JavaTypeWrap a value as our handled Java type.Intended use is during
ResultSetextraction.- Specified by:
wrapin interfaceJavaType<C extends Collection<E>>- Type Parameters:
X- The conversion type.- Parameters:
value- The value to wrap.options- The options- Returns:
- The wrapped value.
-