mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 15:55:18 +08:00
bugfix
This commit is contained in:
@@ -19,6 +19,8 @@ import jakarta.persistence.criteria.Predicate;
|
||||
import jakarta.persistence.criteria.Root;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.hibernate.Cache;
|
||||
import org.hibernate.Session;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.convert.ConversionService;
|
||||
import org.springframework.data.domain.Page;
|
||||
@@ -61,8 +63,9 @@ public class ResourceService extends BaseService<ResourceEntity, ResourceReposit
|
||||
ResourceEntity entity = mapper.toEntity(request);
|
||||
|
||||
|
||||
|
||||
this.repository.save(entity);
|
||||
entityManager.unwrap(Session.class).getSessionFactory().getCache().evictCollectionData("cn.lihongjie.coal.resource.entity.ResourceEntity.children");
|
||||
|
||||
return getById(entity.getId());
|
||||
|
||||
}
|
||||
@@ -73,15 +76,22 @@ public class ResourceService extends BaseService<ResourceEntity, ResourceReposit
|
||||
this.mapper.updateEntity(entity, request);
|
||||
|
||||
this.repository.save(entity);
|
||||
entityManager.unwrap(Session.class).getSessionFactory().getCache().evictCollectionData("cn.lihongjie.coal.resource.entity.ResourceEntity.children");
|
||||
|
||||
return getById(entity.getId());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void delete(IdRequest request) {
|
||||
|
||||
this.repository.deleteAllById(request.getIds());
|
||||
|
||||
Cache cache = entityManager.unwrap(Session.class).getSessionFactory().getCache();
|
||||
cache.evictCollectionData("cn.lihongjie.coal.resource.entity.ResourceEntity.children");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user