package io.gmss.fiscad.entities.rfu.metier;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.gmss.fiscad.entities.BaseEntity;
import io.gmss.fiscad.entities.infocad.metier.Tpe;
import io.gmss.fiscad.entities.rfu.parametre.Caracteristique;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import java.io.Serializable;

@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
//@SQLDelete(sql =
//        "UPDATE caracteristique_unite_logement " +
//                "SET deleted = true " +
//                "WHERE id = ?")
//@Where(clause = " deleted = false")
public class CaracteristiqueUniteLogement extends BaseEntity implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @ManyToOne
    @JsonBackReference
    private EnqueteUniteLogement enqueteUniteLogement;
    private Long enqueteUniteLogementExternalKey;
    @ManyToOne
    private Caracteristique caracteristique;
    private String valeur;
    @JsonIgnore
    @ManyToOne
    private Tpe terminal;
    private Long enqueteId;
    private Long mobileDataId;
}
