package com.huigou.topsun.product.domain;

import java.io.Serializable;
import javax.persistence.*;

import lombok.Data;

/**
 * 产品详细信息
 * @TableName product_detail
 */
@Table(name="product_detail")
@Data
@Entity
public class ProductDetail implements Serializable {
    /**
     * 产品详细信息ID
     */
    @Id
    @Column(name = "product_detail_id")
    private String productDetailId;

    /**
     * 产品ID
     */
    @Column(name = "product_id")
    private Long productId;

    /**
     * 工厂名称
     */
    @Column(name = "factory_name")
    private String factoryName;

    /**
     * 版面(product_layout)
     */
    @Column(name = "product_layout")
    private String productLayout;

    /**
     * 英文名
     */
    @Column(name = "product_english_name")
    private String productEnglishName;

    /**
     * 产品简称
     */
    @Column(name = "product_short_name")
    private String productShortName;

    /**
     * 产品背面ID
     */
    @Column(name = "back_product_face_id")
    private String backProductFaceId;

    /**
     * 产品正面ID
     */
    @Column(name = "right_product_face_id")
    private String rightProductFaceId;

    /**
     * 产品承印物
     */
    @Column(name = "product_substrate")
    private String productSubstrate;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ProductDetail other = (ProductDetail) that;
        return (this.getProductDetailId() == null ? other.getProductDetailId() == null : this.getProductDetailId().equals(other.getProductDetailId()))
            && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
            && (this.getFactoryName() == null ? other.getFactoryName() == null : this.getFactoryName().equals(other.getFactoryName()))
            && (this.getProductLayout() == null ? other.getProductLayout() == null : this.getProductLayout().equals(other.getProductLayout()))
            && (this.getProductEnglishName() == null ? other.getProductEnglishName() == null : this.getProductEnglishName().equals(other.getProductEnglishName()))
            && (this.getProductShortName() == null ? other.getProductShortName() == null : this.getProductShortName().equals(other.getProductShortName()))
            && (this.getBackProductFaceId() == null ? other.getBackProductFaceId() == null : this.getBackProductFaceId().equals(other.getBackProductFaceId()))
            && (this.getRightProductFaceId() == null ? other.getRightProductFaceId() == null : this.getRightProductFaceId().equals(other.getRightProductFaceId()))
            && (this.getProductSubstrate() == null ? other.getProductSubstrate() == null : this.getProductSubstrate().equals(other.getProductSubstrate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getProductDetailId() == null) ? 0 : getProductDetailId().hashCode());
        result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
        result = prime * result + ((getFactoryName() == null) ? 0 : getFactoryName().hashCode());
        result = prime * result + ((getProductLayout() == null) ? 0 : getProductLayout().hashCode());
        result = prime * result + ((getProductEnglishName() == null) ? 0 : getProductEnglishName().hashCode());
        result = prime * result + ((getProductShortName() == null) ? 0 : getProductShortName().hashCode());
        result = prime * result + ((getBackProductFaceId() == null) ? 0 : getBackProductFaceId().hashCode());
        result = prime * result + ((getRightProductFaceId() == null) ? 0 : getRightProductFaceId().hashCode());
        result = prime * result + ((getProductSubstrate() == null) ? 0 : getProductSubstrate().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", productDetailId=").append(productDetailId);
        sb.append(", productId=").append(productId);
        sb.append(", factoryName=").append(factoryName);
        sb.append(", productLayout=").append(productLayout);
        sb.append(", productEnglishName=").append(productEnglishName);
        sb.append(", productShortName=").append(productShortName);
        sb.append(", backProductFaceId=").append(backProductFaceId);
        sb.append(", rightProductFaceId=").append(rightProductFaceId);
        sb.append(", productSubstrate=").append(productSubstrate);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}