P
- 注解类型E
- 实体类public abstract class AbstractMongoDBDao<P,E> extends AbstractDao<P,E> implements MongoDBDao<P,E>
PRIMARY_FIELD
Constructor and Description |
---|
AbstractMongoDBDao() |
Modifier and Type | Method and Description |
---|---|
protected static org.springframework.data.mongodb.core.query.Criteria |
buildCriteria(Map<String,Object> conditions) |
protected void |
buildSort(org.springframework.data.mongodb.core.query.Query query,
Map<String,com.buession.lang.Order> orders) |
int |
clear()
清空数据
|
long |
count()
数据记录总数
|
long |
count(Map<String,Object> conditions)
数据记录总数
|
long |
count(org.springframework.data.mongodb.core.query.Query query) |
int |
delete(Map<String,Object> conditions)
删除数据
|
int |
delete(Map<String,Object> conditions,
int size)
删除数据
|
int |
deleteByPrimary(P primary)
根据主键删除数据
|
List<E> |
getAll()
查询所有数据
|
E |
getByPrimary(P primary)
根据主键查询数据
|
org.springframework.data.mongodb.core.MongoTemplate |
getMongoTemplate()
返回
MongoTemplate 实例 |
protected Class<E> |
getStatement() |
int |
insert(E e)
插入数据
|
Pagination<E> |
paging(Map<String,Object> conditions,
int page,
int pagesize,
Map<String,com.buession.lang.Order> orders)
数据分页查询
|
Pagination<E> |
paging(org.springframework.data.mongodb.core.query.Query query,
int page,
int pagesize,
Map<String,com.buession.lang.Order> orders) |
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)
数据查询
|
List<E> |
select(org.springframework.data.mongodb.core.query.Query query,
int offset,
int size,
Map<String,com.buession.lang.Order> orders) |
E |
selectOne(Map<String,Object> conditions,
int offset,
Map<String,com.buession.lang.Order> orders)
获取一条记录
|
void |
setMongoTemplate(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate)
设置
MongoTemplate |
int |
update(E e,
Map<String,Object> conditions)
更新数据
|
int |
updateByPrimary(P primary,
E e)
根据主键更新数据
|
batchInsert, batchReplace, getOne, getOne, getOne, getOne, getOne, paging, select, select, select, select, selectOne, selectOne, selectOne, selectOne
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
replace, truncate
public org.springframework.data.mongodb.core.MongoTemplate getMongoTemplate()
MongoTemplate
实例MongoTemplate
public void setMongoTemplate(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate)
MongoTemplate
mongoTemplate
- MongoTemplate
public int insert(E e)
public int update(E e, Map<String,Object> conditions)
Dao
public int updateByPrimary(P primary, E e)
Dao
updateByPrimary
in interface Dao<P,E>
primary
- 主键值e
- 新数据public E getByPrimary(P primary)
Dao
getByPrimary
in interface 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 List<E> select(org.springframework.data.mongodb.core.query.Query query, int offset, int size, Map<String,com.buession.lang.Order> orders)
public Pagination<E> paging(Map<String,Object> conditions, int page, int pagesize, Map<String,com.buession.lang.Order> orders)
Dao
public Pagination<E> paging(org.springframework.data.mongodb.core.query.Query query, int page, int pagesize, Map<String,com.buession.lang.Order> orders)
public long count()
Dao
public long count(Map<String,Object> conditions)
Dao
public long count(org.springframework.data.mongodb.core.query.Query query)
public int delete(Map<String,Object> conditions, int size)
Dao
public int deleteByPrimary(P primary)
Dao
deleteByPrimary
in interface Dao<P,E>
primary
- 主键值public int clear()
Dao
protected static org.springframework.data.mongodb.core.query.Criteria buildCriteria(Map<String,Object> conditions)
Copyright © 2024 buession.com Inc.. All rights reserved.