| 限定符和类型 | 字段和说明 |
|---|---|
protected M |
baseMapper |
protected java.lang.Class<?> |
entityClass |
protected org.apache.ibatis.logging.Log |
log |
protected java.lang.Class<?> |
mapperClass |
DEFAULT_BATCH_SIZE| 构造器和说明 |
|---|
ServiceImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
closeSqlSession(org.apache.ibatis.session.SqlSession sqlSession)
已过时。
3.3.0
|
protected java.lang.Class<T> |
currentMapperClass() |
protected java.lang.Class<T> |
currentModelClass() |
protected <E> boolean |
executeBatch(java.util.Collection<E> list,
java.util.function.BiConsumer<org.apache.ibatis.session.SqlSession,E> consumer)
执行批量操作(默认批次提交数量
IService.DEFAULT_BATCH_SIZE) |
protected <E> boolean |
executeBatch(java.util.Collection<E> list,
int batchSize,
java.util.function.BiConsumer<org.apache.ibatis.session.SqlSession,E> consumer)
执行批量操作
|
protected boolean |
executeBatch(java.util.function.Consumer<org.apache.ibatis.session.SqlSession> consumer)
已过时。
3.3.1 后面我打算移除掉
executeBatch(Collection, int, BiConsumer) }. |
M |
getBaseMapper()
获取对应 entity 的 BaseMapper
|
java.util.Map<java.lang.String,java.lang.Object> |
getMap(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper)
根据 Wrapper,查询一条记录
|
<V> V |
getObj(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper,
java.util.function.Function<? super java.lang.Object,V> mapper)
根据 Wrapper,查询一条记录
|
T |
getOne(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper,
boolean throwEx)
根据 Wrapper,查询一条记录
|
protected java.lang.String |
getSqlStatement(com.baomidou.mybatisplus.core.enums.SqlMethod sqlMethod)
获取mapperStatementId
|
protected boolean |
retBool(java.lang.Integer result)
已过时。
3.3.1
|
boolean |
saveBatch(java.util.Collection<T> entityList,
int batchSize)
批量插入
|
boolean |
saveOrUpdate(T entity)
TableId 注解存在更新记录,否插入一条记录
|
boolean |
saveOrUpdateBatch(java.util.Collection<T> entityList,
int batchSize)
批量修改插入
|
protected org.apache.ibatis.session.SqlSession |
sqlSessionBatch()
已过时。
3.3.0
|
protected java.lang.String |
sqlStatement(com.baomidou.mybatisplus.core.enums.SqlMethod sqlMethod)
已过时。
3.4.0
|
boolean |
updateBatchById(java.util.Collection<T> entityList,
int batchSize)
根据ID 批量更新
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcount, count, getById, getOne, lambdaQuery, lambdaUpdate, list, list, listByIds, listByMap, listMaps, listMaps, listObjs, listObjs, listObjs, listObjs, page, page, pageMaps, pageMaps, query, remove, removeById, removeByIds, removeByMap, save, saveBatch, saveOrUpdate, saveOrUpdateBatch, update, update, update, updateBatchById, updateByIdprotected org.apache.ibatis.logging.Log log
@Autowired protected M extends com.baomidou.mybatisplus.core.mapper.BaseMapper<T> baseMapper
protected java.lang.Class<?> entityClass
protected java.lang.Class<?> mapperClass
public M getBaseMapper()
IServicegetBaseMapper 在接口中 IService<T>@Deprecated protected boolean retBool(java.lang.Integer result)
result - 数据库操作返回影响条数protected java.lang.Class<T> currentMapperClass()
protected java.lang.Class<T> currentModelClass()
@Deprecated protected org.apache.ibatis.session.SqlSession sqlSessionBatch()
@Deprecated protected void closeSqlSession(org.apache.ibatis.session.SqlSession sqlSession)
sqlSession - session@Deprecated protected java.lang.String sqlStatement(com.baomidou.mybatisplus.core.enums.SqlMethod sqlMethod)
sqlMethod - ignoregetSqlStatement(SqlMethod)@Transactional(rollbackFor=java.lang.Exception.class) public boolean saveBatch(java.util.Collection<T> entityList, int batchSize)
protected java.lang.String getSqlStatement(com.baomidou.mybatisplus.core.enums.SqlMethod sqlMethod)
sqlMethod - 方法名@Transactional(rollbackFor=java.lang.Exception.class) public boolean saveOrUpdate(T entity)
saveOrUpdate 在接口中 IService<T>entity - 实体对象@Transactional(rollbackFor=java.lang.Exception.class) public boolean saveOrUpdateBatch(java.util.Collection<T> entityList, int batchSize)
IServicesaveOrUpdateBatch 在接口中 IService<T>entityList - 实体对象集合batchSize - 每次的数量@Transactional(rollbackFor=java.lang.Exception.class) public boolean updateBatchById(java.util.Collection<T> entityList, int batchSize)
IServiceupdateBatchById 在接口中 IService<T>entityList - 实体对象集合batchSize - 更新批次数量public T getOne(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper, boolean throwEx)
IServicepublic java.util.Map<java.lang.String,java.lang.Object> getMap(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper)
IServicepublic <V> V getObj(com.baomidou.mybatisplus.core.conditions.Wrapper<T> queryWrapper, java.util.function.Function<? super java.lang.Object,V> mapper)
IService@Deprecated protected boolean executeBatch(java.util.function.Consumer<org.apache.ibatis.session.SqlSession> consumer)
executeBatch(Collection, int, BiConsumer) }.consumer - consumerprotected <E> boolean executeBatch(java.util.Collection<E> list,
int batchSize,
java.util.function.BiConsumer<org.apache.ibatis.session.SqlSession,E> consumer)
E - 泛型list - 数据集合batchSize - 批量大小consumer - 执行方法protected <E> boolean executeBatch(java.util.Collection<E> list,
java.util.function.BiConsumer<org.apache.ibatis.session.SqlSession,E> consumer)
IService.DEFAULT_BATCH_SIZE)E - 泛型list - 数据集合consumer - 执行方法