X - Y - public class AttributeConverterType<X,Y> extends Object implements TypeHandler<X>
AttributeConverter接口| Constructor and Description |
|---|
AttributeConverterType() |
AttributeConverterType(javax.persistence.AttributeConverter<X,Y> attributeConverter,
TypeHandler<Y> typeHandler) |
| Modifier and Type | Method and Description |
|---|---|
X |
get(CallableStatement cs,
int parameterIndex) |
X |
get(CallableStatement cs,
String parameterName) |
X |
get(ResultSet rs,
int columnIndex)
从结果集里获取一个字段的值
|
X |
get(ResultSet rs,
String columnLabel)
从结果集里获取一个字段的值
|
javax.persistence.AttributeConverter<X,Y> |
getAttributeConverter() |
Class<X> |
getDefaultJavaType()
类型
|
int |
getSqlType()
java.sql.Types的值
|
TypeHandler<Y> |
getTypeHandler() |
Class<X> |
getXclass() |
Class<Y> |
getYclass() |
Object |
set(CallableStatement cs,
Object obj,
String parameterName) |
Object |
set(PreparedStatement ps,
Object value,
int index)
为缓冲语句设置值
|
void |
setAttributeConverter(javax.persistence.AttributeConverter<X,Y> attributeConverter) |
void |
setTypeHandler(TypeHandler<Y> typeHandler) |
void |
setXclass(Class<X> xclass) |
void |
setYclass(Class<Y> yclass) |
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, waitgetSqlExpression, setColumnMapping, setDefaultJavaType, setSqlTypepublic AttributeConverterType()
public AttributeConverterType(javax.persistence.AttributeConverter<X,Y> attributeConverter, TypeHandler<Y> typeHandler)
public X get(ResultSet rs, String columnLabel) throws SQLException
TypeHandlerget in interface TypeHandler<X>rs - 结果集columnLabel - 列名SQLExceptionpublic X get(ResultSet rs, int columnIndex) throws SQLException
TypeHandlerget in interface TypeHandler<X>rs - 结果集columnIndex - 索引SQLExceptionpublic X get(CallableStatement cs, int parameterIndex) throws SQLException
get in interface TypeHandler<X>SQLExceptionpublic X get(CallableStatement cs, String parameterName) throws SQLException
get in interface TypeHandler<X>SQLExceptionpublic Object set(PreparedStatement ps, Object value, int index) throws SQLException
TypeHandler一个值可以被设置到多个占位符中
set in interface TypeHandler<X>ps - 缓冲语句value - 值index - 占位符位置,从 1 开始SQLExceptionpublic Object set(CallableStatement cs, Object obj, String parameterName) throws SQLException
set in interface TypeHandler<X>SQLExceptionpublic void update(ResultSet rs, String columnLabel, Object value) throws SQLException
TypeHandlerupdate in interface TypeHandler<X>SQLExceptionpublic void update(ResultSet rs, int columnIndex, Object value) throws SQLException
update in interface TypeHandler<X>SQLExceptionpublic Class<X> getDefaultJavaType()
TypeHandlergetDefaultJavaType in interface TypeHandler<X>public int getSqlType()
TypeHandlergetSqlType in interface TypeHandler<X>public void setAttributeConverter(javax.persistence.AttributeConverter<X,Y> attributeConverter)
public TypeHandler<Y> getTypeHandler()
public void setTypeHandler(TypeHandler<Y> typeHandler)
Copyright © 2020. All rights reserved.