/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cosmodas.EntCosmos;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author obper
 */
@Entity
@Table(name = "nota_remision", catalog = "dbcosmodas", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "NotaRemision.findAll", query = "SELECT n FROM NotaRemision n"),
    @NamedQuery(name = "NotaRemision.findByNotareCodigo", query = "SELECT n FROM NotaRemision n WHERE n.notareCodigo = :notareCodigo"),
    @NamedQuery(name = "NotaRemision.findByProgramaCodigo", query = "SELECT n FROM NotaRemision n WHERE n.programaCodigo = :programaCodigo"),
    @NamedQuery(name = "NotaRemision.findByNotareFecha", query = "SELECT n FROM NotaRemision n WHERE n.notareFecha = :notareFecha"),
    @NamedQuery(name = "NotaRemision.findByNotareEnvio", query = "SELECT n FROM NotaRemision n WHERE n.notareEnvio = :notareEnvio"),
    @NamedQuery(name = "NotaRemision.findByObserva", query = "SELECT n FROM NotaRemision n WHERE n.observa = :observa"),
    @NamedQuery(name = "NotaRemision.findBySucursalSalienteCodigo", query = "SELECT n FROM NotaRemision n WHERE n.sucursalSalienteCodigo = :sucursalSalienteCodigo"),
    @NamedQuery(name = "NotaRemision.findBySucursalEntranteCodigo", query = "SELECT n FROM NotaRemision n WHERE n.sucursalEntranteCodigo = :sucursalEntranteCodigo")})
public class NotaRemision implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 6)
    @Column(name = "notare_codigo")
    private String notareCodigo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "programa_codigo")
    private String programaCodigo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "notare_fecha")
    @Temporal(TemporalType.DATE)
    private Date notareFecha;
    @Basic(optional = false)
    @NotNull
    @Column(name = "notare_envio")
    private Character notareEnvio;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "observa")
    private String observa;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "sucursal_saliente_codigo")
    private String sucursalSalienteCodigo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "sucursal_entrante_codigo")
    private String sucursalEntranteCodigo;


    public NotaRemision() {
    }

    public NotaRemision(String notareCodigo) {
        this.notareCodigo = notareCodigo;
    }

    public NotaRemision(String notareCodigo, String programaCodigo, Date notareFecha, Character notareEnvio, String observa, String sucursalSalienteCodigo, String sucursalEntranteCodigo) {
        this.notareCodigo = notareCodigo;
        this.programaCodigo = programaCodigo;
        this.notareFecha = notareFecha;
        this.notareEnvio = notareEnvio;
        this.observa = observa;
        this.sucursalSalienteCodigo = sucursalSalienteCodigo;
        this.sucursalEntranteCodigo = sucursalEntranteCodigo;
    }

    public String getNotareCodigo() {
        return notareCodigo;
    }

    public void setNotareCodigo(String notareCodigo) {
        this.notareCodigo = notareCodigo;
    }

    public String getProgramaCodigo() {
        return programaCodigo;
    }

    public void setProgramaCodigo(String programaCodigo) {
        this.programaCodigo = programaCodigo;
    }

    public Date getNotareFecha() {
        return notareFecha;
    }

    public void setNotareFecha(Date notareFecha) {
        this.notareFecha = notareFecha;
    }

    public Character getNotareEnvio() {
        return notareEnvio;
    }

    public void setNotareEnvio(Character notareEnvio) {
        this.notareEnvio = notareEnvio;
    }

    public String getObserva() {
        return observa;
    }

    public void setObserva(String observa) {
        this.observa = observa;
    }

    public String getSucursalSalienteCodigo() {
        return sucursalSalienteCodigo;
    }

    public void setSucursalSalienteCodigo(String sucursalSalienteCodigo) {
        this.sucursalSalienteCodigo = sucursalSalienteCodigo;
    }

    public String getSucursalEntranteCodigo() {
        return sucursalEntranteCodigo;
    }

    public void setSucursalEntranteCodigo(String sucursalEntranteCodigo) {
        this.sucursalEntranteCodigo = sucursalEntranteCodigo;
    }


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

    @Override
    public String toString() {
        return "com.cosmodas.EntCosmos.NotaRemision[ notareCodigo=" + notareCodigo + " ]";
    }
    
}
