/**
 * There are <a href="https://github.com/ketayao/keta-custom">keta-custom</a> code generation
 */
package com.sw.mes.grade.entity;

import com.sw.mes.gread.entity.GradeVersion;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;
import java.util.Date;

/**
 * @Author
 * @Description：
 * @Date: Create in
 * @Modified By:
 */
@Data
@Entity
@Table(name = "grade_fb_rule_test")
@DynamicUpdate
@DynamicInsert
public class RuleTest {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 评级版本
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "grade_version_id", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private GradeVersion gradeVersion;

    /**
     * 创建/修改人 - 测试人
     */
    @Column(length = 20)
    private String userUpdate;

    /**
     * 创建/修改时间 - 测试时间
     */
    @Column(length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date gmtUpdate;

    /**
     * 备注
     */
    @Column(length = 50)
    private String remarks;

    public RuleTest() {
    }

    public RuleTest(Long id) {
        this.id = id;
    }
}
