Spring+hibernate+JSP实现Piano的数据库操作---3.Piano实体类
package com.entity;
import org.springframework.stereotype.Component;
import javax.persistence.*;
@Component
@Entity
@Table(name = "piano")
public class Piano {
private int id;
private String brand;
private int price;
private String pic;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public String getPic() {
return pic;
}
public void setPic(String pic) {
this.pic = pic;
}
@Override
public String toString() {
return "Piano{" +
"id=" + id +
", brand='" + brand + '\'' +
", price=" + price +
", pic='" + pic + '\'' +
'}';
}
}
本文来自博客园,作者:两小无猜,转载请注明原文链接:https://www.cnblogs.com/charlottepl/p/12573625.html