/*
 * 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.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
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.TARMSOLICITUDARMAS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmsolicitudarmas.findAll", query = "SELECT t FROM Tarmsolicitudarmas t"),
    @NamedQuery(name = "Tarmsolicitudarmas.findByCsolicitud", query = "SELECT t FROM Tarmsolicitudarmas t WHERE t.tarmsolicitudarmasPK.csolicitud = :csolicitud"),
    @NamedQuery(name = "Tarmsolicitudarmas.findByPersoncode", query = "SELECT t FROM Tarmsolicitudarmas t WHERE t.tarmsolicitudarmasPK.personcode = :personcode"),
    @NamedQuery(name = "Tarmsolicitudarmas.findByCarma", query = "SELECT t FROM Tarmsolicitudarmas t WHERE t.tarmsolicitudarmasPK.carma = :carma"),
    @NamedQuery(name = "Tarmsolicitudarmas.findByEntregada", query = "SELECT t FROM Tarmsolicitudarmas t WHERE t.entregada = :entregada"),
    @NamedQuery(name = "Tarmsolicitudarmas.findByAprobada", query = "SELECT t FROM Tarmsolicitudarmas t WHERE t.aprobada = :aprobada"),
    @NamedQuery(name = "Tarmsolicitudarmas.findByPordevolucion", query = "SELECT t FROM Tarmsolicitudarmas t WHERE t.pordevolucion = :pordevolucion")})
public class Tarmsolicitudarmas implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TarmsolicitudarmasPK tarmsolicitudarmasPK;
    @Column(name = "ENTREGADA")
    private String entregada;
    @Column(name = "APROBADA")
    private String aprobada;
    @Column(name = "PORDEVOLUCION")
    private String pordevolucion;
    @JoinColumn(name = "CARMA", referencedColumnName = "CARMA", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tarmarmas tarmarmas;
    @JoinColumn(name = "CSOLICITUD", referencedColumnName = "CSOLICITUD", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tarmsolicitud tarmsolicitud;
    @OneToMany(mappedBy = "tarmsolicitudarmas")
    private Collection<Tarmarmapruebas> tarmarmapruebasCollection;

    public Tarmsolicitudarmas() {
    }

    public Tarmsolicitudarmas(TarmsolicitudarmasPK tarmsolicitudarmasPK) {
        this.tarmsolicitudarmasPK = tarmsolicitudarmasPK;
    }

    public Tarmsolicitudarmas(String csolicitud, long personcode, String carma) {
        this.tarmsolicitudarmasPK = new TarmsolicitudarmasPK(csolicitud, personcode, carma);
    }

    public TarmsolicitudarmasPK getTarmsolicitudarmasPK() {
        return tarmsolicitudarmasPK;
    }

    public void setTarmsolicitudarmasPK(TarmsolicitudarmasPK tarmsolicitudarmasPK) {
        this.tarmsolicitudarmasPK = tarmsolicitudarmasPK;
    }

    public String getEntregada() {
        return entregada;
    }

    public void setEntregada(String entregada) {
        this.entregada = entregada;
    }

    public String getAprobada() {
        return aprobada;
    }

    public void setAprobada(String aprobada) {
        this.aprobada = aprobada;
    }

    public String getPordevolucion() {
        return pordevolucion;
    }

    public void setPordevolucion(String pordevolucion) {
        this.pordevolucion = pordevolucion;
    }

    public Tarmarmas getTarmarmas() {
        return tarmarmas;
    }

    public void setTarmarmas(Tarmarmas tarmarmas) {
        this.tarmarmas = tarmarmas;
    }

    public Tarmsolicitud getTarmsolicitud() {
        return tarmsolicitud;
    }

    public void setTarmsolicitud(Tarmsolicitud tarmsolicitud) {
        this.tarmsolicitud = tarmsolicitud;
    }

    @XmlTransient
    public Collection<Tarmarmapruebas> getTarmarmapruebasCollection() {
        return tarmarmapruebasCollection;
    }

    public void setTarmarmapruebasCollection(Collection<Tarmarmapruebas> tarmarmapruebasCollection) {
        this.tarmarmapruebasCollection = tarmarmapruebasCollection;
    }

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

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