public class EnumStringTypeHandler<E extends Enum<E>> extends Object implements TypeHandler<E>
Constructor and Description |
---|
EnumStringTypeHandler(Class<E> type) |
Modifier and Type | Method and Description |
---|---|
E |
get(CallableStatement cs,
int index) |
E |
get(CallableStatement cs,
String parameterName) |
E |
get(ResultSet rs,
int index)
从结果集里获取一个字段的值
|
E |
get(ResultSet rs,
String columnName)
从结果集里获取一个字段的值
|
Class<E> |
getDefaultJavaType()
类型
|
int |
getSqlType()
java.sql.Types的值
|
Object |
set(CallableStatement cs,
Object obj,
String parameterName) |
Object |
set(PreparedStatement ps,
Object obj,
int i)
为缓冲语句设置值
|
void |
update(ResultSet rs,
int columnIndex,
Object value) |
void |
update(ResultSet rs,
String columnLabel,
Object value)
为了支持悲观锁中的数据类型转换
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSqlExpression, setColumnMapping, setDefaultJavaType, setSqlType
public E get(ResultSet rs, String columnName) throws SQLException
TypeHandler
get
in interface TypeHandler<E extends Enum<E>>
rs
- 结果集columnName
- 列名SQLException
public E get(ResultSet rs, int index) throws SQLException
TypeHandler
get
in interface TypeHandler<E extends Enum<E>>
rs
- 结果集index
- 索引SQLException
public E get(CallableStatement cs, int index) throws SQLException
get
in interface TypeHandler<E extends Enum<E>>
SQLException
public E get(CallableStatement cs, String parameterName) throws SQLException
get
in interface TypeHandler<E extends Enum<E>>
SQLException
public void update(ResultSet rs, String columnLabel, Object value) throws SQLException
TypeHandler
update
in interface TypeHandler<E extends Enum<E>>
SQLException
public void update(ResultSet rs, int columnIndex, Object value) throws SQLException
update
in interface TypeHandler<E extends Enum<E>>
SQLException
public Object set(PreparedStatement ps, Object obj, int i) throws SQLException
TypeHandler
一个值可以被设置到多个占位符中
set
in interface TypeHandler<E extends Enum<E>>
ps
- 缓冲语句obj
- 值i
- 占位符位置,从 1 开始SQLException
public Object set(CallableStatement cs, Object obj, String parameterName) throws SQLException
set
in interface TypeHandler<E extends Enum<E>>
SQLException
public int getSqlType()
TypeHandler
getSqlType
in interface TypeHandler<E extends Enum<E>>
public Class<E> getDefaultJavaType()
TypeHandler
getDefaultJavaType
in interface TypeHandler<E extends Enum<E>>
Copyright © 2020. All rights reserved.