/*
 * 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.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TARMTIPOSANCION")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmtiposancion.findAll", query = "SELECT t FROM Tarmtiposancion t"),
    @NamedQuery(name = "Tarmtiposancion.findByCtiposancion", query = "SELECT t FROM Tarmtiposancion t WHERE t.ctiposancion = :ctiposancion")})
public class Tarmtiposancion implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CTIPOSANCION")
    private String ctiposancion;
    @OneToMany(mappedBy = "ctiposancion")
    private Collection<Tarmsanciondecomiso> tarmsanciondecomisoCollection;
    @JoinColumns({
        @JoinColumn(name = "TIPOFALTA", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "TIPOFALTACODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumns({
        @JoinColumn(name = "TRAMITE", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "TRAMITECODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail1;
    @JoinColumns({
        @JoinColumn(name = "TIEMPO", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "TIEMPOCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail2;
    @JoinColumns({
        @JoinColumn(name = "CLASE", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "CLASECODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail3;
    @JoinColumns({
        @JoinColumn(name = "FALTA", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "FALTACODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail4;
    @JoinColumns({
        @JoinColumn(name = "SANCION", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "SANCIONCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail5;

    public Tarmtiposancion() {
    }

    public Tarmtiposancion(String ctiposancion) {
        this.ctiposancion = ctiposancion;
    }

    public String getCtiposancion() {
        return ctiposancion;
    }

    public void setCtiposancion(String ctiposancion) {
        this.ctiposancion = ctiposancion;
    }

    @XmlTransient
    public Collection<Tarmsanciondecomiso> getTarmsanciondecomisoCollection() {
        return tarmsanciondecomisoCollection;
    }

    public void setTarmsanciondecomisoCollection(Collection<Tarmsanciondecomiso> tarmsanciondecomisoCollection) {
        this.tarmsanciondecomisoCollection = tarmsanciondecomisoCollection;
    }

    public Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

    public void setTgenecatalogdetail(Tgenecatalogdetail tgenecatalogdetail) {
        this.tgenecatalogdetail = tgenecatalogdetail;
    }

    public Tgenecatalogdetail getTgenecatalogdetail1() {
        return tgenecatalogdetail1;
    }

    public void setTgenecatalogdetail1(Tgenecatalogdetail tgenecatalogdetail1) {
        this.tgenecatalogdetail1 = tgenecatalogdetail1;
    }

    public Tgenecatalogdetail getTgenecatalogdetail2() {
        return tgenecatalogdetail2;
    }

    public void setTgenecatalogdetail2(Tgenecatalogdetail tgenecatalogdetail2) {
        this.tgenecatalogdetail2 = tgenecatalogdetail2;
    }

    public Tgenecatalogdetail getTgenecatalogdetail3() {
        return tgenecatalogdetail3;
    }

    public void setTgenecatalogdetail3(Tgenecatalogdetail tgenecatalogdetail3) {
        this.tgenecatalogdetail3 = tgenecatalogdetail3;
    }

    public Tgenecatalogdetail getTgenecatalogdetail4() {
        return tgenecatalogdetail4;
    }

    public void setTgenecatalogdetail4(Tgenecatalogdetail tgenecatalogdetail4) {
        this.tgenecatalogdetail4 = tgenecatalogdetail4;
    }

    public Tgenecatalogdetail getTgenecatalogdetail5() {
        return tgenecatalogdetail5;
    }

    public void setTgenecatalogdetail5(Tgenecatalogdetail tgenecatalogdetail5) {
        this.tgenecatalogdetail5 = tgenecatalogdetail5;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ctiposancion != null ? ctiposancion.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 Tarmtiposancion)) {
            return false;
        }
        Tarmtiposancion other = (Tarmtiposancion) object;
        if ((this.ctiposancion == null && other.ctiposancion != null) || (this.ctiposancion != null && !this.ctiposancion.equals(other.ctiposancion))) {
            return false;
        }
        return true;
    }

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