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 + '\'' +
                '}';
    }
}

posted @ 2020-03-26 12:39  两小无猜  阅读(174)  评论(0编辑  收藏  举报