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

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

    /** null. */
    private Long id;

    /** null. */
    private AssetCategory assetCategoryByCategoryId;

    /** null. */
    private AssetCategory assetCategoryBySubCategoryId;

    /** null. */
    private String name;

    /** null. */
    private String code;

    /** null. */
    private String description;

    /** null. */
    private String model;

    /** null. */
    private Double price;

    /** null. */
    private Date buyDate;

    /** null. */
    private String status;

    /** null. */
    private String userId;

    /** null. */
    private Long location;

    /** null. */
    private Date startTime;

    /** null. */
    private String sn;

    /** . */
    private Set<AssetHistory> assetHistories = new HashSet<AssetHistory>(0);

    /** . */
    private Set<AssetLend> assetLends = new HashSet<AssetLend>(0);

    public AssetInfo() {
    }

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

    public AssetInfo(Long id, AssetCategory assetCategoryByCategoryId,
            AssetCategory assetCategoryBySubCategoryId, String name,
            String code, String description, String model, Double price,
            Date buyDate, String status, String userId, Long location,
            Date startTime, String sn, Set<AssetHistory> assetHistories,
            Set<AssetLend> assetLends) {
        this.id = id;
        this.assetCategoryByCategoryId = assetCategoryByCategoryId;
        this.assetCategoryBySubCategoryId = assetCategoryBySubCategoryId;
        this.name = name;
        this.code = code;
        this.description = description;
        this.model = model;
        this.price = price;
        this.buyDate = buyDate;
        this.status = status;
        this.userId = userId;
        this.location = location;
        this.startTime = startTime;
        this.sn = sn;
        this.assetHistories = assetHistories;
        this.assetLends = assetLends;
    }

    /** @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 = "CATEGORY_ID")
    public AssetCategory getAssetCategoryByCategoryId() {
        return this.assetCategoryByCategoryId;
    }

    /**
     * @param assetCategoryByCategoryId
     *            null.
     */
    public void setAssetCategoryByCategoryId(
            AssetCategory assetCategoryByCategoryId) {
        this.assetCategoryByCategoryId = assetCategoryByCategoryId;
    }

    /** @return null. */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SUB_CATEGORY_ID")
    public AssetCategory getAssetCategoryBySubCategoryId() {
        return this.assetCategoryBySubCategoryId;
    }

    /**
     * @param assetCategoryBySubCategoryId
     *            null.
     */
    public void setAssetCategoryBySubCategoryId(
            AssetCategory assetCategoryBySubCategoryId) {
        this.assetCategoryBySubCategoryId = assetCategoryBySubCategoryId;
    }

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

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

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

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

    /** @return null. */
    @Column(name = "PRICE", precision = 64, scale = 0)
    public Double getPrice() {
        return this.price;
    }

    /**
     * @param price
     *            null.
     */
    public void setPrice(Double price) {
        this.price = price;
    }

    /** @return null. */
    @Temporal(TemporalType.DATE)
    @Column(name = "BUY_DATE", length = 10)
    public Date getBuyDate() {
        return this.buyDate;
    }

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

    /** @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 = "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 = "LOCATION")
    public Long getLocation() {
        return this.location;
    }

    /**
     * @param location
     *            null.
     */
    public void setLocation(Long location) {
        this.location = location;
    }

    /** @return null. */
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "START_TIME", length = 26)
    public Date getStartTime() {
        return this.startTime;
    }

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

    /** @return null. */
    @Column(name = "SN", length = 50)
    public String getSn() {
        return this.sn;
    }

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

    /** @return . */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "assetInfo")
    public Set<AssetHistory> getAssetHistories() {
        return this.assetHistories;
    }

    /**
     * @param assetHistories
     *            .
     */
    public void setAssetHistories(Set<AssetHistory> assetHistories) {
        this.assetHistories = assetHistories;
    }

    /** @return . */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "assetInfo")
    public Set<AssetLend> getAssetLends() {
        return this.assetLends;
    }

    /**
     * @param assetLends
     *            .
     */
    public void setAssetLends(Set<AssetLend> assetLends) {
        this.assetLends = assetLends;
    }
}
