package com.mossle.leave.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.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

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

    /** null. */
    private Long id;

    /** null. */
    private LeaveRule leaveRule;

    /** null. */
    private String code;

    /** null. */
    private String name;

    /** null. */
    private String type;

    /** null. */
    private Date createTime;

    /** null. */
    private Date updateTime;

    /** null. */
    private String status;

    /** null. */
    private String description;

    /** null. */
    private String userId;

    /** null. */
    private String tenantId;

    /** . */
    private Set<LeaveLog> leaveLogs = new HashSet<LeaveLog>(0);

    public LeaveUser() {
    }

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

    public LeaveUser(Long id, LeaveRule leaveRule, String code, String name,
            String type, Date createTime, Date updateTime, String status,
            String description, String userId, String tenantId,
            Set<LeaveLog> leaveLogs) {
        this.id = id;
        this.leaveRule = leaveRule;
        this.code = code;
        this.name = name;
        this.type = type;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.status = status;
        this.description = description;
        this.userId = userId;
        this.tenantId = tenantId;
        this.leaveLogs = leaveLogs;
    }

    /** @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 = "RULE_ID")
    public LeaveRule getLeaveRule() {
        return this.leaveRule;
    }

    /**
     * @param leaveRule
     *            null.
     */
    public void setLeaveRule(LeaveRule leaveRule) {
        this.leaveRule = leaveRule;
    }

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

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

    /** @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 = "TYPE", length = 50)
    public String getType() {
        return this.type;
    }

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

    /** @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. */
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "UPDATE_TIME", length = 26)
    public Date getUpdateTime() {
        return this.updateTime;
    }

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

    /** @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. */
    @Column(name = "DESCRIPTION", length = 200)
    public String getDescription() {
        return this.description;
    }

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

    /** @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 null. */
    @Column(name = "TENANT_ID", length = 64)
    public String getTenantId() {
        return this.tenantId;
    }

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

    /** @return . */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "leaveUser")
    public Set<LeaveLog> getLeaveLogs() {
        return this.leaveLogs;
    }

    /**
     * @param leaveLogs
     *            .
     */
    public void setLeaveLogs(Set<LeaveLog> leaveLogs) {
        this.leaveLogs = leaveLogs;
    }
}
