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

缓存bug修复

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