public class ServiceImpl<T> extends Object implements IService<T>
BaseMapper| 构造器和说明 |
|---|
ServiceImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
List<T> |
aggregateList(AggregateChainWrapper<T,?> queryChainWrapper) |
List<T> |
aggregateList(com.mongodb.client.ClientSession clientSession,
AggregateChainWrapper<T,?> queryChainWrapper) |
long |
count() |
long |
count(com.mongodb.client.ClientSession clientSession) |
long |
count(com.mongodb.client.ClientSession clientSession,
QueryChainWrapper<T,?> queryChainWrapper) |
long |
count(QueryChainWrapper<T,?> queryChainWrapper) |
String |
createIndex(org.bson.conversions.Bson bson)
创建索引
|
String |
createIndex(org.bson.conversions.Bson bson,
com.mongodb.client.model.IndexOptions indexOptions)
使用给定的键和选项创建索引。
|
String |
createIndex(com.mongodb.client.ClientSession clientSession,
org.bson.conversions.Bson bson)
创建索引,携带事务
|
String |
createIndex(com.mongodb.client.ClientSession clientSession,
org.bson.conversions.Bson bson,
com.mongodb.client.model.IndexOptions indexOptions)
使用给定的键和选项创建索引。
|
List<String> |
createIndexes(com.mongodb.client.ClientSession clientSession,
List<com.mongodb.client.model.IndexModel> indexes)
创建多个索引
|
List<String> |
createIndexes(com.mongodb.client.ClientSession clientSession,
List<com.mongodb.client.model.IndexModel> indexes,
com.mongodb.client.model.CreateIndexOptions createIndexOptions)
创建多个索引
|
List<String> |
createIndexes(List<com.mongodb.client.model.IndexModel> indexes)
创建多个索引
|
List<String> |
createIndexes(List<com.mongodb.client.model.IndexModel> indexes,
com.mongodb.client.model.CreateIndexOptions createIndexOptions)
创建多个索引
|
void |
dropIndex(org.bson.conversions.Bson keys)
在给定用于创建索引的键的情况下删除索引。
|
void |
dropIndex(org.bson.conversions.Bson keys,
com.mongodb.client.model.DropIndexOptions dropIndexOptions)
在给定用于创建索引的键的情况下删除索引。
|
void |
dropIndex(com.mongodb.client.ClientSession clientSession,
org.bson.conversions.Bson keys)
在给定用于创建索引的键的情况下删除索引。
|
void |
dropIndex(com.mongodb.client.ClientSession clientSession,
org.bson.conversions.Bson keys,
com.mongodb.client.model.DropIndexOptions dropIndexOptions)
在给定用于创建索引的键的情况下删除索引。
|
void |
dropIndex(com.mongodb.client.ClientSession clientSession,
String indexName)
删除给定其名称的索引。
|
void |
dropIndex(com.mongodb.client.ClientSession clientSession,
String indexName,
com.mongodb.client.model.DropIndexOptions dropIndexOptions)
删除给定其名称的索引。
|
void |
dropIndex(String indexName)
删除给定其名称的索引。
|
void |
dropIndex(String indexName,
com.mongodb.client.model.DropIndexOptions dropIndexOptions)
删除给定其名称的索引。
|
void |
dropIndexes()
删除此集合上的所有索引,但 _id 上的默认值除外。
|
void |
dropIndexes(com.mongodb.client.ClientSession clientSession)
删除此集合上的所有索引,但 _id 上的默认值除外。
|
void |
dropIndexes(com.mongodb.client.ClientSession clientSession,
com.mongodb.client.model.DropIndexOptions dropIndexOptions)
删除此集合上的所有索引,但 _id 上的默认值除外。
|
void |
dropIndexes(com.mongodb.client.model.DropIndexOptions dropIndexOptions)
删除此集合上的所有索引,但 _id 上的默认值除外。
|
List<T> |
getByColumn(com.mongodb.client.ClientSession clientSession,
SFunction<T,Object> field,
Object fieldValue) |
List<T> |
getByColumn(com.mongodb.client.ClientSession clientSession,
String field,
Object fieldValue) |
List<T> |
getByColumn(SFunction<T,Object> field,
Object fieldValue)
根据某一列查询
|
List<T> |
getByColumn(String field,
Object fieldValue)
根据某一列查询
|
T |
getById(com.mongodb.client.ClientSession clientSession,
Serializable id)
根据id查询单个
|
T |
getById(Serializable id)
根据id查询单个
|
List<T> |
getByIds(com.mongodb.client.ClientSession clientSession,
Collection<Serializable> ids) |
List<T> |
getByIds(Collection<Serializable> ids) |
Class<T> |
getClazz() |
Class<T> |
getGenericityClazz() |
com.mongodb.client.MongoCollection<org.bson.Document> |
getMongoCollection()
获取当前操作对象的连接,以便使用MongoDriver的语法
|
SqlExecute |
getSqlOperation() |
LambdaAggregateChainWrapper<T> |
lambdaAggregate() |
LambdaQueryChainWrapper<T> |
lambdaQuery() |
LambdaUpdateChainWrapper<T> |
lambdaUpdate() |
T |
limitOne(com.mongodb.client.ClientSession clientSession,
QueryChainWrapper<T,?> queryChainWrapper)
获取单个,返回T类型的对象
注:如果查询到大于一条数据,会取第一条返回 |
T |
limitOne(QueryChainWrapper<T,?> queryChainWrapper)
获取单个,返回T类型的对象
注:如果查询到大于一条数据,会取第一条返回 |
List<T> |
list()
查询所有
|
List<T> |
list(AggregateChainWrapper<T,?> queryChainWrapper) |
List<T> |
list(com.mongodb.client.ClientSession clientSession)
查询所有
|
List<T> |
list(com.mongodb.client.ClientSession clientSession,
AggregateChainWrapper<T,?> queryChainWrapper) |
List<T> |
list(com.mongodb.client.ClientSession clientSession,
QueryChainWrapper<T,?> queryChainWrapper) |
List<T> |
list(QueryChainWrapper<T,?> queryChainWrapper) |
List<org.bson.Document> |
listIndexes()
获取此集合中的所有索引。
|
List<org.bson.Document> |
listIndexes(com.mongodb.client.ClientSession clientSession)
获取此集合中的所有索引。
|
T |
one(com.mongodb.client.ClientSession clientSession,
QueryChainWrapper<T,?> queryChainWrapper) |
T |
one(QueryChainWrapper<T,?> queryChainWrapper) |
PageResult<T> |
page(com.mongodb.client.ClientSession clientSession,
Integer pageNum,
Integer pageSize)
分页查询
|
PageResult<T> |
page(com.mongodb.client.ClientSession clientSession,
PageParam pageParam)
分页查询
|
PageResult<T> |
page(com.mongodb.client.ClientSession clientSession,
QueryChainWrapper<T,?> queryChainWrapper,
Integer pageNum,
Integer pageSize) |
PageResult<T> |
page(com.mongodb.client.ClientSession clientSession,
QueryChainWrapper<T,?> queryChainWrapper,
PageParam pageParam) |
PageResult<T> |
page(Integer pageNum,
Integer pageSize)
分页查询
|
PageResult<T> |
page(PageParam pageParam)
分页查询
|
PageResult<T> |
page(QueryChainWrapper<T,?> queryChainWrapper,
Integer pageNum,
Integer pageSize) |
PageResult<T> |
page(QueryChainWrapper<T,?> queryChainWrapper,
PageParam pageParam) |
Boolean |
remove(com.mongodb.client.ClientSession clientSession,
UpdateChainWrapper<T,?> updateChainWrapper)
根据条件删除
|
Boolean |
remove(UpdateChainWrapper<T,?> updateChainWrapper)
根据条件删除
|
Boolean |
removeBatchByIds(com.mongodb.client.ClientSession clientSession,
Collection<Serializable> idList)
根据id批量删除
|
Boolean |
removeBatchByIds(Collection<Serializable> idList)
根据id批量删除
|
Boolean |
removeByColumn(com.mongodb.client.ClientSession clientSession,
SFunction<T,Object> column,
Object value)
根据字段删除
|
Boolean |
removeByColumn(com.mongodb.client.ClientSession clientSession,
String column,
Object value)
根据字段删除
|
Boolean |
removeByColumn(SFunction<T,Object> column,
Object value)
根据字段删除
|
Boolean |
removeByColumn(String column,
Object value)
根据字段删除
|
Boolean |
removeById(com.mongodb.client.ClientSession clientSession,
Serializable id)
根据id删除
|
Boolean |
removeById(Serializable id)
根据id删除
|
Boolean |
save(com.mongodb.client.ClientSession clientSession,
T entity)
添加
|
Boolean |
save(T entity)
添加
|
Boolean |
saveBatch(com.mongodb.client.ClientSession clientSession,
Collection<T> entityList)
添加多个
|
Boolean |
saveBatch(Collection<T> entityList)
添加多个
|
Boolean |
saveOrUpdate(com.mongodb.client.ClientSession clientSession,
T entity)
添加或修改
|
Boolean |
saveOrUpdate(T entity)
添加或修改
|
Boolean |
saveOrUpdateBatch(com.mongodb.client.ClientSession clientSession,
Collection<T> entityList)
批量添加或修改
|
Boolean |
saveOrUpdateBatch(Collection<T> entityList)
批量添加或修改
|
void |
setClazz(Class<?> clazz) |
void |
setSqlOperation(SqlExecute sqlExecute) |
List<T> |
sql(com.mongodb.client.ClientSession clientSession,
String sql) |
List<T> |
sql(String sql)
查询sql,传入值为json,如{eq:XXX}
|
Boolean |
update(com.mongodb.client.ClientSession clientSession,
UpdateChainWrapper<T,?> updateChainWrapper)
根据条件修改
|
Boolean |
update(UpdateChainWrapper<T,?> updateChainWrapper)
根据条件修改
|
Boolean |
updateBatchByIds(com.mongodb.client.ClientSession clientSession,
Collection<T> entityList) |
Boolean |
updateBatchByIds(Collection<T> entityList) |
Boolean |
updateByColumn(com.mongodb.client.ClientSession clientSession,
T entity,
SFunction<T,Object> column)
通过列进行修改
|
Boolean |
updateByColumn(com.mongodb.client.ClientSession clientSession,
T entity,
String column) |
Boolean |
updateByColumn(T entity,
SFunction<T,Object> column)
通过列进行修改
|
Boolean |
updateByColumn(T entity,
String column) |
Boolean |
updateById(com.mongodb.client.ClientSession clientSession,
T entity)
修改
|
Boolean |
updateById(T entity)
修改
|
public void setSqlOperation(SqlExecute sqlExecute)
public com.mongodb.client.MongoCollection<org.bson.Document> getMongoCollection()
public void setClazz(Class<?> clazz)
public Class<T> getGenericityClazz()
getGenericityClazz 在接口中 IService<T>public Boolean save(com.mongodb.client.ClientSession clientSession, T entity)
IServicepublic Boolean saveBatch(Collection<T> entityList)
IServicepublic Boolean saveBatch(com.mongodb.client.ClientSession clientSession, Collection<T> entityList)
IServicepublic Boolean saveOrUpdate(T entity)
IServicesaveOrUpdate 在接口中 IService<T>entity - 对象public Boolean saveOrUpdate(com.mongodb.client.ClientSession clientSession, T entity)
IServicesaveOrUpdate 在接口中 IService<T>entity - 对象public Boolean saveOrUpdateBatch(Collection<T> entityList)
IServicesaveOrUpdateBatch 在接口中 IService<T>entityList - 对象集合public Boolean saveOrUpdateBatch(com.mongodb.client.ClientSession clientSession, Collection<T> entityList)
IServicesaveOrUpdateBatch 在接口中 IService<T>entityList - 对象集合public Boolean updateById(T entity)
IServiceupdateById 在接口中 IService<T>entity - 修改的对象,需要包含idpublic Boolean updateById(com.mongodb.client.ClientSession clientSession, T entity)
IServiceupdateById 在接口中 IService<T>entity - 修改的对象,需要包含idpublic Boolean updateBatchByIds(Collection<T> entityList)
updateBatchByIds 在接口中 IService<T>public Boolean updateBatchByIds(com.mongodb.client.ClientSession clientSession, Collection<T> entityList)
updateBatchByIds 在接口中 IService<T>public Boolean updateByColumn(T entity, SFunction<T,Object> column)
IServiceupdateByColumn 在接口中 IService<T>entity - 修改的实体column - 根据什么列修改public Boolean updateByColumn(com.mongodb.client.ClientSession clientSession, T entity, SFunction<T,Object> column)
IServiceupdateByColumn 在接口中 IService<T>entity - 修改的实体column - 根据什么列修改public Boolean updateByColumn(T entity, String column)
updateByColumn 在接口中 IService<T>public Boolean updateByColumn(com.mongodb.client.ClientSession clientSession, T entity, String column)
updateByColumn 在接口中 IService<T>public Boolean remove(UpdateChainWrapper<T,?> updateChainWrapper)
IServicepublic Boolean remove(com.mongodb.client.ClientSession clientSession, UpdateChainWrapper<T,?> updateChainWrapper)
IServicepublic Boolean update(UpdateChainWrapper<T,?> updateChainWrapper)
IServicepublic Boolean update(com.mongodb.client.ClientSession clientSession, UpdateChainWrapper<T,?> updateChainWrapper)
IServicepublic Boolean removeById(Serializable id)
IServiceremoveById 在接口中 IService<T>id - 数据idpublic Boolean removeById(com.mongodb.client.ClientSession clientSession, Serializable id)
IServiceremoveById 在接口中 IService<T>id - 数据idpublic Boolean removeByColumn(SFunction<T,Object> column, Object value)
IServiceremoveByColumn 在接口中 IService<T>column - 字段名public Boolean removeByColumn(com.mongodb.client.ClientSession clientSession, SFunction<T,Object> column, Object value)
IServiceremoveByColumn 在接口中 IService<T>column - 字段名public Boolean removeByColumn(String column, Object value)
IServiceremoveByColumn 在接口中 IService<T>column - 字段value - 值public Boolean removeByColumn(com.mongodb.client.ClientSession clientSession, String column, Object value)
IServiceremoveByColumn 在接口中 IService<T>column - 字段value - 值public Boolean removeBatchByIds(Collection<Serializable> idList)
IServiceremoveBatchByIds 在接口中 IService<T>idList - id集合public Boolean removeBatchByIds(com.mongodb.client.ClientSession clientSession, Collection<Serializable> idList)
IServiceremoveBatchByIds 在接口中 IService<T>idList - id集合public List<T> aggregateList(AggregateChainWrapper<T,?> queryChainWrapper)
aggregateList 在接口中 IService<T>public List<T> aggregateList(com.mongodb.client.ClientSession clientSession, AggregateChainWrapper<T,?> queryChainWrapper)
aggregateList 在接口中 IService<T>public T one(com.mongodb.client.ClientSession clientSession, QueryChainWrapper<T,?> queryChainWrapper)
public T limitOne(QueryChainWrapper<T,?> queryChainWrapper)
IService注:如果查询到大于一条数据,会取第一条返回
public T limitOne(com.mongodb.client.ClientSession clientSession, QueryChainWrapper<T,?> queryChainWrapper)
IService注:如果查询到大于一条数据,会取第一条返回
public List<T> list(com.mongodb.client.ClientSession clientSession, QueryChainWrapper<T,?> queryChainWrapper)
public List<T> list(com.mongodb.client.ClientSession clientSession, AggregateChainWrapper<T,?> queryChainWrapper)
public long count(QueryChainWrapper<T,?> queryChainWrapper)
public long count(com.mongodb.client.ClientSession clientSession,
QueryChainWrapper<T,?> queryChainWrapper)
public PageResult<T> page(QueryChainWrapper<T,?> queryChainWrapper, Integer pageNum, Integer pageSize)
public PageResult<T> page(com.mongodb.client.ClientSession clientSession, QueryChainWrapper<T,?> queryChainWrapper, Integer pageNum, Integer pageSize)
public PageResult<T> page(QueryChainWrapper<T,?> queryChainWrapper, PageParam pageParam)
public PageResult<T> page(com.mongodb.client.ClientSession clientSession, QueryChainWrapper<T,?> queryChainWrapper, PageParam pageParam)
public PageResult<T> page(PageParam pageParam)
IServicepublic PageResult<T> page(com.mongodb.client.ClientSession clientSession, PageParam pageParam)
IServicepublic PageResult<T> page(Integer pageNum, Integer pageSize)
IServicepublic PageResult<T> page(com.mongodb.client.ClientSession clientSession, Integer pageNum, Integer pageSize)
IServicepublic T getById(Serializable id)
IServicepublic T getById(com.mongodb.client.ClientSession clientSession, Serializable id)
IServicepublic List<T> getByIds(Collection<Serializable> ids)
public List<T> getByIds(com.mongodb.client.ClientSession clientSession, Collection<Serializable> ids)
public List<T> getByColumn(SFunction<T,Object> field, Object fieldValue)
IServicegetByColumn 在接口中 IService<T>field - 字段fieldValue - 字段值public List<T> getByColumn(com.mongodb.client.ClientSession clientSession, SFunction<T,Object> field, Object fieldValue)
getByColumn 在接口中 IService<T>public List<T> getByColumn(String field, Object fieldValue)
IServicegetByColumn 在接口中 IService<T>field - 字段fieldValue - 字段值public List<T> getByColumn(com.mongodb.client.ClientSession clientSession, String field, Object fieldValue)
getByColumn 在接口中 IService<T>public String createIndex(com.mongodb.client.ClientSession clientSession, org.bson.conversions.Bson bson)
IServicecreateIndex 在接口中 IService<T>bson - 描述索引键的对象,该对象不能为 nullpublic String createIndex(org.bson.conversions.Bson bson)
IServicecreateIndex 在接口中 IService<T>bson - 描述索引键的对象,该对象不能为 nullpublic String createIndex(com.mongodb.client.ClientSession clientSession, org.bson.conversions.Bson bson, com.mongodb.client.model.IndexOptions indexOptions)
IServicecreateIndex 在接口中 IService<T>clientSession - 要与此操作关联的客户端会话bson - 描述索引键的对象,该对象不能为 nullindexOptions - 指数的选项public String createIndex(org.bson.conversions.Bson bson, com.mongodb.client.model.IndexOptions indexOptions)
IServicecreateIndex 在接口中 IService<T>bson - 描述索引键的对象,该对象不能为 nullindexOptions - 指数的选项public List<String> createIndexes(List<com.mongodb.client.model.IndexModel> indexes)
IServicecreateIndexes 在接口中 IService<T>indexes - 索引列表public List<String> createIndexes(List<com.mongodb.client.model.IndexModel> indexes, com.mongodb.client.model.CreateIndexOptions createIndexOptions)
IServicecreateIndexes 在接口中 IService<T>indexes - 索引列表createIndexOptions - 创建索引时要使用的选项public List<String> createIndexes(com.mongodb.client.ClientSession clientSession, List<com.mongodb.client.model.IndexModel> indexes)
IServicecreateIndexes 在接口中 IService<T>clientSession - 要与此操作关联的客户端会话indexes - 索引列表public List<String> createIndexes(com.mongodb.client.ClientSession clientSession, List<com.mongodb.client.model.IndexModel> indexes, com.mongodb.client.model.CreateIndexOptions createIndexOptions)
IServicecreateIndexes 在接口中 IService<T>clientSession - 要与此操作关联的客户端会话indexes - 索引列表createIndexOptions - 创建索引时要使用的选项public List<org.bson.Document> listIndexes()
IServicelistIndexes 在接口中 IService<T>public List<org.bson.Document> listIndexes(com.mongodb.client.ClientSession clientSession)
IServicelistIndexes 在接口中 IService<T>clientSession - 要与此操作关联的客户端会话public void dropIndex(String indexName, com.mongodb.client.model.DropIndexOptions dropIndexOptions)
IServicepublic void dropIndex(org.bson.conversions.Bson keys)
IServicepublic void dropIndex(org.bson.conversions.Bson keys,
com.mongodb.client.model.DropIndexOptions dropIndexOptions)
IServicepublic void dropIndex(com.mongodb.client.ClientSession clientSession,
String indexName)
IServicepublic void dropIndex(com.mongodb.client.ClientSession clientSession,
org.bson.conversions.Bson keys)
IServicepublic void dropIndex(com.mongodb.client.ClientSession clientSession,
String indexName,
com.mongodb.client.model.DropIndexOptions dropIndexOptions)
IServicepublic void dropIndex(com.mongodb.client.ClientSession clientSession,
org.bson.conversions.Bson keys,
com.mongodb.client.model.DropIndexOptions dropIndexOptions)
IServicepublic void dropIndexes()
IServicedropIndexes 在接口中 IService<T>public void dropIndexes(com.mongodb.client.ClientSession clientSession)
IServicedropIndexes 在接口中 IService<T>clientSession - 要与此操作关联的客户端会话public void dropIndexes(com.mongodb.client.model.DropIndexOptions dropIndexOptions)
IServicedropIndexes 在接口中 IService<T>dropIndexOptions - 删除索引时要使用的选项public void dropIndexes(com.mongodb.client.ClientSession clientSession,
com.mongodb.client.model.DropIndexOptions dropIndexOptions)
IServicedropIndexes 在接口中 IService<T>clientSession - 要与此操作关联的客户端会话dropIndexOptions - 删除索引时要使用的选项public SqlExecute getSqlOperation()
getSqlOperation 在接口中 IService<T>public LambdaQueryChainWrapper<T> lambdaQuery()
lambdaQuery 在接口中 IService<T>public LambdaAggregateChainWrapper<T> lambdaAggregate()
lambdaAggregate 在接口中 IService<T>public LambdaUpdateChainWrapper<T> lambdaUpdate()
lambdaUpdate 在接口中 IService<T>Copyright © 2023. All rights reserved.