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

org.onetwo.common.db.builder.QueryBuilder Maven / Gradle / Ivy

The newest version!
package org.onetwo.common.db.builder;

import java.util.Map;

import org.onetwo.dbm.dialet.DBDialect.LockInfo;

/***
 * @author way
 *
 */
public interface QueryBuilder {

	public String getAlias();
	
	public  T as(Class queryBuilderClass);

	public Class getEntityClass();
	
	public WhereCauseBuilder where();

	/*public QueryBuilder debug();

	public QueryBuilder or(QueryBuilder subQuery);

	public QueryBuilder and(QueryBuilder subQuery);

	public QueryBuilder addField(QueryBuilderField field);

	public QueryBuilder ignoreIfNull();

	public QueryBuilder throwIfNull();

	public QueryBuilder calmIfNull();

	public DefaultQueryBuilderField field(String... fields);*/

	public QueryBuilder select(String... fields);
	public QueryBuilder unselect(String...fields);
	public QueryBuilder count(String field);

	/***
	 * 
	 * @author weishao zeng
	 * @param first  from 0
	 * @param size 若size<=0,则不设置限制参数
	 * @return
	 */
	public QueryBuilder limit(int first, int size);

	public QueryBuilder asc(String... fields);

	public QueryBuilder desc(String... fields);
	
	QueryBuilderImpl ascRand(Object seed);
	QueryBuilderImpl descRand(Object seed);

	public QueryBuilder distinct(String... fields);
	public QueryBuilder lock(LockInfo lock);
	
	public QueryBuilderJoin leftJoin(String table, String alias);

//	public QueryBuilder build();
	/***
	 * alias toSelect
	 * @return
	 */
	public QueryAction toQuery();
	public QueryAction toSelect();
	
//	public int delete();
	
	public Map getParams();

	ExecuteAction toExecute();
	
//	public ParamValues getParamValues();
//	public String getSql();
	
	
//	public int execute();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy