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.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "TARIFA_GRUPO_CONTRATO")
public class TarifaGrupoContrato implements Serializable{

	private static final long serialVersionUID = -8044552223526401469L;

	@Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TARIFA_GRUPO_CONTRATO_SEQ")
    @SequenceGenerator(name = "TARIFA_GRUPO_CONTRATO_SEQ", sequenceName = "TARIFA_GRUPO_CONTRATO_SEQ", allocationSize = 1)
    @Column(name = "TARIFAGRUPOCONTRATO_ID")
    private Integer tarifaGrupoContratoId;
    
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "GRUPOCONTRATO_ID")
    private GrupoContrato grupoContrato;
    
	@OneToOne
	@JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID")	
    private Parada origem;
    
	@OneToOne
	@JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID")
    private Parada destino;
    
	@OneToOne
	@JoinColumn(name = "CLASESERVICIO_ID")
    private ClaseServicio claseServicio;
    
    @Column(name = "TARIFA")
    private BigDecimal tarifa;
    
    @Column(name = "USUARIO_ID")
    private Integer usuarioId;
    
    @Column(name = "INDCOBERTURA")
    private boolean indCobertura;
    
    @Column(name = "ACTIVO")
    private boolean activo;
    
    @Basic(optional = false)
    @Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecModif;
    
}