package com.mossle.bpm.persistence.domain;

// Generated by Hibernate Tools
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;

/**
 * BpmCategory 流程分类.
 * 
 * @author Lingo
 */
@Entity
@Table(name = "BPM_CATEGORY")
public class BpmCategory implements java.io.Serializable {
    private static final long serialVersionUID = 0L;

    /** 主键. */
    private Long id;

    /** null. */
    private BpmCategory bpmCategory;

    /** 名称. */
    private String name;

    /** 排序. */
    private Integer priority;

    /** 租户. */
    private String tenantId;

    /** null. */
    private String code;

    /** null. */
    private String status;

    /** . */
    private Set<BpmProcess> bpmProcesses = new HashSet<BpmProcess>(0);

    /** . */
    private Set<BpmCategory> bpmCategories = new HashSet<BpmCategory>(0);

    public BpmCategory() {
    }

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

    public BpmCategory(Long id, BpmCategory bpmCategory, String name,
            Integer priority, String tenantId, String code, String status,
            Set<BpmProcess> bpmProcesses, Set<BpmCategory> bpmCategories) {
        this.id = id;
        this.bpmCategory = bpmCategory;
        this.name = name;
        this.priority = priority;
        this.tenantId = tenantId;
        this.code = code;
        this.status = status;
        this.bpmProcesses = bpmProcesses;
        this.bpmCategories = bpmCategories;
    }

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

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

    /** @return null. */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PARENT_ID")
    public BpmCategory getBpmCategory() {
        return this.bpmCategory;
    }

    /**
     * @param bpmCategory
     *            null.
     */
    public void setBpmCategory(BpmCategory bpmCategory) {
        this.bpmCategory = bpmCategory;
    }

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

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

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

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

    /** @return 租户. */
    @Column(name = "TENANT_ID", length = 64)
    public String getTenantId() {
        return this.tenantId;
    }

    /**
     * @param tenantId
     *            租户.
     */
    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

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

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

    /** @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 . */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "bpmCategory")
    @OrderBy("priority")
    public Set<BpmProcess> getBpmProcesses() {
        return this.bpmProcesses;
    }

    /**
     * @param bpmProcesses
     *            .
     */
    public void setBpmProcesses(Set<BpmProcess> bpmProcesses) {
        this.bpmProcesses = bpmProcesses;
    }

    /** @return . */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "bpmCategory")
    public Set<BpmCategory> getBpmCategories() {
        return this.bpmCategories;
    }

    /**
     * @param bpmCategories
     *            .
     */
    public void setBpmCategories(Set<BpmCategory> bpmCategories) {
        this.bpmCategories = bpmCategories;
    }
}
