org.apache.ibatis.mapping.BoundSql Maven / Gradle / Ivy
package org.apache.ibatis.mapping;
import org.apache.ibatis.reflection.MetaObject;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class BoundSql {
private String sql;
private List parameterMappings;
private Object parameterObject;
private Map additionalParameters;
private MetaObject metaParameters;
public BoundSql(String sql, List parameterMappings, Object parameterObject) {
this.sql = sql;
this.parameterMappings = parameterMappings;
this.parameterObject = parameterObject;
this.additionalParameters = new HashMap();
this.metaParameters = MetaObject.forObject(additionalParameters);
}
public String getSql() {
return sql;
}
public List getParameterMappings() {
return parameterMappings;
}
public Object getParameterObject() {
return parameterObject;
}
public boolean hasAdditionalParameter(String name) {
return metaParameters.hasGetter(name);
}
public void setAdditionalParameter(String name, Object value) {
metaParameters.setValue(name, value);
}
public Object getAdditionalParameter(String name) {
return metaParameters.getValue(name);
}
}