P
- 注解类型E
- 实体类public abstract class AbstractMyBatisDao<P,E> extends AbstractDao<P,E> implements MyBatisDao<P,E>
限定符和类型 | 字段和说明 |
---|---|
protected org.mybatis.spring.SqlSessionTemplate |
masterSqlSessionTemplate
master SqlSessionTemplate
|
protected List<org.mybatis.spring.SqlSessionTemplate> |
slaveSqlSessionTemplates
slave SqlSessionTemplate
|
ORDERS_PARAMETER_NAME
构造器和说明 |
---|
AbstractMyBatisDao() |
限定符和类型 | 方法和说明 |
---|---|
protected static Map<String,Object> |
buildParameters(Map<String,Object> conditions) |
int |
clear()
清空数据
|
long |
count()
数据记录总数
|
long |
count(Map<String,Object> conditions)
数据记录总数
|
int |
delete(Map<String,Object> conditions)
删除数据
|
int |
deleteByPrimary(P primary)
根据主键删除数据
|
List<E> |
getAll()
查询所有数据
|
E |
getByPrimary(P primary)
根据主键查询数据
|
org.mybatis.spring.SqlSessionTemplate |
getMasterSqlSessionTemplate()
返回 master SqlSessionTemplate
|
protected org.mybatis.spring.SqlSessionTemplate |
getSlaveSqlSessionTemplate() |
protected org.mybatis.spring.SqlSessionTemplate |
getSlaveSqlSessionTemplate(int index) |
List<org.mybatis.spring.SqlSessionTemplate> |
getSlaveSqlSessionTemplates()
返回 slave SqlSessionTemplate
|
protected abstract String |
getStatement() |
protected String |
getStatement(DML dml) |
protected String |
getStatement(String dml) |
int |
insert(E e)
插入数据
|
Pagination<E> |
paging(Map<String,Object> conditions,
int page,
int pagesize,
Map<String,com.buession.lang.Order> orders)
数据分页查询
|
int |
replace(E e)
替换数据
|
List<E> |
select(Map<String,Object> conditions,
int offset,
int size,
Map<String,com.buession.lang.Order> orders)
数据查询
|
List<E> |
select(Map<String,Object> conditions,
Map<String,com.buession.lang.Order> orders)
数据查询
|
E |
selectOne(Map<String,Object> conditions,
int offset,
Map<String,com.buession.lang.Order> orders)
获取一条记录
|
void |
setMasterSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate masterSqlSessionTemplate)
设置 master SqlSessionTemplate
|
void |
setSlaveSqlSessionTemplates(List<org.mybatis.spring.SqlSessionTemplate> slaveSqlSessionTemplates)
设置 slave SqlSessionTemplate
|
int |
truncate()
清空数据
|
int |
update(E e,
Map<String,Object> conditions)
更新数据
|
int |
updateByPrimary(P primary,
E e)
根据主键更新数据
|
protected void |
updatePrimary(E e,
P primary) |
batchInsert, batchReplace, getOne, getOne, getOne, getOne, getOne, paging, select, select, select, select, selectOne, selectOne, selectOne, selectOne
protected org.mybatis.spring.SqlSessionTemplate masterSqlSessionTemplate
protected List<org.mybatis.spring.SqlSessionTemplate> slaveSqlSessionTemplates
public org.mybatis.spring.SqlSessionTemplate getMasterSqlSessionTemplate()
public void setMasterSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate masterSqlSessionTemplate)
masterSqlSessionTemplate
- master SqlSessionTemplatepublic List<org.mybatis.spring.SqlSessionTemplate> getSlaveSqlSessionTemplates()
public void setSlaveSqlSessionTemplates(List<org.mybatis.spring.SqlSessionTemplate> slaveSqlSessionTemplates)
slaveSqlSessionTemplates
- slave SqlSessionTemplatepublic int updateByPrimary(P primary, E e)
Dao
updateByPrimary
在接口中 Dao<P,E>
primary
- 主键值e
- 新数据public E getByPrimary(P primary)
Dao
getByPrimary
在接口中 Dao<P,E>
primary
- 主键值public E selectOne(Map<String,Object> conditions, int offset, Map<String,com.buession.lang.Order> orders)
Dao
public List<E> select(Map<String,Object> conditions, Map<String,com.buession.lang.Order> orders)
Dao
public List<E> select(Map<String,Object> conditions, int offset, int size, Map<String,com.buession.lang.Order> orders)
Dao
public Pagination<E> paging(Map<String,Object> conditions, int page, int pagesize, Map<String,com.buession.lang.Order> orders)
Dao
public int deleteByPrimary(P primary)
Dao
deleteByPrimary
在接口中 Dao<P,E>
primary
- 主键值protected final org.mybatis.spring.SqlSessionTemplate getSlaveSqlSessionTemplate(int index) throws OperationException
protected final org.mybatis.spring.SqlSessionTemplate getSlaveSqlSessionTemplate() throws OperationException
protected abstract String getStatement()
Copyright © 2022 buession.com Inc.. All rights reserved.