package com.bytesw.bytebot.etl.model;

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

import javax.persistence.*;
import java.time.OffsetDateTime;

@Cacheable(false)
@Entity
@Getter @Setter @ToString
@Table(name="avb_action_session")
@NamedQuery(name = "SessionAction.findByPK", query = "Select p from SessionAction p where p.id = ?1")
public class SessionAction {

    @Id
    @Column(name = "asess_id")
    @SequenceGenerator(name = "AVB_ACTION_SESSION_GENERATOR", sequenceName = "AVB_ACTION_SESSION_SEQ", initialValue = 1, allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE,generator = "AVB_ACTION_SESSION_GENERATOR")
    private Long id;

    @ManyToOne(optional = false)
    @JoinColumn(name = "action_id", referencedColumnName = "action_id")
    private Action action;

    @Column(name = "asess_date")
    private OffsetDateTime date;

    @Column(name = "session_id")
    private Long sessionId;
}
