package io.gmss.fiscad.entities.infocad.parametre;

import io.gmss.fiscad.entities.BaseEntity;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
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 situation_geographique " +
                "SET deleted = true " +
                "WHERE id = ?")
@Where(clause = " deleted = false")
public class SituationGeographique extends BaseEntity implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private String libelle;
//    @JsonIgnore
//    @OneToMany(mappedBy = "situationGeographique")
//    private List<Parcelle> parcelles;
}
