本文整理汇总了Java中com.ibatis.sqlmap.client.extensions.ParameterSetter.setNull方法的典型用法代码示例。如果您正苦于以下问题:Java ParameterSetter.setNull方法的具体用法?Java ParameterSetter.setNull怎么用?Java ParameterSetter.setNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ibatis.sqlmap.client.extensions.ParameterSetter
的用法示例。
在下文中一共展示了ParameterSetter.setNull方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setParameter
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入方法依赖的package包/类
/**
* Java 의 String 타입(yyyyMMddHHmmss 형식으로 format
* 맞춰진)으로 세팅된 입력 객체(VO 또는 Map)의 특정 Attribute 로 부터
* parameterMap(inline parameterMap) 처리 시 JDBC 의
* Timestamp 로 처리한다.
* @param setter
* - prepared statement 의 현재 바인드 변수에 대한 값
* 세팅을 지원하는(index 없이) ibatis 의
* ParameterSetter
* @param parameter
* - 입력 객체
* @exception SQLException
*/
public void setParameter(ParameterSetter setter, Object parameter)
throws SQLException {
if (parameter == null) {
setter.setNull(java.sql.Types.DATE);
} else {
try {
Timestamp ts =
new Timestamp(sdf.parse((String) parameter).getTime());
setter.setTimestamp(ts);
} catch (ParseException e) {
throw new SQLException(
"Error parsing string to timestamp. Cause: "
+ e.getMessage());
}
}
}
示例2: setParameter
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入方法依赖的package包/类
@Override
public void setParameter(ParameterSetter setter, Object parameter) throws SQLException {
if (parameter == null) {
setter.setNull(Types.VARCHAR);
} else {
StringEnumValue val = (StringEnumValue) parameter;
setter.setString(val.getValue());
}
}
示例3: setNull
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入方法依赖的package包/类
@Override
public void setNull(ParameterSetter setter, Object parameter) throws SQLException {
if (log.isDebugEnabled()) {
log.debug("#setNull() called");
}
setter.setNull(Types.INTEGER);
}
示例4: setParameter
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入方法依赖的package包/类
@Override
public void setParameter(ParameterSetter setter, Object parameter) throws SQLException {
if (parameter == null) {
setter.setNull(Types.INTEGER);
} else {
EnumValue val = (EnumValue) parameter;
setter.setInt(val.getValue());
}
}
示例5: setNull
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入方法依赖的package包/类
@Override
public void setNull(ParameterSetter setter, Object parameter) throws SQLException {
if (log.isDebugEnabled()) {
log.debug("#setNull() called");
}
setter.setNull(Types.DECIMAL);
}
示例6: setParameter
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入方法依赖的package包/类
public void setParameter(ParameterSetter setter, Object parameter)
throws SQLException {
if (parameter == null || parameter == Sense.UNKNOWN)
setter.setNull(java.sql.Types.TINYINT);
else
setter.setShort(((Sense)parameter).getShortVal());
}
示例7: setParameter
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入方法依赖的package包/类
public void setParameter(ParameterSetter setter, Object parameter)
throws SQLException {
ProteinferStatus status = (ProteinferStatus) parameter;
if (status == null)
setter.setNull(java.sql.Types.CHAR);
else
setter.setString(String.valueOf(status.getStatusChar()));
}
示例8: setParameter
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入方法依赖的package包/类
public void setParameter(ParameterSetter setter, Object parameter)
throws SQLException {
InputType inputType = (InputType) parameter;
if (inputType == null)
setter.setNull(java.sql.Types.CHAR);
else
setter.setString(String.valueOf(inputType.getShortName()));
}
示例9: setParameter
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入方法依赖的package包/类
public void setParameter(ParameterSetter setter, Object parameter)
throws SQLException {
if (parameter == null)
setter.setNull(java.sql.Types.VARCHAR);
else
setter.setString(((SearchFileFormat)parameter).name());
}
示例10: setParameter
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入方法依赖的package包/类
public void setParameter(ParameterSetter setter, Object parameter)
throws SQLException {
if (parameter == null)
setter.setNull(java.sql.Types.VARCHAR);
else
setter.setString(((Program)parameter).name());
}
示例11: setParameter
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入方法依赖的package包/类
public void setParameter(ParameterSetter setter, Object parameter)
throws SQLException {
ValidationStatus status = (ValidationStatus) parameter;
if (status == null || status == ValidationStatus.UNKNOWN)
setter.setNull(java.sql.Types.CHAR);
else
setter.setString(Character.toString(status.getStatusChar()));
}
示例12: setParameter
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入方法依赖的package包/类
public void setParameter(ParameterSetter setter, Object parameter)
throws SQLException {
Character status = (Character) parameter;
if (status == null || status.charValue() == 0)
setter.setNull(java.sql.Types.CHAR);
else
setter.setString(status.toString());
}
示例13: setParameter
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入方法依赖的package包/类
public void setParameter(ParameterSetter setter, Object parameter)
throws SQLException {
String type = dataConversionTypeToTrueFalse((DataConversionType)parameter);
if (type == null)
setter.setNull(java.sql.Types.CHAR);
else
setter.setString(type);
}
示例14: setParameter
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入方法依赖的package包/类
public void setParameter(ParameterSetter setter, Object parameter)
throws SQLException {
if (parameter == null)
setter.setNull(java.sql.Types.VARCHAR);
else
setter.setString(((RunFileFormat)parameter).name());
}
示例15: setParameter
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入方法依赖的package包/类
public void setParameter(ParameterSetter setter, Object parameter) throws SQLException {
if (null != parameter) {
byte[] bytes = (byte[]) parameter;
ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
setter.setBinaryStream(bis, (int) (bytes.length));
} else {
setter.setNull(Types.BLOB);
}
}