package com.xkrs.model.entity;

import javax.persistence.*;

/**
 * @Author: XinYi Song
 * @Date: 2021/12/15 11:18
 */
@Entity
@Table(name="product_cover")
public class ProductCoverEntity {
    /**
     * 指定主键，建立自增序列，主键值取自序列
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    //@SequenceGenerator(name = "product_cover_seq_gen", sequenceName = "product_cover_id_seq",allocationSize = 1)
    private Integer id;

    /**
     * 商品封面图片
     */
    private String productCoverPhoto;

    /**
     * 商品id
     */
    private Integer productId;

    public ProductCoverEntity() {
    }

    public ProductCoverEntity(Integer id, String productCoverPhoto, Integer productId) {
        this.id = id;
        this.productCoverPhoto = productCoverPhoto;
        this.productId = productId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getProductCoverPhoto() {
        return productCoverPhoto;
    }

    public void setProductCoverPhoto(String productCoverPhoto) {
        this.productCoverPhoto = productCoverPhoto;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    @Override
    public String toString() {
        return "ProductCoverEntity{" +
                "id=" + id +
                ", productCoverPhoto='" + productCoverPhoto + '\'' +
                ", productId=" + productId +
                '}';
    }
}
