Class SerializationColumnMapper
java.lang.Object
org.huiche.jdbc.mapper.column.SerializationColumnMapper
- All Implemented Interfaces:
ColumnMapper<Object>
序列化列转换器
- Author:
- Maning
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleancanRead(Type type, Configuration configuration) 是否可读read(ResultSet rs, int columnIndex, Type type, Configuration configuration) 从ResultSet读取值,请确保安全或已使用ColumnMapper.canRead(Type, Configuration)测试booleanwrite(PreparedStatement ps, int parameterIndex, Object value, Configuration configuration) 写入值到PreparedStatement
-
Field Details
-
INSTANCE
单例
-
-
Method Details
-
canRead
Description copied from interface:ColumnMapper是否可读- Specified by:
canReadin interfaceColumnMapper<Object>- Parameters:
type- 类型configuration- 配置- Returns:
- 是否可读
-
read
public Object read(ResultSet rs, int columnIndex, Type type, Configuration configuration) throws SQLException Description copied from interface:ColumnMapper从ResultSet读取值,请确保安全或已使用ColumnMapper.canRead(Type, Configuration)测试- Specified by:
readin interfaceColumnMapper<Object>- Parameters:
rs- 结果集columnIndex- rs使用的columnIndex, 从1开始type- 类型configuration- 配置- Returns:
- 值 允许返回null
- Throws:
SQLException- 原生SQL异常
-
write
public boolean write(PreparedStatement ps, int parameterIndex, Object value, Configuration configuration) throws SQLException Description copied from interface:ColumnMapper写入值到PreparedStatement- Specified by:
writein interfaceColumnMapper<Object>- Parameters:
ps- PreparedStatementparameterIndex- ps使用的parameterIndex,从1开始value- 值,不会为nullconfiguration- 配置- Returns:
- 是否已写入
- Throws:
SQLException- 原生SQL异常
-