package com.bytesw.bytebot.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.*;
import java.util.Date;

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

    @Column(name = "flig_airline", nullable = false)
    private String airline;

    @Column(name = "flig_airplane", nullable = false)
    private String airplane;

    @OneToOne
    private Airport origin;

    @OneToOne
    private Airport destination;

    @Column(name = "flig_departure_date", nullable = false)
    private String departureDate;

    @Column(name = "flig_arrival_date", nullable = false)
    private String arrivalDate;

    @Column(name = "flig_departure_time", nullable = false)
    private String departureTime;

    @Column(name = "flig_arrival_time", nullable = false)
    private String arrivalTime;
}
