程序包 com.mbap.core.ct

类 WhereStatementWrapper

java.lang.Object
com.mbap.core.ct.WhereStatementWrapper

public class WhereStatementWrapper extends Object
包装查询语句

把前台页面组合查询中的where语句包装成带有的语句(如:where name = ? and age = ?),并通过getStatement()方法取得。 对应的参数值通过getParams()方法取得。

作者:
BW.Panda Jul 4, 2016
  • 构造器详细资料

    • WhereStatementWrapper

      public WhereStatementWrapper(String statement, List<Object> params)
    • WhereStatementWrapper

      public WhereStatementWrapper(String statement)
  • 方法详细资料

    • getStatement

      public String getStatement()
      功能描述: 取的where语句。

      如:where name = ? and age = ?。 ?对应的参数请通过WhereStatementWrapper 对应的getParams()获得

      返回:
      String 封装好的where语句
    • getStatementByJoinStr

      public String getStatementByJoinStr()
      功能描述: 直接拼接参数 如: "where name =" + name + " age =" + age;
      返回:
      String 封装好的where语句
    • getParams

      public Object[] getParams()
      功能描述: 取得getStatement()方法返回的语句中?对应的参数值集合
      返回:
      List<Object> 参数值集合
    • addParam

      public void addParam(Object param)
      功能描述: 追加单个查询参数
      参数:
      param - 单个参数
    • addParams

      public void addParams(List<Object> params)
      功能描述: 追加多个查询参数
      参数:
      params - 参数集合