package com.uas.search.model;

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

/**
 * PCB
 *
 * @author sunyj
 * @since 2018/4/25 17:24
 */
@Entity
@Table(name = "product$pcb")
public class PCB implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @Id
    @Column(name = "pcb_id")
    private Long id;

    /**
     * 品牌
     */
    @ManyToOne
    @JoinColumn(name = "pcb_brandid", insertable = false, updatable = false)
    private Brand brand;

    /**
     * 类目
     */
    @ManyToOne
    @JoinColumn(name = "pcb_kindid", insertable = false, updatable = false)
    private Kind kind;

    /**
     * 物料
     */
    @OneToOne
    @JoinColumn(name = "pcb_productid", insertable = false, updatable = false)
    private Products products;

    public Long getId() {
        return id;
    }

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

    public Brand getBrand() {
        return brand;
    }

    public void setBrand(Brand brand) {
        this.brand = brand;
    }

    public Kind getKind() {
        return kind;
    }

    public void setKind(Kind kind) {
        this.kind = kind;
    }

    public Products getProducts() {
        return products;
    }

    public void setProducts(Products products) {
        this.products = products;
    }

    @Override
    public String toString() {
        return "PCB{" +
                "id=" + id +
                ", brand=" + brand +
                ", kind=" + kind +
                ", products=" + products +
                '}';
    }
}
