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>
ATypeHandler
that usesResultSet.getCharacterStream(String)
andResultSet.getCharacterStream(int)
to convert a Clob into a string. The Postgresql JDBC driver has a bug when reading from clob, and MyBatis usesClob
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
-
-
Constructor Summary
Constructors Constructor Description ClobCharacterStreamTypeHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getNullableResult(CallableStatement cs, int columnIndex)
String
getNullableResult(ResultSet rs, int columnIndex)
String
getNullableResult(ResultSet rs, String columnName)
protected static String
read(Reader reader)
void
setNonNullParameter(PreparedStatement ps, int i, String parameter, org.apache.ibatis.type.JdbcType jdbcType)
-
-
-
Method Detail
-
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
public String getNullableResult(ResultSet rs, String columnName) throws SQLException
- Specified by:
getNullableResult
in classorg.apache.ibatis.type.BaseTypeHandler<String>
- Throws:
SQLException
-
getNullableResult
public String getNullableResult(ResultSet rs, int columnIndex) throws SQLException
- Specified by:
getNullableResult
in classorg.apache.ibatis.type.BaseTypeHandler<String>
- Throws:
SQLException
-
getNullableResult
public String getNullableResult(CallableStatement cs, int columnIndex) throws SQLException
- Specified by:
getNullableResult
in classorg.apache.ibatis.type.BaseTypeHandler<String>
- Throws:
SQLException
-
read
protected static String read(Reader reader) throws IOException
- Throws:
IOException
-
-