本文整理汇总了Java中com.ibatis.sqlmap.client.extensions.ParameterSetter类的典型用法代码示例。如果您正苦于以下问题:Java ParameterSetter类的具体用法?Java ParameterSetter怎么用?Java ParameterSetter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParameterSetter类属于com.ibatis.sqlmap.client.extensions包,在下文中一共展示了ParameterSetter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assertMaps
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入依赖的package包/类
private void assertMaps(final String str, StageResult value) throws SQLException {
final ResultGetter resultGetter;
Mockery context = new Mockery() {
{
setImposteriser(ClassImposteriser.INSTANCE);
}
};
resultGetter = context.mock(ResultGetter.class);
context.checking(new Expectations() {
{
one(resultGetter).getString();
will(returnValue(str));
}
});
StageResult result = (StageResult) callback.getResult(resultGetter);
assertThat(result, is(equal(value)));
final ParameterSetter parameterSetter = context.mock(ParameterSetter.class);
context.checking(new Expectations() {
{
one(parameterSetter).setString(str);
}
});
callback.setParameter(parameterSetter, value);
}
示例2: assertMaps
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入依赖的package包/类
private void assertMaps(final String str, StageState value) throws SQLException {
final ResultGetter resultGetter;
Mockery context = new Mockery() {
{
setImposteriser(ClassImposteriser.INSTANCE);
}
};
resultGetter = context.mock(ResultGetter.class);
context.checking(new Expectations() {
{
one(resultGetter).getString();
will(returnValue(str));
}
});
StageState result = (StageState) callback.getResult(resultGetter);
assertThat(result, is(equal(value)));
final ParameterSetter parameterSetter = context.mock(ParameterSetter.class);
context.checking(new Expectations() {
{
one(parameterSetter).setString(str);
}
});
callback.setParameter(parameterSetter, value);
}
示例3: 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());
}
}
}
示例4: setParameter
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入依赖的package包/类
@Override
public void setParameter(ParameterSetter setter, Object parameter) throws SQLException {
if (isNull(parameter)) {
setNull(setter, parameter);
} else {
setValue(setter, parameter);
}
}
示例5: 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());
}
}
示例6: 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);
}
示例7: setValue
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入依赖的package包/类
@Override
public void setValue(ParameterSetter setter, Object parameter) throws SQLException {
if (log.isDebugEnabled()) {
log.debug("#setValue() called");
}
setter.setInt((Integer) parameter);
}
示例8: 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());
}
}
示例9: 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);
}
示例10: setValue
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入依赖的package包/类
@Override
public void setValue(ParameterSetter setter, Object parameter) throws SQLException {
if (log.isDebugEnabled()) {
log.debug("#setValue() called");
}
setter.setBigDecimal((BigDecimal) parameter);
}
示例11: 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());
}
示例12: 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()));
}
示例13: setParameter
import com.ibatis.sqlmap.client.extensions.ParameterSetter; //导入依赖的package包/类
public void setParameter(ParameterSetter setter, Object parameter)
throws SQLException {
ProteinUserValidation validation = (ProteinUserValidation) parameter;
if (validation == null)
//setter.setNull(java.sql.Types.CHAR);
setter.setString(String.valueOf(ProteinUserValidation.UNVALIDATED.getStatusChar()));
else
setter.setString(String.valueOf(validation.getStatusChar()));
}
示例14: 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()));
}
示例15: 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());
}