Class TinyIntAsSmallIntJdbcType
- java.lang.Object
-
- org.hibernate.type.descriptor.jdbc.TinyIntJdbcType
-
- org.hibernate.type.descriptor.jdbc.TinyIntAsSmallIntJdbcType
-
- All Implemented Interfaces:
Serializable
,JdbcType
public class TinyIntAsSmallIntJdbcType extends TinyIntJdbcType
Descriptor forTINYINT
handling, when theSMALLINT
DDL type code is used. This type binds and extractsShort
instead ofByte
through JDBC, because it is not specified whether the conversion fromByte
toShort
is signed or unsigned, yet we need the conversion to be signed, which is properly handled by theJavaType.unwrap(Object, Class, WrapperOptions)
implementations.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static TinyIntAsSmallIntJdbcType
INSTANCE
-
Constructor Summary
Constructors Constructor Description TinyIntAsSmallIntJdbcType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <X> ValueBinder<X>
getBinder(JavaType<X> javaType)
Obtain a binder object capable of binding values of the given Java type to parameters of a JDBCPreparedStatement
.int
getDdlTypeCode()
A JDBC type code that identifies the SQL column type to be used for schema generation.<X> ValueExtractor<X>
getExtractor(JavaType<X> javaType)
Class<?>
getPreferredJavaTypeClass(WrapperOptions options)
The Java type class that is preferred by the binder or null.-
Methods inherited from class org.hibernate.type.descriptor.jdbc.TinyIntJdbcType
getFriendlyName, getJdbcLiteralFormatter, getJdbcRecommendedJavaTypeMapping, getJdbcTypeCode, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.type.descriptor.jdbc.JdbcType
addAuxiliaryDatabaseObjects, addAuxiliaryDatabaseObjects, appendWriteExpression, getCastType, getCheckCondition, getDefaultSqlTypeCode, getExtraCreateTableInfo, hasDatePart, hasTimePart, isArray, isBinary, isBoolean, isComparable, isDecimal, isDuration, isFloat, isInteger, isInterval, isLob, isLobOrLong, isNationalized, isNumber, isSmallInteger, isSpatial, isString, isStringLike, isStringLikeExcludingClob, isTemporal, registerOutParameter, registerOutParameter, wrapTopLevelSelectionExpression, wrapWriteExpression
-
-
-
-
Field Detail
-
INSTANCE
public static final TinyIntAsSmallIntJdbcType INSTANCE
-
-
Method Detail
-
getDdlTypeCode
public int getDdlTypeCode()
Description copied from interface:JdbcType
A JDBC type code that identifies the SQL column type to be used for schema generation.This value is passed to
DdlTypeRegistry.getTypeName(int, Size, Type)
to obtain the SQL column type.- Returns:
- a JDBC type code
-
getPreferredJavaTypeClass
public Class<?> getPreferredJavaTypeClass(WrapperOptions options)
Description copied from interface:JdbcType
The Java type class that is preferred by the binder or null.- Specified by:
getPreferredJavaTypeClass
in interfaceJdbcType
- Overrides:
getPreferredJavaTypeClass
in classTinyIntJdbcType
-
getBinder
public <X> ValueBinder<X> getBinder(JavaType<X> javaType)
Description copied from interface:JdbcType
Obtain a binder object capable of binding values of the given Java type to parameters of a JDBCPreparedStatement
.- Specified by:
getBinder
in interfaceJdbcType
- Overrides:
getBinder
in classTinyIntJdbcType
- Parameters:
javaType
- The descriptor describing the types of Java values to be bound- Returns:
- The appropriate binder.
-
getExtractor
public <X> ValueExtractor<X> getExtractor(JavaType<X> javaType)
Description copied from interface:JdbcType
Obtain an extractor object capable of extracting values of the given Java type from a JDBCResultSet
.- Specified by:
getExtractor
in interfaceJdbcType
- Overrides:
getExtractor
in classTinyIntJdbcType
- Parameters:
javaType
- The descriptor describing the types of Java values to be extracted- Returns:
- The appropriate extractor
-
-