package com.mossle.plm.persistence.domain;

// Generated by Hibernate Tools
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * PlmRequirement .
 * 
 * @author Lingo
 */
@Entity
@Table(name = "PLM_REQUIREMENT")
public class PlmRequirement implements java.io.Serializable {
    private static final long serialVersionUID = 0L;

    /** null. */
    private Long id;

    /** null. */
    private PlmProject plmProject;

    /** null. */
    private PlmVersion plmVersion;

    /** null. */
    private PlmRequirement plmRequirement;

    /** null. */
    private PlmIssue plmIssue;

    /** null. */
    private String name;

    /** null. */
    private Integer priority;

    /** null. */
    private String tag;

    /** null. */
    private String status;

    /** null. */
    private Date createTime;

    /** null. */
    private String userId;

    /** . */
    private Set<PlmRequirement> plmRequirements = new HashSet<PlmRequirement>(0);

    public PlmRequirement() {
    }

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

    public PlmRequirement(Long id, PlmProject plmProject,
            PlmVersion plmVersion, PlmRequirement plmRequirement,
            PlmIssue plmIssue, String name, Integer priority, String tag,
            String status, Date createTime, String userId,
            Set<PlmRequirement> plmRequirements) {
        this.id = id;
        this.plmProject = plmProject;
        this.plmVersion = plmVersion;
        this.plmRequirement = plmRequirement;
        this.plmIssue = plmIssue;
        this.name = name;
        this.priority = priority;
        this.tag = tag;
        this.status = status;
        this.createTime = createTime;
        this.userId = userId;
        this.plmRequirements = plmRequirements;
    }

    /** @return null. */
    @Id
    @Column(name = "ID", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    /**
     * @param id
     *            null.
     */
    public void setId(Long id) {
        this.id = id;
    }

    /** @return null. */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PROJECT_ID")
    public PlmProject getPlmProject() {
        return this.plmProject;
    }

    /**
     * @param plmProject
     *            null.
     */
    public void setPlmProject(PlmProject plmProject) {
        this.plmProject = plmProject;
    }

    /** @return null. */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "VERSION_ID")
    public PlmVersion getPlmVersion() {
        return this.plmVersion;
    }

    /**
     * @param plmVersion
     *            null.
     */
    public void setPlmVersion(PlmVersion plmVersion) {
        this.plmVersion = plmVersion;
    }

    /** @return null. */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PARENT_ID")
    public PlmRequirement getPlmRequirement() {
        return this.plmRequirement;
    }

    /**
     * @param plmRequirement
     *            null.
     */
    public void setPlmRequirement(PlmRequirement plmRequirement) {
        this.plmRequirement = plmRequirement;
    }

    /** @return null. */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ISSUE_ID")
    public PlmIssue getPlmIssue() {
        return this.plmIssue;
    }

    /**
     * @param plmIssue
     *            null.
     */
    public void setPlmIssue(PlmIssue plmIssue) {
        this.plmIssue = plmIssue;
    }

    /** @return null. */
    @Column(name = "NAME", length = 200)
    public String getName() {
        return this.name;
    }

    /**
     * @param name
     *            null.
     */
    public void setName(String name) {
        this.name = name;
    }

    /** @return null. */
    @Column(name = "PRIORITY")
    public Integer getPriority() {
        return this.priority;
    }

    /**
     * @param priority
     *            null.
     */
    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    /** @return null. */
    @Column(name = "TAG", length = 200)
    public String getTag() {
        return this.tag;
    }

    /**
     * @param tag
     *            null.
     */
    public void setTag(String tag) {
        this.tag = tag;
    }

    /** @return null. */
    @Column(name = "STATUS", length = 50)
    public String getStatus() {
        return this.status;
    }

    /**
     * @param status
     *            null.
     */
    public void setStatus(String status) {
        this.status = status;
    }

    /** @return null. */
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "CREATE_TIME", length = 26)
    public Date getCreateTime() {
        return this.createTime;
    }

    /**
     * @param createTime
     *            null.
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /** @return null. */
    @Column(name = "USER_ID", length = 64)
    public String getUserId() {
        return this.userId;
    }

    /**
     * @param userId
     *            null.
     */
    public void setUserId(String userId) {
        this.userId = userId;
    }

    /** @return . */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "plmRequirement")
    @OrderBy("priority")
    public Set<PlmRequirement> getPlmRequirements() {
        return this.plmRequirements;
    }

    /**
     * @param plmRequirements
     *            .
     */
    public void setPlmRequirements(Set<PlmRequirement> plmRequirements) {
        this.plmRequirements = plmRequirements;
    }
}
