/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.qsoft.rs.sincoar.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="TGENEFILESDETAIL")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenefilesdetail.findAll", query = "SELECT t FROM Tgenefilesdetail t"),
    @NamedQuery(name = "Tgenefilesdetail.findByCode", query = "SELECT t FROM Tgenefilesdetail t WHERE t.tgenefilesdetailPK.code = :code"),
    @NamedQuery(name = "Tgenefilesdetail.findByDateto", query = "SELECT t FROM Tgenefilesdetail t WHERE t.tgenefilesdetailPK.dateto = :dateto"),
    @NamedQuery(name = "Tgenefilesdetail.findByExtension", query = "SELECT t FROM Tgenefilesdetail t WHERE t.extension = :extension"),
    @NamedQuery(name = "Tgenefilesdetail.findByDatefrom", query = "SELECT t FROM Tgenefilesdetail t WHERE t.datefrom = :datefrom"),
    @NamedQuery(name = "Tgenefilesdetail.findByImagesize", query = "SELECT t FROM Tgenefilesdetail t WHERE t.imagesize = :imagesize"),
    @NamedQuery(name = "Tgenefilesdetail.findByCapturedate", query = "SELECT t FROM Tgenefilesdetail t WHERE t.capturedate = :capturedate"),
    @NamedQuery(name = "Tgenefilesdetail.findByDescription", query = "SELECT t FROM Tgenefilesdetail t WHERE t.description = :description"),
    @NamedQuery(name = "Tgenefilesdetail.findByContenttype", query = "SELECT t FROM Tgenefilesdetail t WHERE t.contenttype = :contenttype"),
    @NamedQuery(name = "Tgenefilesdetail.findByName", query = "SELECT t FROM Tgenefilesdetail t WHERE t.name = :name")})
public class Tgenefilesdetail implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenefilesdetailPK tgenefilesdetailPK;
    @Lob
    @Column(name = "IMAGE")
    private Serializable image;
    @Column(name = "EXTENSION")
    private String extension;
    @Column(name = "DATEFROM")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datefrom;
    @Column(name = "IMAGESIZE")
    private Integer imagesize;
    @Column(name = "CAPTUREDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date capturedate;
    @Column(name = "DESCRIPTION")
    private String description;
    @Column(name = "CONTENTTYPE")
    private String contenttype;
    @Column(name = "NAME")
    private String name;
    @JoinColumn(name = "ORIGINCODE", referencedColumnName = "CODE")
    @ManyToOne
    private Tgenefiles origincode;
    @JoinColumn(name = "CODE", referencedColumnName = "CODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenefiles tgenefiles;
    @JoinColumn(name = "MODIFYUSER", referencedColumnName = "USERCODE")
    @ManyToOne
    private Tsafeuser modifyuser;
    @JoinColumn(name = "INGRESSUSER", referencedColumnName = "USERCODE")
    @ManyToOne
    private Tsafeuser ingressuser;

    public Tgenefilesdetail() {
    }

    public Tgenefilesdetail(TgenefilesdetailPK tgenefilesdetailPK) {
        this.tgenefilesdetailPK = tgenefilesdetailPK;
    }

    public Tgenefilesdetail(long code, Date dateto) {
        this.tgenefilesdetailPK = new TgenefilesdetailPK(code, dateto);
    }

    public TgenefilesdetailPK getTgenefilesdetailPK() {
        return tgenefilesdetailPK;
    }

    public void setTgenefilesdetailPK(TgenefilesdetailPK tgenefilesdetailPK) {
        this.tgenefilesdetailPK = tgenefilesdetailPK;
    }

    public Serializable getImage() {
        return image;
    }

    public void setImage(Serializable image) {
        this.image = image;
    }

    public String getExtension() {
        return extension;
    }

    public void setExtension(String extension) {
        this.extension = extension;
    }

    public Date getDatefrom() {
        return datefrom;
    }

    public void setDatefrom(Date datefrom) {
        this.datefrom = datefrom;
    }

    public Integer getImagesize() {
        return imagesize;
    }

    public void setImagesize(Integer imagesize) {
        this.imagesize = imagesize;
    }

    public Date getCapturedate() {
        return capturedate;
    }

    public void setCapturedate(Date capturedate) {
        this.capturedate = capturedate;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getContenttype() {
        return contenttype;
    }

    public void setContenttype(String contenttype) {
        this.contenttype = contenttype;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Tgenefiles getOrigincode() {
        return origincode;
    }

    public void setOrigincode(Tgenefiles origincode) {
        this.origincode = origincode;
    }

    public Tgenefiles getTgenefiles() {
        return tgenefiles;
    }

    public void setTgenefiles(Tgenefiles tgenefiles) {
        this.tgenefiles = tgenefiles;
    }

    public Tsafeuser getModifyuser() {
        return modifyuser;
    }

    public void setModifyuser(Tsafeuser modifyuser) {
        this.modifyuser = modifyuser;
    }

    public Tsafeuser getIngressuser() {
        return ingressuser;
    }

    public void setIngressuser(Tsafeuser ingressuser) {
        this.ingressuser = ingressuser;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tgenefilesdetailPK != null ? tgenefilesdetailPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tgenefilesdetail)) {
            return false;
        }
        Tgenefilesdetail other = (Tgenefilesdetail) object;
        if ((this.tgenefilesdetailPK == null && other.tgenefilesdetailPK != null) || (this.tgenefilesdetailPK != null && !this.tgenefilesdetailPK.equals(other.tgenefilesdetailPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.qsoft.rs.sincoar.model.Tgenefilesdetail[ tgenefilesdetailPK=" + tgenefilesdetailPK + " ]";
    }
    
}
