Skip to content

Commit

Permalink
Remove spring cache for dao (#15184)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanwenjun committed Nov 24, 2023
1 parent 9c7ad6d commit 1d23e4f
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 418 deletions.
42 changes: 0 additions & 42 deletions docs/docs/en/architecture/cache.md

This file was deleted.

42 changes: 0 additions & 42 deletions docs/docs/zh/architecture/cache.md

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,12 @@
import java.util.List;
import java.util.Map;

import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;

/**
* process definition mapper interface
*/
@CacheConfig(cacheNames = "processDefinition", keyGenerator = "cacheKeyGenerator")
public interface ProcessDefinitionMapper extends BaseMapper<ProcessDefinition> {

/**
Expand All @@ -47,13 +42,11 @@ public interface ProcessDefinitionMapper extends BaseMapper<ProcessDefinition> {
* @param code code
* @return process definition
*/
@Cacheable(sync = true)
ProcessDefinition queryByCode(@Param("code") long code);

/**
* update
*/
@CacheEvict(key = "#p0.code")
int updateById(@Param("et") ProcessDefinition processDefinition);

/**
Expand All @@ -62,7 +55,6 @@ public interface ProcessDefinitionMapper extends BaseMapper<ProcessDefinition> {
* @param code code
* @return delete result
*/
@CacheEvict
int deleteByCode(@Param("code") long code);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,12 @@
import java.util.List;
import java.util.Map;

import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;

/**
* process task relation mapper interface
*/
@CacheConfig(cacheNames = "processTaskRelation", keyGenerator = "cacheKeyGenerator")
public interface ProcessTaskRelationMapper extends BaseMapper<ProcessTaskRelation> {

/**
Expand All @@ -44,13 +39,11 @@ public interface ProcessTaskRelationMapper extends BaseMapper<ProcessTaskRelatio
* @param processCode processCode
* @return ProcessTaskRelation list
*/
@Cacheable(unless = "#result == null || #result.size() == 0")
List<ProcessTaskRelation> queryByProcessCode(@Param("processCode") long processCode);

/**
* update
*/
@CacheEvict(key = "#p0.projectCode + '_' + #p0.processDefinitionCode")
int updateById(@Param("et") ProcessTaskRelation processTaskRelation);

/**
Expand All @@ -60,7 +53,6 @@ public interface ProcessTaskRelationMapper extends BaseMapper<ProcessTaskRelatio
* @param processCode processCode
* @return int
*/
@CacheEvict
int deleteByCode(@Param("projectCode") long projectCode, @Param("processCode") long processCode);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,16 @@

import java.util.List;

import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;

/**
* scheduler mapper interface
*/
@CacheConfig(cacheNames = "schedule", keyGenerator = "cacheKeyGenerator")
public interface ScheduleMapper extends BaseMapper<Schedule> {

@CacheEvict(key = "#p0.processDefinitionCode")
int insert(Schedule entity);

@CacheEvict(key = "#p0.processDefinitionCode")
int updateById(@Param("et") Schedule entity);

/**
Expand All @@ -48,7 +41,6 @@ public interface ScheduleMapper extends BaseMapper<Schedule> {
* @param processDefinitionCode processDefinitionCode
* @return schedule list
*/
@Cacheable(sync = true)
List<Schedule> queryReleaseSchedulerListByProcessDefinitionCode(@Param("processDefinitionCode") long processDefinitionCode);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,13 @@
import java.util.List;
import java.util.Set;

import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
* task definition log mapper interface
*/
@CacheConfig(cacheNames = "taskDefinition", keyGenerator = "cacheKeyGenerator")
public interface TaskDefinitionLogMapper extends BaseMapper<TaskDefinitionLog> {

/**
Expand All @@ -47,13 +42,11 @@ public interface TaskDefinitionLogMapper extends BaseMapper<TaskDefinitionLog> {
* @param version version
* @return task definition log
*/
@Cacheable(sync = true)
TaskDefinitionLog queryByDefinitionCodeAndVersion(@Param("code") long code, @Param("version") int version);

/**
* update
*/
@CacheEvict(key = "#p0.code + '_' + #p0.version")
int updateById(@Param("et") TaskDefinitionLog taskDefinitionLog);

/**
Expand All @@ -63,7 +56,6 @@ public interface TaskDefinitionLogMapper extends BaseMapper<TaskDefinitionLog> {
* @param version task definition version
* @return delete result
*/
@CacheEvict
int deleteByCodeAndVersion(@Param("code") long code, @Param("version") int version);

/**
Expand Down
Loading

0 comments on commit 1d23e4f

Please sign in to comment.