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

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

    /** null. */
    private Long id;

    /** null. */
    private Date createTime;

    /** null. */
    private String userId;

    /** null. */
    private Date updateTime;

    /** . */
    private Set<DiskAcl> diskAcls = new HashSet<DiskAcl>(0);

    /** . */
    private Set<DiskSpace> diskSpaces = new HashSet<DiskSpace>(0);

    /** . */
    private Set<DiskInfo> diskInfos = new HashSet<DiskInfo>(0);

    public DiskRule() {
    }

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

    public DiskRule(Long id, Date createTime, String userId, Date updateTime,
            Set<DiskAcl> diskAcls, Set<DiskSpace> diskSpaces,
            Set<DiskInfo> diskInfos) {
        this.id = id;
        this.createTime = createTime;
        this.userId = userId;
        this.updateTime = updateTime;
        this.diskAcls = diskAcls;
        this.diskSpaces = diskSpaces;
        this.diskInfos = diskInfos;
    }

    /** @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. */
    @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 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 . */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "diskRule")
    public Set<DiskAcl> getDiskAcls() {
        return this.diskAcls;
    }

    /**
     * @param diskAcls
     *            .
     */
    public void setDiskAcls(Set<DiskAcl> diskAcls) {
        this.diskAcls = diskAcls;
    }

    /** @return . */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "diskRule")
    public Set<DiskSpace> getDiskSpaces() {
        return this.diskSpaces;
    }

    /**
     * @param diskSpaces
     *            .
     */
    public void setDiskSpaces(Set<DiskSpace> diskSpaces) {
        this.diskSpaces = diskSpaces;
    }

    /** @return . */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "diskRule")
    public Set<DiskInfo> getDiskInfos() {
        return this.diskInfos;
    }

    /**
     * @param diskInfos
     *            .
     */
    public void setDiskInfos(Set<DiskInfo> diskInfos) {
        this.diskInfos = diskInfos;
    }
}
