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

cn.sylinx.hbatis.ext.mirage.MirageService Maven / Gradle / Ivy

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

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

import cn.sylinx.hbatis.db.common.BaseDbOper;
import cn.sylinx.hbatis.db.common.HbatisService;
import cn.sylinx.hbatis.db.common.Record;
import cn.sylinx.hbatis.ext.res.ClasspathSqlResource;

/**
 * MirageService, 读取类路径下的sql文件
 * 
 * @author han
 *
 */
public interface MirageService extends HbatisService, BaseDbOper {

	/**
	 * 使用特定数据源
	 * 
	 * @param datasourceName
	 * @return
	 */
	public MirageService useService(String datasourceName);

	/**
	 * 使用缓存查询
	 * 
	 * @return
	 */
	public MirageCacheQuery withMirageCache();

	/**
	 * 查询Map列表
	 * 
	 * @param sqlId
	 * @param params
	 * @return
	 */
	public List> queryForMapList(ClasspathSqlResource sqlResource, Map params);

	/**
	 * 查询记录
	 * 
	 * @param sqlId
	 * @param params
	 * @return
	 */
	public List queryForRecords(ClasspathSqlResource sqlResource, Map params);

	/**
	 * 查询第一条记录
	 * 
	 * @param sqlId
	 * @param params
	 * @return
	 */
	public Record queryFirstRecord(ClasspathSqlResource sqlResource, Map params);

	/**
	 * 查询记录
	 * 
	 * @param sqlResource
	 * @param params
	 * @return
	 */
	public List queryObjectArrayList(ClasspathSqlResource sqlResource, Map params);

	/**
	 * 查询第一条记录
	 * 
	 * @param sqlResource
	 * @param params
	 * @return
	 */
	public Object[] queryFirstObjectArray(ClasspathSqlResource sqlResource, Map params);

	/**
	 * 查询第一个map
	 * 
	 * @param sqlId
	 * @param params
	 * @return
	 */
	public Map queryFirstForMap(ClasspathSqlResource sqlResource, Map params);

	/**
	 * 通过配置文件获取对应对象列表
	 * 
	 * @param sqlId
	 * @return
	 */
	public  List query(ClasspathSqlResource sqlResource, Map params, Class clz);

	public  List queryObjectList(ClasspathSqlResource resource, Map params, Class clz);

	public  T queryFirstObject(ClasspathSqlResource resource, Map params, Class clz);

	/**
	 * 通过配置文件获取对应对象列表
	 * 
	 * @param sqlId
	 * @return
	 */
	public  T queryFirst(ClasspathSqlResource sqlResource, Map params, Class clz);

	/**
	 * update
	 * 
	 * @param sqlId
	 * @param params
	 * @return
	 */
	public int update(ClasspathSqlResource sqlResource, Map params);

	/**
	 * 执行sql
	 * 
	 * @param sqlResource
	 * @param params
	 * @return
	 */
	public boolean execute(ClasspathSqlResource sqlResource, Map params);

	/**
	 * delete
	 * 
	 * @param sqlId
	 * @param params
	 * @return
	 */
	public int delete(ClasspathSqlResource sqlResource, Map params);

	/**
	 * save
	 * 
	 * @param sqlId
	 * @param params
	 * @return
	 */
	public Object save(ClasspathSqlResource sqlResource, Map params);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy