java.lang.Object
org.seasar.doma.jdbc.type.AbstractJdbcType<T>
- Type Parameters:
T- the basic type
- All Implemented Interfaces:
SqlLogFormatter<T>,JdbcType<T>
- Direct Known Subclasses:
AbstractResultSetType,ArrayType,BigDecimalType,BigIntegerType,BlobType,BooleanType,BytesType,ByteType,ClobType,DateType,DoubleType,EnumType,FloatType,IntegerAdaptiveBooleanType,IntegerType,LocalDateTimeType,LocalDateType,LocalTimeType,LongType,NClobType,NStringType,ObjectType,PortableObjectType,ShortType,SQLXMLType,StringType,TimestampType,TimeType,UtilDateType
A skeletal implementation for the
JdbcType interface .-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToLogFormat(T value) Converts the value to the SQL log format.protected abstract StringdoConvertToLogFormat(T value) protected abstract TdoGetValue(CallableStatement callableStatement, int index) protected abstract TdoGetValue(ResultSet resultSet, int index) protected abstract voiddoSetValue(PreparedStatement preparedStatement, int index, T value) getValue(CallableStatement callableStatement, int index) Retrieves the value from theCallableStatementobject.Retrieves the column value from theResultSetobject.voidregisterOutParameter(CallableStatement callableStatement, int index) Registers the OUT parameter to theCallableStatementobject.voidsetValue(PreparedStatement preparedStatement, int index, T value) Sets the value to thePreparedStatementobject.
-
Field Details
-
type
protected final int typethe SQL type- See Also:
-
-
Constructor Details
-
AbstractJdbcType
protected AbstractJdbcType(int type) Creates an instance.- Parameters:
type- the SQL type
-
-
Method Details
-
getValue
Description copied from interface:JdbcTypeRetrieves the column value from theResultSetobject.- Specified by:
getValuein interfaceJdbcType<T>- Parameters:
resultSet- the result setindex- the column index- Returns:
- the column value
- Throws:
SQLException- ifresultSetthrowsSQLException
-
setValue
Description copied from interface:JdbcTypeSets the value to thePreparedStatementobject.- Specified by:
setValuein interfaceJdbcType<T>- Parameters:
preparedStatement- the prepared statementindex- the parameter indexvalue- the value- Throws:
SQLException- ifpreparedStatementthrowsSQLException
-
registerOutParameter
public void registerOutParameter(CallableStatement callableStatement, int index) throws SQLException Description copied from interface:JdbcTypeRegisters the OUT parameter to theCallableStatementobject.- Specified by:
registerOutParameterin interfaceJdbcType<T>- Parameters:
callableStatement- the callable statementindex- the parameter index- Throws:
SQLException- ifcallableStatementthrowsSQLException
-
getValue
Description copied from interface:JdbcTypeRetrieves the value from theCallableStatementobject.- Specified by:
getValuein interfaceJdbcType<T>- Parameters:
callableStatement- the callable statementindex- the parameter index- Returns:
- the value
- Throws:
SQLException- ifcallableStatementthrowsSQLException
-
convertToLogFormat
Description copied from interface:SqlLogFormatterConverts the value to the SQL log format.- Specified by:
convertToLogFormatin interfaceSqlLogFormatter<T>- Parameters:
value- the value- Returns:
- the SQL log format
-
doGetValue
- Throws:
SQLException
-
doSetValue
protected abstract void doSetValue(PreparedStatement preparedStatement, int index, T value) throws SQLException - Throws:
SQLException
-
doGetValue
- Throws:
SQLException
-
doConvertToLogFormat
-