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

cn.sylinx.hbatis.db.common.FluentSqlParams Maven / Gradle / Ivy

There is a newer version: 2.0.0.RELEASE
Show newest version
package cn.sylinx.hbatis.db.common;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class FluentSqlParams {

	private Class modelClass;
	private String selectColumns;
	private String selectExpressionColumns;
	private boolean distinct;
	private boolean count;
	private String tableName;
	private StringBuilder conditionSQL;
	private Map updateColumns;
	private Map updateColumnExpression;
	private List excludedColumns;
	private String groupBy;
	private String orderBy;
	private String limitSQL;
	private List paramValues = new ArrayList<>(8);
	private String[] primaryKeyColumn;
	private T model;
	private Map attrs;
	private String preEscape;
	private String postEscape;
	private boolean singleField = false;
	private String hint;
	private String tablePostfix;
	private String tablePrefix;

	public String getLimitSQL() {
		return limitSQL;
	}

	public void setLimitSQL(String limitSQL) {
		this.limitSQL = limitSQL;
	}

	public String mapColumn(String column) {
		String trueColumn = attrs.get(column);
		return preEscape + (trueColumn == null ? column : trueColumn) + postEscape;
	}

	public String getPreEscape() {
		return preEscape;
	}

	public void setPreEscape(String preEscape) {
		this.preEscape = preEscape;
	}

	public String getPostEscape() {
		return postEscape;
	}

	public void setPostEscape(String postEscape) {
		this.postEscape = postEscape;
	}

	public Map getAttrs() {
		return attrs;
	}

	public void setAttrs(Map attrs) {
		this.attrs = attrs;
	}

	public Class getModelClass() {
		return modelClass;
	}

	public void setModelClass(Class modelClass) {
		this.modelClass = modelClass;
	}

	public String getSelectColumns() {
		return selectColumns;
	}

	public void setSelectColumns(String selectColumns) {
		this.selectColumns = selectColumns;
	}

	public boolean isDistinct() {
		return distinct;
	}

	public void setDistinct(boolean distinct) {
		this.distinct = distinct;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public StringBuilder getConditionSQL() {
		return conditionSQL;
	}

	public void setConditionSQL(StringBuilder conditionSQL) {
		this.conditionSQL = conditionSQL;
	}

	public Map getUpdateColumns() {
		return updateColumns;
	}

	public void setUpdateColumns(Map updateColumns) {
		this.updateColumns = updateColumns;
	}

	public List getExcludedColumns() {
		return excludedColumns;
	}

	public void setExcludedColumns(List excludedColumns) {
		this.excludedColumns = excludedColumns;
	}

	public String getOrderBy() {
		return orderBy;
	}

	public void setOrderBy(String orderBy) {
		this.orderBy = orderBy;
	}

	public String getGroupBy() {
		return groupBy;
	}

	public void setGroupBy(String groupBy) {
		this.groupBy = groupBy;
	}

	public List getParamValues() {
		return paramValues;
	}

	public void setParamValues(List paramValues) {
		this.paramValues = paramValues;
	}

	public String[] getPrimaryKeyColumn() {
		return primaryKeyColumn;
	}

	public void setPrimaryKeyColumn(String[] primaryKeyColumn) {
		this.primaryKeyColumn = primaryKeyColumn;
	}

	public T getModel() {
		return model;
	}

	public void setModel(T model) {
		this.model = model;
	}

	public boolean isCount() {
		return count;
	}

	public void setCount(boolean count) {
		this.count = count;
	}

	public boolean isSingleField() {
		return singleField;
	}

	public void setSingleField(boolean singleField) {
		this.singleField = singleField;
	}

	public String getHint() {
		return hint;
	}

	public void setHint(String hint) {
		this.hint = hint;
	}

	public Map getUpdateColumnExpression() {
		return updateColumnExpression;
	}

	public void setUpdateColumnExpression(Map updateColumnExpression) {
		this.updateColumnExpression = updateColumnExpression;
	}

	public String getSelectExpressionColumns() {
		return selectExpressionColumns;
	}

	public void setSelectExpressionColumns(String selectExpressionColumns) {
		this.selectExpressionColumns = selectExpressionColumns;
	}

	public String getTablePostfix() {
		return tablePostfix;
	}

	public void setTablePostfix(String tablePostfix) {
		this.tablePostfix = tablePostfix;
	}

	public String getTablePrefix() {
		return tablePrefix;
	}

	public void setTablePrefix(String tablePrefix) {
		this.tablePrefix = tablePrefix;
	}
	
}