package com.rjconsultores.ventaboletos.entidad;

import java.io.Serializable;
import java.math.BigDecimal;
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.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@EqualsAndHashCode
@Entity
@Table(name = "TARIFA_CONVENIO_TRANSP")
public class TarifaConvenioTransport implements Serializable {

	private static final long serialVersionUID = 4117896818436639147L;

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TARIFA_CONVENIO_TRANSP_SEQ")
	@SequenceGenerator(name = "TARIFA_CONVENIO_TRANSP_SEQ", sequenceName = "TARIFA_CONVENIO_TRANSP_SEQ", allocationSize = 1)
    @Column(name = "TARIFACONVENIO_ID")
    private Long tarifaConvenioId;
    
    @OneToOne
    @JoinColumn(name = "CONVENIOTRANSPORTADORA_ID", referencedColumnName = "CONVENIOTRANSPORTADORA_ID")
    private ConvenioTransportadora convenioTransportadora;

    @OneToOne
	@JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID")	
    private Parada origem;
    
	@OneToOne
	@JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID")
    private Parada destino;

    @Column(name = "TARIFA")
    private BigDecimal tarifa;

    @Column(name = "USUARIO_ID")
    private Integer usuarioId;

    @Column(name = "ACTIVO")
    private boolean activo;

    @Basic(optional = false)
    @Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecModif;
    
}