package edu.prlab.tyler.iotgateway.cloud.pojo.privacy.p3p;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

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

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Entity
public class Statement {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @JsonIgnore
    private long id;

    private String consequence;

    @OneToMany(cascade = CascadeType.ALL)
    @JoinColumn(name = "purpose_id")
    private List<Purpose> purposes;

    @OneToMany(cascade = CascadeType.ALL)
    @JoinColumn(name = "datum_id")
    private List<Datum> data;

    @OneToMany(cascade = CascadeType.ALL)
    @JoinColumn(name = "recipient_id")
    private List<Recipient> recipients;

    @Enumerated(value = EnumType.STRING)
    private Retention retention;
}
