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

org.onetwo.common.db.spi.QueryWrapper Maven / Gradle / Ivy

package org.onetwo.common.db.spi;

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

import org.onetwo.common.utils.Page;
import org.onetwo.dbm.dialet.DBDialect.LockInfo;
import org.springframework.jdbc.core.RowMapper;

@SuppressWarnings("rawtypes")
public interface QueryWrapper {
 
	public int executeUpdate();

	public  List getResultList();

	public  T getSingleResult();

	public QueryWrapper setFirstResult(int startPosition);

	public QueryWrapper setMaxResults(int maxResult);

	public QueryWrapper setParameter(int position, Object value);

	public QueryWrapper setParameter(String name, Object value);
	
	public QueryWrapper setParameters(Map params);
	
	public QueryWrapper setParameters(List params);
	
	public QueryWrapper setParameters(Object[] params);
	
	public QueryWrapper setPageParameter(final Page page);
	
	/***
	 * 
	 * @author weishao zeng
	 * @param first  from 0
	 * @param size
	 * @return
	 */
	public QueryWrapper setLimited(final Integer first, final Integer size);

	QueryWrapper setLockInfo(LockInfo lockInfo);
	
//	LockInfo getLockInfo();
	
	Map getParameters();
	
	public  T getRawQuery(Class clazz);
	
	public QueryWrapper setQueryConfig(Map configs);
	
//	public DataQuery setFlushMode(FlushModeType flushMode);
	
	/*public boolean isCacheable();

	public void setCacheable(boolean cacheable);*/
	
	public void setRowMapper(RowMapper rowMapper);
	
	public  T unwarp(Class clazz);
	

	boolean isUseAutoLimitSqlIfPagination();

	void setUseAutoLimitSqlIfPagination(boolean useAutoLimitSqlIfPagination);
	

}