/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rjconsultores.ventaboletos.entidad;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.SequenceGenerator;

/**
 *
 * @author Administrador
 */
@Entity
@SequenceGenerator(name = "RESERVACION_MERCADO_SEQ", sequenceName = "RESERVACION_MERCADO_SEQ", allocationSize=1)
@Table(name = "RESERVACION_MERCADO")
public class ReservacionMercado implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "RESERVACION_MERCADO_SEQ")
    @Column(name = "RESERVACIONMERCADO_ID")
    private Integer reservacionmercadoId;
    @Column(name = "ACTIVO")
    private Boolean activo;
    @Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecmodif;
    @Column(name = "USUARIO_ID")
    private Integer usuarioId;
    @JoinColumn(name = "RESERVACIONCTRL_ID", referencedColumnName = "RESERVACIONCTRL_ID")
    @ManyToOne
    private ReservacionCtrl reservacionCtrl;
    @JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID")
    @ManyToOne
    private Parada paradaOrigem;
    @JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID")
    @ManyToOne
    private Parada paradaDestino;

    public ReservacionMercado() {
    }

    public ReservacionMercado(Integer reservacionmercadoId) {
        this.reservacionmercadoId = reservacionmercadoId;
    }

    public Integer getReservacionmercadoId() {
        return reservacionmercadoId;
    }

    public void setReservacionmercadoId(Integer reservacionmercadoId) {
        this.reservacionmercadoId = reservacionmercadoId;
    }

    public Boolean getActivo() {
        return activo;
    }

    public void setActivo(Boolean activo) {
        this.activo = activo;
    }

    public Date getFecmodif() {
        return fecmodif;
    }

    public void setFecmodif(Date fecmodif) {
        this.fecmodif = fecmodif;
    }

    public Integer getUsuarioId() {
        return usuarioId;
    }

    public void setUsuarioId(Integer usuarioId) {
        this.usuarioId = usuarioId;
    }

    public ReservacionCtrl getReservacionCtrl() {
        return reservacionCtrl;
    }

    public void setReservacionCtrl(ReservacionCtrl reservacionCtrl) {
        this.reservacionCtrl = reservacionCtrl;
    }

    public Parada getParadaDestino() {
        return paradaDestino;
    }

    public void setParadaDestino(Parada paradaDestino) {
        this.paradaDestino = paradaDestino;
    }

    public Parada getParadaOrigem() {
        return paradaOrigem;
    }

    public void setParadaOrigem(Parada paradaOrigem) {
        this.paradaOrigem = paradaOrigem;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ReservacionMercado other = (ReservacionMercado) obj;
        if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) {
            return false;
        }
        if (this.reservacionCtrl != other.reservacionCtrl && (this.reservacionCtrl == null || !this.reservacionCtrl.equals(other.reservacionCtrl))) {
            return false;
        }
        if (this.paradaOrigem != other.paradaOrigem && (this.paradaOrigem == null || !this.paradaOrigem.equals(other.paradaOrigem))) {
            return false;
        }
        if (this.paradaDestino != other.paradaDestino && (this.paradaDestino == null || !this.paradaDestino.equals(other.paradaDestino))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 73 * hash + (this.activo != null ? this.activo.hashCode() : 0);
        hash = 73 * hash + (this.reservacionCtrl != null ? this.reservacionCtrl.hashCode() : 0);
        hash = 73 * hash + (this.paradaOrigem != null ? this.paradaOrigem.hashCode() : 0);
        hash = 73 * hash + (this.paradaDestino != null ? this.paradaDestino.hashCode() : 0);
        return hash;
    }

   

    @Override
    public String toString() {
        return "com.rjconsultores.ventaboletos.entidad.ReservacionMercado[reservacionmercadoId=" + reservacionmercadoId + "]";
    }
}
