All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.ibatis.mapping.BoundSql Maven / Gradle / Ivy

There is a newer version: 3.0-beta-10
Show newest version
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);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy