1 Star 16 Fork 15

Tison/springBoot JPA代码生成器

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
SysUserServiceImpl 2.20 KB
一键复制 编辑 原始数据 按行查看 历史
Tison 提交于 2019-07-20 01:04 . 更新 SysUserServiceImpl
package app.itw.sdd.service.impl;
import app.itw.sdd.repository.SysUserRepository;
import app.itw.sdd.service.SysUserService;
import app.itw.sdd.entity.SysUser;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.data.domain.*;
import java.util.Optional;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
@author Tison
*/
@Service
public class SysUserServiceImpl implements SysUserService {
@Resource
private SysUserRepository rep;
public SysUser save(SysUser obj) {
return rep.save(obj);
}
@Transactional
public List<SysUser> saveAll(Iterable<SysUser> list) {
return rep.saveAll(list);
}
public SysUser getOne(Long id) {
return rep.getOne(id);
}
public SysUser findById(Long id) {
Optional<SysUser> obj = rep.findById(id);
return obj.isPresent()?obj.get():null;
}
public void deleteById(Long id) {
rep.deleteById(id);
}
@Transactional
public void deleteAll(List list) {
rep.deleteAll(list);
}
public void delete(SysUser obj) {
rep.delete(obj);
}
public boolean existsById(Long id) {
return rep.existsById(id);
}
public long count() {
return rep.count();
}
public List<SysUser> findAll() {
return rep.findAll();
}
public List<SysUser> findAll(SysUser obj) {
List<SysUser> list = rep.findAll(Example.of(obj));
return list==null||list.size()<1?null:list;
}
public List<SysUser> findAll(Sort sort) {
return rep.findAll(sort);
}
public List<SysUser> findAllById(Iterable<Long> ids) {
return rep.findAllById(ids);
}
public List<SysUser> findAll(Example<SysUser> e) {
return rep.findAll(e);
}
public List<SysUser> findAll(Example<SysUser> e, Sort sort) {
return rep.findAll(e,sort);
}
public Page<SysUser> findAll(Pageable page) {
return rep.findAll(page);
}
public Page<SysUser> findAll(Example<SysUser> e, Pageable page) {
return rep.findAll(e,page);
}
public Page<SysUser> findAll(SysUser obj, Pageable page) {
return rep.findAll(Example.of(obj),page);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/xietingsheng/springbootjpadaimachengqi.git
[email protected]:xietingsheng/springbootjpadaimachengqi.git
xietingsheng
springbootjpadaimachengqi
springBoot JPA代码生成器
master

搜索帮助