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

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

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

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

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

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

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

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

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

    /** . */
    private Set<OssBucket> ossBuckets = new HashSet<OssBucket>(0);

    /** . */
    private Set<OssEndpoint> ossEndpoints = new HashSet<OssEndpoint>(0);

    public OssRegion() {
    }

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

    public OssRegion(Long id, String code, String name, String status,
            Date createTime, String description, String tenantId,
            Set<OssBucket> ossBuckets, Set<OssEndpoint> ossEndpoints) {
        this.id = id;
        this.code = code;
        this.name = name;
        this.status = status;
        this.createTime = createTime;
        this.description = description;
        this.tenantId = tenantId;
        this.ossBuckets = ossBuckets;
        this.ossEndpoints = ossEndpoints;
    }

    /** @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 编码（备用）. */
    @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 状态: 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 = "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 = "ossRegion")
    public Set<OssBucket> getOssBuckets() {
        return this.ossBuckets;
    }

    /**
     * @param ossBuckets
     *            .
     */
    public void setOssBuckets(Set<OssBucket> ossBuckets) {
        this.ossBuckets = ossBuckets;
    }

    /** @return . */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "ossRegion")
    public Set<OssEndpoint> getOssEndpoints() {
        return this.ossEndpoints;
    }

    /**
     * @param ossEndpoints
     *            .
     */
    public void setOssEndpoints(Set<OssEndpoint> ossEndpoints) {
        this.ossEndpoints = ossEndpoints;
    }
}
