|
@@ -31,6 +31,8 @@ import com.baomidou.mybatisplus.extension.service.additional.update.impl.LambdaU
|
|
|
import com.baomidou.mybatisplus.extension.service.additional.update.impl.UpdateChainWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
|
|
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
* 顶级 Service
|
|
@@ -57,6 +59,7 @@ public interface IService<T> {
|
|
|
*
|
|
|
* @param entityList 实体对象集合
|
|
|
*/
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
default boolean saveBatch(Collection<T> entityList) {
|
|
|
return saveBatch(entityList, 1000);
|
|
|
}
|
|
@@ -78,6 +81,7 @@ public interface IService<T> {
|
|
|
*
|
|
|
* @param entityList 实体对象集合
|
|
|
*/
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
default boolean saveOrUpdateBatch(Collection<T> entityList) {
|
|
|
return saveOrUpdateBatch(entityList, 1000);
|
|
|
}
|
|
@@ -165,6 +169,7 @@ public interface IService<T> {
|
|
|
*
|
|
|
* @param entityList 实体对象集合
|
|
|
*/
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
default boolean updateBatchById(Collection<T> entityList) {
|
|
|
return updateBatchById(entityList, 1000);
|
|
|
}
|