后端
傲雪当歌
这个作者很懒,什么都没留下…
展开
-
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 · 162 阅读 · 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 · 493 阅读 · 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 · 655 阅读 · 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 · 1023 阅读 · 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 · 1505 阅读 · 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 · 343 阅读 · 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 · 568 阅读 · 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 · 524 阅读 · 0 评论