Interface ColumnMapper<T>
- Type Parameters:
T- 列类型
- All Known Implementing Classes:
EnumColumnMapper, OptionalColumnMapper, SerializationColumnMapper
public interface ColumnMapper<T>
列转换器
- Author:
- Maning
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancanRead(Type type, Configuration configuration) 是否可读read(ResultSet rs, int columnIndex, Type type, Configuration configuration) 从ResultSet读取值,请确保安全或已使用canRead(Type, Configuration)测试booleanwrite(PreparedStatement ps, int parameterIndex, T value, Configuration configuration) 写入值到PreparedStatement
-
Method Details
-
canRead
是否可读- Parameters:
type- 类型configuration- 配置- Returns:
- 是否可读
-
read
从ResultSet读取值,请确保安全或已使用canRead(Type, Configuration)测试- Parameters:
rs- 结果集columnIndex- rs使用的columnIndex, 从1开始type- 类型configuration- 配置- Returns:
- 值 允许返回null
- Throws:
SQLException- 原生SQL异常
-
write
boolean write(PreparedStatement ps, int parameterIndex, T value, Configuration configuration) throws SQLException 写入值到PreparedStatement- Parameters:
ps- PreparedStatementparameterIndex- ps使用的parameterIndex,从1开始value- 值,不会为nullconfiguration- 配置- Returns:
- 是否已写入
- Throws:
SQLException- 原生SQL异常
-