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 TypeMethodDescriptionboolean
Determine if two instances are equalint
extractHashCode
(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 descriptor
for this Java type.boolean
Determines 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> X
unwrap
(C value, Class<X> type, WrapperOptions options) Unwrap an instance of our handled Java type into the requested type.<X> C
wrap
(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, unknownWrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:BasicPluralJavaType
Get the Java type descriptor for the element type- Specified by:
getElementJavaType
in interfaceBasicPluralJavaType<C extends Collection<E>>
-
getRecommendedJdbcType
Description copied from interface:BasicJavaType
Obtain the "recommended"SQL type descriptor
for this Java type. Often, but not always, the source of this recommendation is the JDBC specification.- Specified by:
getRecommendedJdbcType
in interfaceBasicJavaType<C extends Collection<E>>
- Specified by:
getRecommendedJdbcType
in interfaceJavaType<C extends Collection<E>>
- Parameters:
indicators
- Contextual information- Returns:
- The recommended SQL type descriptor
-
getSemantics
-
isWider
Description copied from interface:JavaType
Determines 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:
isWider
in interfaceJavaType<C extends Collection<E>>
-
resolveType
public BasicType<?> resolveType(TypeConfiguration typeConfiguration, Dialect dialect, BasicType<E> elementType, ColumnTypeInformation columnTypeInformation, JdbcTypeIndicators stdIndicators) Description copied from interface:BasicPluralJavaType
Creates a container type for the given element type- Specified by:
resolveType
in interfaceBasicPluralJavaType<C extends Collection<E>>
-
extractLoggableRepresentation
Description copied from interface:JavaType
Extract a loggable representation of the given value.- Specified by:
extractLoggableRepresentation
in interfaceJavaType<C extends Collection<E>>
- Overrides:
extractLoggableRepresentation
in 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:JavaType
Determine if two instances are equal- Specified by:
areEqual
in interfaceJavaType<C extends Collection<E>>
- Overrides:
areEqual
in 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:JavaType
Extract a proper hash code for the given value.- Specified by:
extractHashCode
in interfaceJavaType<C extends Collection<E>>
- Overrides:
extractHashCode
in classAbstractJavaType<C extends Collection<E>>
- Parameters:
value
- The value for which to extract a hash code.- Returns:
- The extracted hash code.
-
toString
- Specified by:
toString
in interfaceJavaType<C extends Collection<E>>
-
fromString
- Specified by:
fromString
in interfaceBasicJavaType<C extends Collection<E>>
- Specified by:
fromString
in interfaceJavaType<C extends Collection<E>>
-
unwrap
Description copied from interface:JavaType
Unwrap 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 value
as aLong
, we would return something likeLong.valueOf( value.longValue() )
.Intended use is during
PreparedStatement
binding.- Specified by:
unwrap
in 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:JavaType
Wrap a value as our handled Java type.Intended use is during
ResultSet
extraction.- Specified by:
wrap
in interfaceJavaType<C extends Collection<E>>
- Type Parameters:
X
- The conversion type.- Parameters:
value
- The value to wrap.options
- The options- Returns:
- The wrapped value.
-