后端
傲雪当歌
这个作者很懒,什么都没留下…
展开
-
spring-security(登录)
pom文件 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>o原创 2021-01-22 12:10:11 · 122 阅读 · 1 评论 -
spring-data-jpa(单表复杂查询)
上一篇:多表联查和新增——多对多 在customer表里新增四条数据 求得以下查询结果 select * from customer where name like '%a%' and cust_id < 12 在服务实现层 @Override public Page findBySpecification() { Specification specification = new Specification() { @SneakyThrows原创 2020-12-28 20:54:18 · 450 阅读 · 0 评论 -
spring-data-jpa(多表联查和新增——多对多)
上一篇:多表联查和新增——一对多 新建实体类 @Entity @Table(name = "role") public class Role { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "role_id") private Long roleId; @Column(name = "role_name") private String roleName;原创 2020-12-28 20:43:20 · 607 阅读 · 0 评论 -
spring-data-jpa(多表联查和新增——一对多)
上一篇:分页、排序 创建实体类(一对多中多的一方) @Entity @Table(name = "link_man") public class LinkMan { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "lkm_id") private Long lkmId; public Long getLkmId() { return lkmId; }原创 2020-12-28 20:32:21 · 977 阅读 · 0 评论 -
spring-data-jpa(分页、排序、分组)
参考单表增删改查 插入四条数据 服务实现层 每页两条数据,第一页,按name倒序排序 @Override public Page findBySpecification() { Specification specification = new Specification() { @SneakyThrows @Override public Predicate toPredicate(Root root原创 2020-12-28 20:03:40 · 1423 阅读 · 1 评论 -
spring-data-jpa(单表增删改查)
请先参考建表 dao层 import com.example.demo.entity.Customer; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; public interface CustomerDao extends JpaRepository<Customer,Lon原创 2020-12-28 19:52:12 · 326 阅读 · 0 评论 -
spring-data-jpa(创建数据库表)
建表 实体类 @Entity @Table(name = "customer") @JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"}) public class Customer { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "cust_id") private Long custId;.原创 2020-12-28 19:39:38 · 529 阅读 · 2 评论 -
将一维json数组变为二维json数组
@RequestMapping("/getCustomers") public List getCustomers() { List<Customer> customers = new ArrayList(); customers.add(new Customer("male", "Amy", "China")); customers.add(new Customer("female", "Tom", "England")); ..原创 2020-08-04 17:04:09 · 501 阅读 · 0 评论