Class ClobCharacterStreamTypeHandler
java.lang.Object
org.apache.ibatis.type.TypeReference<T>
org.apache.ibatis.type.BaseTypeHandler<String>
com.flowable.platform.common.persistence.ClobCharacterStreamTypeHandler
- All Implemented Interfaces:
org.apache.ibatis.type.TypeHandler<String>
@Alias("ClobCharacterStreamTypeHandler")
public class ClobCharacterStreamTypeHandler
extends org.apache.ibatis.type.BaseTypeHandler<String>
A
TypeHandler
that uses ResultSet.getCharacterStream(String)
and ResultSet.getCharacterStream(int)
to convert a Clob into a string. The Postgresql JDBC driver has a bug when reading from clob, and MyBatis uses Clob
to read the contents.- Author:
- Filip Hrisafov
- See Also:
-
- mybatis/mybatis-3#1325 for the MyBatis issue
- pgjdbc/pgjdbc#458 for the Postgresql JDBC driver issue
-
Field Summary
FieldsFields inherited from class org.apache.ibatis.type.BaseTypeHandler
configuration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetNullableResult
(CallableStatement cs, int columnIndex) getNullableResult
(ResultSet rs, int columnIndex) getNullableResult
(ResultSet rs, String columnName) protected static String
void
setNonNullParameter
(PreparedStatement ps, int i, String parameter, org.apache.ibatis.type.JdbcType jdbcType) Methods inherited from class org.apache.ibatis.type.BaseTypeHandler
getResult, getResult, getResult, setConfiguration, setParameter
Methods inherited from class org.apache.ibatis.type.TypeReference
getRawType, toString
-
Field Details
-
useNclob
protected final boolean useNclob
-
-
Constructor Details
-
ClobCharacterStreamTypeHandler
public ClobCharacterStreamTypeHandler(boolean useNclob)
-
-
Method Details
-
setNonNullParameter
public void setNonNullParameter(PreparedStatement ps, int i, String parameter, org.apache.ibatis.type.JdbcType jdbcType) throws SQLException - Specified by:
setNonNullParameter
in classorg.apache.ibatis.type.BaseTypeHandler<String>
- Throws:
SQLException
-
getNullableResult
- Specified by:
getNullableResult
in classorg.apache.ibatis.type.BaseTypeHandler<String>
- Throws:
SQLException
-
getNullableResult
- Specified by:
getNullableResult
in classorg.apache.ibatis.type.BaseTypeHandler<String>
- Throws:
SQLException
-
getNullableResult
- Specified by:
getNullableResult
in classorg.apache.ibatis.type.BaseTypeHandler<String>
- Throws:
SQLException
-
read
- Throws:
IOException
-