package com.mossle.internal.oss.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;

/**
 * OssObject 对象文件.
 * 
 * @author Lingo
 */
@Entity
@Table(name = "OSS_OBJECT")
public class OssObject implements java.io.Serializable {
    private static final long serialVersionUID = 0L;

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

    /** 外键. */
    private OssBucket ossBucket;

    /** 编码（备用）. */
    private String code;

    /** 文件原名称. */
    private String name;

    /** 路径. */
    private String path;

    /** 大小. */
    private Long size;

    /** 状态: active,inactive. */
    private String status;

    /** 创建时间. */
    private Date createTime;

    /** 描述(备用). */
    private String description;

    /** 创建人(备用). */
    private String userId;

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

    /** . */
    private Set<OssMetadata> ossMetadatas = new HashSet<OssMetadata>(0);

    public OssObject() {
    }

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

    public OssObject(Long id, OssBucket ossBucket, String code, String name,
            String path, Long size, String status, Date createTime,
            String description, String userId, String tenantId,
            Set<OssMetadata> ossMetadatas) {
        this.id = id;
        this.ossBucket = ossBucket;
        this.code = code;
        this.name = name;
        this.path = path;
        this.size = size;
        this.status = status;
        this.createTime = createTime;
        this.description = description;
        this.userId = userId;
        this.tenantId = tenantId;
        this.ossMetadatas = ossMetadatas;
    }

    /** @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 外键. */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "BUCKET_ID")
    public OssBucket getOssBucket() {
        return this.ossBucket;
    }

    /**
     * @param ossBucket
     *            外键.
     */
    public void setOssBucket(OssBucket ossBucket) {
        this.ossBucket = ossBucket;
    }

    /** @return 编码（备用）. */
    @Column(name = "CODE", length = 50)
    public String getCode() {
        return this.code;
    }

    /**
     * @param code
     *            编码（备用）.
     */
    public void setCode(String code) {
        this.code = code;
    }

    /** @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 = "PATH", length = 200)
    public String getPath() {
        return this.path;
    }

    /**
     * @param path
     *            路径.
     */
    public void setPath(String path) {
        this.path = path;
    }

    /** @return 大小. */
    @Column(name = "SIZE")
    public Long getSize() {
        return this.size;
    }

    /**
     * @param size
     *            大小.
     */
    public void setSize(Long size) {
        this.size = size;
    }

    /** @return 状态: active,inactive. */
    @Column(name = "STATUS", length = 50)
    public String getStatus() {
        return this.status;
    }

    /**
     * @param status
     *            状态: active,inactive.
     */
    public void setStatus(String status) {
        this.status = status;
    }

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

    /**
     * @param createTime
     *            创建时间.
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /** @return 描述(备用). */
    @Column(name = "DESCRIPTION", length = 200)
    public String getDescription() {
        return this.description;
    }

    /**
     * @param description
     *            描述(备用).
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /** @return 创建人(备用). */
    @Column(name = "USER_ID", length = 64)
    public String getUserId() {
        return this.userId;
    }

    /**
     * @param userId
     *            创建人(备用).
     */
    public void setUserId(String userId) {
        this.userId = userId;
    }

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

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

    /** @return . */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "ossObject")
    public Set<OssMetadata> getOssMetadatas() {
        return this.ossMetadatas;
    }

    /**
     * @param ossMetadatas
     *            .
     */
    public void setOssMetadatas(Set<OssMetadata> ossMetadatas) {
        this.ossMetadatas = ossMetadatas;
    }
}
