package com.bytesw.bytebot.model;

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

import javax.persistence.*;
import java.io.Serializable;

@Entity
@Table(name = "AVB_RESERVATION")
@NamedQuery(name = "Reservation.findByPK", query = "Select u from Reservation u where u.id = ?1")
@Getter
@Setter
@EqualsAndHashCode
@ToString(exclude = "id")
public class Reservation implements Serializable {
    @Id
    @Column(name = "reser_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ManyToOne
    @JoinColumn(name = "prox_id", referencedColumnName = "prox_id")
    private Proxy proxy;

    @ManyToOne
    @JoinColumn(name = "passen_id", referencedColumnName = "passen_id")
    private Passenger passenger;

    @Column(name = "reser_travel_type_class", nullable = false)
    private String travelTypeClass;

    @Column(name = "reser_number_in_party", nullable = false)
    private Integer numberInParty;
}
