@Test public void deleteResource() { }
@Override @Transactional(rollbackFor = Exception.class, timeout = 60, propagation = Propagation.REQUIRED) public void deleteResource(Long[] ids) { for (Long i : ids) { List<Permission> permissions = this.permissionRepository.findByResourceId(i); if (!permissions.isEmpty()) { this.permissionRepository.deleteAll(permissions); } List<Resources> resources = this.resourcesRepository.findByParentId(i); if (!resources.isEmpty()) { this.resourcesRepository.deleteAll(resources); } this.resourcesRepository.deleteById(i); String optUserName = (String) SecurityUtils.getSubject().getPrincipal(); this.shiroEventListener.deleteResourceEvent(optUserName, ids); } }
ResourcesServiceImpl extends BaseServiceImpl<Resources> implements ResourcesService { @Override @Transactional(rollbackFor = Exception.class, timeout = 60, propagation = Propagation.REQUIRED) public void deleteResource(Long[] ids) { for (Long i : ids) { List<Permission> permissions = this.permissionRepository.findByResourceId(i); if (!permissions.isEmpty()) { this.permissionRepository.deleteAll(permissions); } List<Resources> resources = this.resourcesRepository.findByParentId(i); if (!resources.isEmpty()) { this.resourcesRepository.deleteAll(resources); } this.resourcesRepository.deleteById(i); String optUserName = (String) SecurityUtils.getSubject().getPrincipal(); this.shiroEventListener.deleteResourceEvent(optUserName, ids); } } }
ResourcesServiceImpl extends BaseServiceImpl<Resources> implements ResourcesService { @Override @Transactional(rollbackFor = Exception.class, timeout = 60, propagation = Propagation.REQUIRED) public void deleteResource(Long[] ids) { for (Long i : ids) { List<Permission> permissions = this.permissionRepository.findByResourceId(i); if (!permissions.isEmpty()) { this.permissionRepository.deleteAll(permissions); } List<Resources> resources = this.resourcesRepository.findByParentId(i); if (!resources.isEmpty()) { this.resourcesRepository.deleteAll(resources); } this.resourcesRepository.deleteById(i); String optUserName = (String) SecurityUtils.getSubject().getPrincipal(); this.shiroEventListener.deleteResourceEvent(optUserName, ids); } }  }
ResourcesServiceImpl extends BaseServiceImpl<Resources> implements ResourcesService { @Override @Transactional(rollbackFor = Exception.class, timeout = 60, propagation = Propagation.REQUIRED) public void deleteResource(Long[] ids) { for (Long i : ids) { List<Permission> permissions = this.permissionRepository.findByResourceId(i); if (!permissions.isEmpty()) { this.permissionRepository.deleteAll(permissions); } List<Resources> resources = this.resourcesRepository.findByParentId(i); if (!resources.isEmpty()) { this.resourcesRepository.deleteAll(resources); } this.resourcesRepository.deleteById(i); String optUserName = (String) SecurityUtils.getSubject().getPrincipal(); this.shiroEventListener.deleteResourceEvent(optUserName, ids); } }  @Override List<Resources> findByResourceType(String resourcesType); @Override Collection<PermissionBo> getUserResources(String username); @Override Resources findById(Long id); @Override Page<Resources> findByParentId(Pageable pageable, Long parentId); @Override @Transactional(rollbackFor = Exception.class, timeout = 60, propagation = Propagation.REQUIRED) void deleteResource(Long[] ids); }
ResourcesServiceImpl extends BaseServiceImpl<Resources> implements ResourcesService { @Override @Transactional(rollbackFor = Exception.class, timeout = 60, propagation = Propagation.REQUIRED) public void deleteResource(Long[] ids) { for (Long i : ids) { List<Permission> permissions = this.permissionRepository.findByResourceId(i); if (!permissions.isEmpty()) { this.permissionRepository.deleteAll(permissions); } List<Resources> resources = this.resourcesRepository.findByParentId(i); if (!resources.isEmpty()) { this.resourcesRepository.deleteAll(resources); } this.resourcesRepository.deleteById(i); String optUserName = (String) SecurityUtils.getSubject().getPrincipal(); this.shiroEventListener.deleteResourceEvent(optUserName, ids); } }  @Override List<Resources> findByResourceType(String resourcesType); @Override Collection<PermissionBo> getUserResources(String username); @Override Resources findById(Long id); @Override Page<Resources> findByParentId(Pageable pageable, Long parentId); @Override @Transactional(rollbackFor = Exception.class, timeout = 60, propagation = Propagation.REQUIRED) void deleteResource(Long[] ids);  }