Class TinyIntAsSmallIntJdbcType
java.lang.Object
org.hibernate.type.descriptor.jdbc.TinyIntJdbcType
org.hibernate.type.descriptor.jdbc.TinyIntAsSmallIntJdbcType
- All Implemented Interfaces:
Serializable
,JdbcType
Descriptor for
TINYINT
handling, when the SMALLINT
DDL type code is used.
This type binds and extracts Short
instead of Byte
through JDBC,
because it is not specified whether the conversion from Byte
to Short
is signed or unsigned,
yet we need the conversion to be signed, which is properly handled by the JavaType.unwrap(Object, Class, WrapperOptions)
implementations.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<X> ValueBinder<X>
Obtain a binder object capable of binding values of the given Java type to parameters of a JDBCPreparedStatement
.int
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, appendWriteExpression, getCastType, getCheckCondition, getDefaultSqlTypeCode, getExtraCreateTableInfo, hasDatePart, hasTimePart, isArray, isBinary, isBoolean, isComparable, isDecimal, isDuration, isFloat, isImplicitJson, isImplicitXml, isInteger, isInterval, isJson, isLob, isLobOrLong, isNationalized, isNumber, isSmallInteger, isSpatial, isString, isStringLike, isStringLikeExcludingClob, isTemporal, isXml, registerOutParameter, registerOutParameter, wrapTopLevelSelectionExpression, wrapWriteExpression
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
TinyIntAsSmallIntJdbcType
public TinyIntAsSmallIntJdbcType()
-
-
Method Details
-
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
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
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
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
-