cn.sylinx.hbatis.ext.mirage.repository.DaoService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hbatis-mirage Show documentation
Show all versions of hbatis-mirage Show documentation
hbatis mirage is a simple orm framework, extends hbatis-core
package cn.sylinx.hbatis.ext.mirage.repository;
import java.util.List;
import java.util.Map;
import cn.sylinx.hbatis.db.common.Page;
import cn.sylinx.hbatis.db.common.Record;
import cn.sylinx.hbatis.ext.common.repository.CommonDaoService;
import cn.sylinx.hbatis.ext.res.ClasspathSqlResource;
/**
* DAO服务
*
* @author hanqz
*
*/
public interface DaoService extends CommonDaoService {
/**
* 更新操作
*
*
* @param sqlResource
* @return
*/
int update(String sqlResource);
/**
* 更新并获取主键
*
*
* @param sqlResource
* @param params
* @return
*/
Object updateWithReturnPk(String sqlResource, Map params);
/**
* 更新并获取主键
*
* @param resource
* @param params
* @return
*/
Object updateWithReturnPk(ClasspathSqlResource resource, Map params);
/**
* 执行脚本,包括ddl
*
*
* @param sqlResource
*/
boolean execute(String sqlResource);
boolean execute(String sqlResource, Map params);
boolean execute(ClasspathSqlResource resource, Map params);
/**
* 更新操作
*
*
* @param sqlResource
* @param params
* @return
*/
int update(String sqlResource, Map params);
int update(ClasspathSqlResource resource, Map params);
/**
* 删除
*
*
* @param sqlResource
* @param params
* @return
*/
int delete(String sqlResource, Map params);
int delete(ClasspathSqlResource resource, Map params);
/**
* 删除
*
*
* @param sqlResource
* @return
*/
int delete(String sqlResource);
List queryList(String sqlResource, Map params, Class clz);
List queryList(ClasspathSqlResource resource, Map params, Class clz);
T queryFirst(String sqlResource, Map params, Class clz);
T queryFirst(ClasspathSqlResource resource, Map params, Class clz);
List queryList(String sqlResource, Class clz);
T queryFirst(String sqlResource, Class clz);
/**
* 查询单个对象
*
*
* @param resource
* @param params
* @return
*/
Record queryRecord(String sqlResource, Map params);
Record queryRecord(ClasspathSqlResource resource, Map params);
/**
* 查询单个对象
*
*
* @param resource
* @return
*/
Record queryRecord(String sqlResource);
/**
* 查询对象列表
*
*
* @param resource
* @param params
* @return
*/
List queryRecords(String sqlResource, Map params);
List queryRecords(ClasspathSqlResource resource, Map params);
/**
* 查询对象列表
*
*
* @param resource
* @return
*/
List queryRecords(String sqlResource);
/**
* 分页查询
*
*
* @param sqlResource
* 查询语句
* @param pageNumber
* 当前页
* @param pageSize
* 每页数量
* @param params
* 查询参数
* @return
*/
Page queryPage(String sqlResource, int pageNumber, int pageSize, Map params, Class clz);
Page queryPage(String sqlResource, int pageNumber, Map params, Class clz);
Page queryPage(String sqlResource, int pageNumber, Class clz);
Page queryPage(String sqlResource, int pageNumber, int pageSize, Class clz);
/**
* 分页查询
*
*
* @param pageNumber
* @param pageSize
* @param params
* @return
*/
Page queryPageRecords(String sqlResource, int pageNumber, int pageSize, Map params);
Page queryPageRecords(String sqlResource, int pageNumber, Map params);
Page queryPageRecords(String sqlResource, int pageNumber);
Page queryPageRecords(String sqlResource, int pageNumber, int pageSize);
List queryListWithCache(String sqlResource, Map params, Class clz);
List queryListWithCache(ClasspathSqlResource resource, Map params, Class clz);
T queryFirstWithCache(String sqlResource, Map params, Class clz);
T queryFirstWithCache(ClasspathSqlResource resource, Map params, Class clz);
List queryListWithCache(String sqlResource, Class clz);
T queryFirstWithCache(String sqlResource, Class clz);
/**
* 查询单个对象
*
*
* @param resource
* @param params
* @return
*/
Record queryRecordWithCache(String sqlResource, Map params);
Record queryRecordWithCache(ClasspathSqlResource resource, Map params);
/**
* 查询单个对象
*
*
* @param resource
* @return
*/
Record queryRecordWithCache(String sqlResource);
/**
* 查询对象列表
*
*
* @param resource
* @param params
* @return
*/
List queryRecordsWithCache(String sqlResource, Map params);
List queryRecordsWithCache(ClasspathSqlResource resource, Map params);
/**
* 查询对象列表
*
*
* @param sqlResource
* @return
*/
List queryRecordsWithCache(String sqlResource);
}