
org.beangle.commons.dao.query.builder.AbstractQuery Maven / Gradle / Ivy
The newest version!
/*
* Beangle, Agile Development Scaffold and Toolkits.
*
* Copyright © 2005, The Beangle Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
package org.beangle.commons.dao.query.builder;
import java.util.Map;
import org.beangle.commons.collection.page.PageLimit;
import org.beangle.commons.dao.query.QueryBuilder;
/**
* 抽象查询
*
* @author chaostone
* @version $Id: $
*/
public abstract class AbstractQuery implements QueryBuilder {
/** query 查询语句 */
protected String queryStr;
/** count 计数语句 */
protected String countStr;
/** 分页 */
protected PageLimit limit;
/** 参数 */
protected Map params;
/** 缓存查询结果 */
protected boolean cacheable = false;
/**
* Returns limit
*/
public PageLimit getLimit() {
return limit;
}
/**
*
* Setter for the field limit
.
*
*
* @param limit a {@link org.beangle.commons.collection.page.PageLimit} object.
*/
public void setLimit(final PageLimit limit) {
this.limit = limit;
}
/**
*
* Getter for the field params
.
*
*
* @return a {@link java.util.Map} object.
*/
public Map getParams() {
return params;
}
/**
*
* Getter for the field countStr
.
*
*
* @return a {@link java.lang.String} object.
*/
public String getCountStr() {
return countStr;
}
/**
*
* Setter for the field countStr
.
*
*
* @param countStr a {@link java.lang.String} object.
*/
public void setCountStr(final String countStr) {
this.countStr = countStr;
}
/**
*
* Getter for the field queryStr
.
*
*
* @return a {@link java.lang.String} object.
*/
public String getQueryStr() {
return queryStr;
}
/**
*
* Setter for the field queryStr
.
*
*
* @param queryStr a {@link java.lang.String} object.
*/
public void setQueryStr(final String queryStr) {
this.queryStr = queryStr;
}
/**
*
* Setter for the field params
.
*
*
* @param params a {@link java.util.Map} object.
*/
public void setParams(final Map params) {
this.params = params;
}
/**
*
* toQueryString.
*
*
* @return a {@link java.lang.String} object.
*/
public abstract String toQueryString();
/**
*
* toCountString.
*
*
* @return a {@link java.lang.String} object.
*/
public String toCountString() {
return countStr;
}
/**
*
* isCacheable.
*
*
* @return a boolean.
*/
public boolean isCacheable() {
return cacheable;
}
/**
*
* Setter for the field cacheable
.
*
*
* @param cacheable a boolean.
*/
public void setCacheable(final boolean cacheable) {
this.cacheable = cacheable;
}
}