首页>代码>Spring Boot整合Spring Data JPA实现H2数据库的数据初始化和控制台连接、查看功能>/h2-webconsole/src/main/java/com/memorynotfound/springboot/Book.java
package com.memorynotfound.springboot; import javax.persistence.*; @Entity @Table(name = "tbl_book") public class Book { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private Double price; public Book() { } public Book(String name, Double price) { this.name = name; this.price = price; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Double getPrice() { return price; } public void setPrice(Double price) { this.price = price; } @Override public String toString() { return "Book{" + "id=" + id + ", name='" + name + '\'' + ", price=" + price + '}'; } }
