提交 74c981f0 编写于 作者: ibiz4j's avatar ibiz4j

缓存bug修复

上级 0cdb4735
......@@ -30,40 +30,40 @@ public interface {{entity.codeName}}Mapper extends BaseMapper<{{entity.codeName}
{{/entity.dataSets}}
@Override
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@Cacheable(value = "{{lowerCase entity.codeName}}", key = "'row:'+#p0")
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
{{entity.codeName}} selectById(Serializable id);
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@Cacheable(value = "{{lowerCase entity.codeName}}", key = "'row:'+#p0.{{camelCase entity.keyField.codeName}}")
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
{{entity.codeName}} selectEntity({{entity.codeName}} entity);
List<{{entity.codeName}}> selectEntities(@Param("list") List<{{entity.codeName}}> list);
@Override
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", key = "'row:'+#p0.{{camelCase entity.keyField.codeName}}")
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
int insert({{entity.codeName}} entity);
@Override
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", key = "'row:'+#p0.{{camelCase entity.keyField.codeName}}")
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
int updateById(@Param(Constants.ENTITY) {{entity.codeName}} entity);
@Override
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", key = "'row:'+#p0.{{camelCase entity.keyField.codeName}}", condition ="#p0 != null")
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
int update(@Param(Constants.ENTITY) {{entity.codeName}} entity, @Param("ew") Wrapper<{{entity.codeName}}> updateWrapper);
@Override
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", key = "'row:'+#p0")
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
int deleteById(Serializable id);
/**
......
......@@ -53,44 +53,44 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
return IBaseService.super.onCreate(dto);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean update({{entity.codeName}} dto) throws Throwable {
return IBaseService.super.update(dto);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean onUpdate({{entity.codeName}} dto) throws Throwable {
return IBaseService.super.onUpdate(dto);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean remove({{entity.keyField.type.java}} key) throws Throwable {
return IBaseService.super.remove(key);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean onRemove({{entity.keyField.type.java}} key) throws Throwable {
return IBaseService.super.onRemove(key);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean remove(List keys) throws Throwable {
return IBaseService.super.remove(keys);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean onRemove(List keys) throws Throwable {
return IBaseService.super.onRemove(keys);
}
......@@ -119,16 +119,16 @@ public interface {{entity.codeName}}Service extends IBaseService<{{entity.codeNa
return IBaseService.super.onCheckKey(dto);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean save({{entity.codeName}} dto) throws Throwable {
return IBaseService.super.save(dto);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean onSave({{entity.codeName}} dto) throws Throwable {
return IBaseService.super.onSave(dto);
}
......
......@@ -54,44 +54,44 @@ public interface {{entity.codeName}}Service extends IMPService<{{entity.codeName
return IMPService.super.onCreate(dto);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean update({{entity.codeName}} dto) throws Throwable {
return IMPService.super.update(dto);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean onUpdate({{entity.codeName}} dto) throws Throwable {
return IMPService.super.onUpdate(dto);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean remove({{entity.keyField.type.java}} key) throws Throwable {
return IMPService.super.remove(key);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean onRemove({{entity.keyField.type.java}} key) throws Throwable {
return IMPService.super.onRemove(key);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean remove(List keys) throws Throwable {
return IMPService.super.remove(keys);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean onRemove(List keys) throws Throwable {
return IMPService.super.onRemove(keys);
}
......@@ -120,16 +120,16 @@ public interface {{entity.codeName}}Service extends IMPService<{{entity.codeName
return IMPService.super.onCheckKey(dto);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean save({{entity.codeName}} dto) throws Throwable {
return IMPService.super.save(dto);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean onSave({{entity.codeName}} dto) throws Throwable {
return IMPService.super.onSave(dto);
}
......
......@@ -53,44 +53,44 @@ public interface {{entity.codeName}}Service extends IServiceApiService<{{entity.
return IServiceApiService.super.onCreate(dto);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean update({{entity.codeName}} dto) throws Throwable {
return IServiceApiService.super.update(dto);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean onUpdate({{entity.codeName}} dto) throws Throwable {
return IServiceApiService.super.onUpdate(dto);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean remove({{entity.keyField.type.java}} key) throws Throwable {
return IServiceApiService.super.remove(key);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean onRemove({{entity.keyField.type.java}} key) throws Throwable {
return IServiceApiService.super.onRemove(key);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean remove(List keys) throws Throwable {
return IServiceApiService.super.remove(keys);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean onRemove(List keys) throws Throwable {
return IServiceApiService.super.onRemove(keys);
}
......@@ -119,16 +119,16 @@ public interface {{entity.codeName}}Service extends IServiceApiService<{{entity.
return IServiceApiService.super.onCheckKey(dto);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean save({{entity.codeName}} dto) throws Throwable {
return IServiceApiService.super.save(dto);
}
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean onSave({{entity.codeName}} dto) throws Throwable {
return IServiceApiService.super.onSave(dto);
}
......
......@@ -69,21 +69,21 @@ public interface {{entity.codeName}}FeignClient {
Integer checkKey({{entity.codeName}} et);
boolean create({{entity.codeName}} et);
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean createBatch(List<{{entity.codeName}}> list);
boolean update({{entity.codeName}} et);
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean updateBatch(List<{{entity.codeName}}> list);
boolean save({{entity.codeName}} et);
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean saveBatch(List<{{entity.codeName}}> list);
default boolean remove({{entity.keyField.type.java}} key) {
......@@ -96,9 +96,9 @@ public interface {{entity.codeName}}FeignClient {
}
boolean remove({{entity.codeName}} et);
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean removeBatch(Collection<{{entity.keyField.type.java}}> ids);
{{#each entity.extActions}}
......@@ -118,17 +118,17 @@ public interface {{entity.codeName}}FeignClient {
{{/entity.dataSets}}
{{#entity.references}}
List<{{entity.codeName}}> selectBy{{pascalCase fkField.codeName}}({{fkField.type.java}} {{camelCase fkField.codeName}});
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean removeBy{{pascalCase fkField.codeName}}({{fkField.type.java}} {{camelCase fkField.codeName}});
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean resetBy{{pascalCase fkField.codeName}}({{fkField.type.java}} {{camelCase fkField.codeName}});
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean saveBy{{pascalCase fkField.codeName}}({{fkField.type.java}} {{camelCase fkField.codeName}},List<{{entity.codeName}}> list);
{{/entity.references}}
......
......@@ -30,45 +30,45 @@ public interface {{entity.codeName}}Mapper extends BaseMapper<{{entity.codeName}
{{/entity.dataSets}}
@Override
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@Cacheable(value = "{{lowerCase entity.codeName}}", key = "'row:'+#p0")
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
{{entity.codeName}} selectById(Serializable id);
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@Cacheable(value = "{{lowerCase entity.codeName}}", key = "'row:'+#p0.{{camelCase entity.keyField.codeName}}")
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
{{entity.codeName}} selectEntity({{entity.codeName}} entity);
List<{{entity.codeName}}> selectEntities(@Param("list") List<{{entity.codeName}}> list);
@Override
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", key = "'row:'+#p0.{{camelCase entity.keyField.codeName}}")
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
int insert({{entity.codeName}} entity);
@Override
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", key = "'row:'+#p0.{{camelCase entity.keyField.codeName}}")
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
int updateById(@Param(Constants.ENTITY) {{entity.codeName}} entity);
@Override
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", key = "'row:'+#p0.{{camelCase entity.keyField.codeName}}", condition ="#p0 != null")
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
int update(@Param(Constants.ENTITY) {{entity.codeName}} entity, @Param("ew") Wrapper<{{entity.codeName}}> updateWrapper);
@Override
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", key = "'row:'+#p0")
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
int deleteById(Serializable id);
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
int deleteEntities(@Param("list") List<{{entity.codeName}}> list);
/**
......
......@@ -366,7 +366,7 @@ public class {{entity.codeName}}ServiceBase extends ServiceImpl<{{entity.codeNam
return this.update(new UpdateWrapper<{{entity.codeName}}>().set("{{lowerCase fkField.name}}",null).eq("{{lowerCase fkField.name}}",{{camelCase fkField.codeName}}));
}
public boolean saveBy{{pascalCase fkField.codeName}}({{entityCodeName}} {{camelCase entityCodeName}},List<{{entity.codeName}}> list) {
public boolean saveBy{{pascalCase codeName}}({{entityCodeName}} {{camelCase entityCodeName}},List<{{entity.codeName}}> list) {
if(list==null)
return true;
Set<{{entity.keyField.type.java}}> delIds=new HashSet<{{entity.keyField.type.java}}>();
......@@ -397,7 +397,19 @@ public class {{entity.codeName}}ServiceBase extends ServiceImpl<{{entity.codeNam
}
{{/entity.references}}
{{#each entity.nesteds}}
{{#if listCode}}
{{#unless columnName}}
public List<{{entityCodeName}}> get{{pascalCase codeName}}({{entity.codeName}} et) {
List<{{entityCodeName}}> list = {{camelCase codeName}}Service.selectBy{{pascalCase fkField.codeName}}(et.get{{pascalCase entity.keyField.codeName}}());
et.set{{pascalCase codeName}}(list);
return list;
}
{{/unless}}
{{/if}}
{{/each}}
{{#if entity.hasPSDEWF}}
@Autowired
......
......@@ -199,5 +199,16 @@ public class {{entity.codeName}}ServiceBase implements {{entity.codeName}}Servic
}
{{/entity.references}}
{{#each entity.nesteds}}
{{#if listCode}}
{{#unless columnName}}
public List<{{entityCodeName}}> get{{pascalCase codeName}}({{entity.codeName}} et) {
return null;
}
{{/unless}}
{{/if}}
{{/each}}
}
\ No newline at end of file
......@@ -21,6 +21,9 @@ import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.security.SpringContextHolder;
import {{packageName}}.core.{{entity.module}}.domain.{{entity.codeName}};
import {{packageName}}.core.{{entity.module}}.filter.{{entity.codeName}}SearchContext;
{{#entity.relEntities}}
import {{packageName}}.core.{{module}}.domain.{{codeName}};
{{/entity.relEntities}}
{{#dsName}}
@DS("{{entity.dataSource}}")
......@@ -53,21 +56,21 @@ public interface {{entity.codeName}}Service extends IService<{{entity.codeName}}
Integer checkKey({{entity.codeName}} et);
boolean create({{entity.codeName}} et);
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean createBatch(List<{{entity.codeName}}> list);
boolean update({{entity.codeName}} et);
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean updateBatch(List<{{entity.codeName}}> list);
boolean save({{entity.codeName}} et);
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean saveBatch(List<{{entity.codeName}}> list);
default boolean remove({{entity.keyField.type.java}} key) {
......@@ -78,6 +81,9 @@ public interface {{entity.codeName}}Service extends IService<{{entity.codeName}}
default boolean remove(List<{{entity.keyField.type.java}}> key) {
return removeBatch(key);
}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", key = "'row:'+#p0.{{camelCase entity.keyField.codeName}}")
{{/entity.enableEntityCache}}
boolean remove({{entity.codeName}} et);
default boolean removeBatch(Collection<{{entity.keyField.type.java}}> ids) {
......@@ -109,26 +115,34 @@ public interface {{entity.codeName}}Service extends IService<{{entity.codeName}}
{{/entity.dataSets}}
{{#entity.references}}
List<{{entity.codeName}}> selectBy{{pascalCase fkField.codeName}}({{fkField.type.java}} {{camelCase fkField.codeName}});
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean removeBy{{pascalCase fkField.codeName}}({{fkField.type.java}} {{camelCase fkField.codeName}});
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean resetBy{{pascalCase fkField.codeName}}({{fkField.type.java}} {{camelCase fkField.codeName}});
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
boolean saveBy{{pascalCase fkField.codeName}}({{packageName}}.core.{{module}}.domain.{{entityCodeName}} {{camelCase entityCodeName}},List<{{entity.codeName}}> list);
{{#enableEntityCache}}
{{/entity.enableEntityCache}}
boolean saveBy{{pascalCase codeName}}({{packageName}}.core.{{module}}.domain.{{entityCodeName}} {{camelCase entityCodeName}},List<{{entity.codeName}}> list);
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
default boolean saveBy{{pascalCase fkField.codeName}}({{fkField.type.java}} {{camelCase fkField.codeName}},List<{{entity.codeName}}> list) {
{{packageName}}.core.{{module}}.domain.{{entityCodeName}} et = new {{packageName}}.core.{{module}}.domain.{{entityCodeName}}();
et.set{{pascalCase relEntity.keyField.codeName}}({{camelCase fkField.codeName}});
return getSelf().saveBy{{pascalCase fkField.codeName}}(et,list);
return getSelf().saveBy{{pascalCase codeName}}(et,list);
}
{{/entity.references}}
{{#each entity.nesteds}}
{{#if listCode}}
{{#unless columnName}}
List<{{entityCodeName}}> get{{pascalCase codeName}}({{entity.codeName}} et);
{{/unless}}
{{/if}}
{{/each}}
}
\ No newline at end of file
......@@ -21,6 +21,9 @@ import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.security.SpringContextHolder;
import {{packageName}}.core.{{entity.module}}.domain.{{entity.codeName}};
import {{packageName}}.core.{{entity.module}}.filter.{{entity.codeName}}SearchContext;
{{#entity.relEntities}}
import {{packageName}}.core.{{module}}.domain.{{codeName}};
{{/entity.relEntities}}
{{#dsName}}
@DS("{{entity.dataSource}}")
......@@ -53,21 +56,21 @@ public interface {{entity.codeName}}Service {
Integer checkKey({{entity.codeName}} et);
boolean create({{entity.codeName}} et);
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean createBatch(List<{{entity.codeName}}> list);
boolean update({{entity.codeName}} et);
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean updateBatch(List<{{entity.codeName}}> list);
boolean save({{entity.codeName}} et);
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean saveBatch(List<{{entity.codeName}}> list);
default boolean remove({{entity.keyField.type.java}} key) {
......@@ -78,6 +81,9 @@ public interface {{entity.codeName}}Service {
default boolean remove(List<{{entity.keyField.type.java}}> key) {
return removeBatch(key);
}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", key = "'row:'+#p0.{{camelCase entity.keyField.codeName}}")
{{/entity.enableEntityCache}}
boolean remove({{entity.codeName}} et);
default boolean removeBatch(Collection<{{entity.keyField.type.java}}> ids) {
......@@ -109,18 +115,26 @@ public interface {{entity.codeName}}Service {
{{/entity.dataSets}}
{{#entity.references}}
List<{{entity.codeName}}> selectBy{{pascalCase fkField.codeName}}({{fkField.type.java}} {{camelCase fkField.codeName}});
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean removeBy{{pascalCase fkField.codeName}}({{fkField.type.java}} {{camelCase fkField.codeName}});
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean resetBy{{pascalCase fkField.codeName}}({{fkField.type.java}} {{camelCase fkField.codeName}});
{{#enableEntityCache}}
{{#entity.enableEntityCache}}
@CacheEvict(value = "{{lowerCase entity.codeName}}", allEntries = true)
{{/enableEntityCache}}
{{/entity.enableEntityCache}}
boolean saveBy{{pascalCase fkField.codeName}}({{fkField.type.java}} {{camelCase fkField.codeName}},List<{{entity.codeName}}> list);
{{/entity.references}}
{{#each entity.nesteds}}
{{#if listCode}}
{{#unless columnName}}
List<{{entityCodeName}}> get{{pascalCase codeName}}({{entity.codeName}} et);
{{/unless}}
{{/if}}
{{/each}}
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册