
com.centit.support.database.QueryAndParams Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of centit-database Show documentation
Show all versions of centit-database Show documentation
数据库操作通用方法和函数,从以前的util包中分离出来,并且整合了部分sys-module中的函数
package com.centit.support.database;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import com.centit.support.compiler.Lexer;
public class QueryAndParams {
public String queryStmt;
public Object[] params;
public String getSql() {
return queryStmt;
}
public void setSql(String hql) {
this.queryStmt = hql;
}
public String getQuery() {
return queryStmt;
}
public void setQuery(String hql) {
this.queryStmt = hql;
}
public String getHql() {
return queryStmt;
}
public void setHql(String hql) {
this.queryStmt = hql;
}
public Object[] getParams() {
return params;
}
public Object getParam(int index){
if( params==null)
return null;
if(index>=params.length)
return null;
return params[index];
}
public QueryAndParams() {
this.queryStmt = null;
this.params = null;
}
public QueryAndParams(String shql) {
this.queryStmt = shql;
this.params = null;
}
public QueryAndParams(String shql,final Object[] values) {
this.queryStmt = shql;
this.params = values;
}
public static QueryAndParams creepArrayParamFoInQuery(String sql, Object[] sqlParams){
StringBuilder sqlb = new StringBuilder();
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy