package enea.lecservice.entities;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.*;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import java.util.List;

@Builder @Getter @Setter @NoArgsConstructor @AllArgsConstructor
@Entity
@Table(name = "lec_permission")
public class Permission {
    @Id
    String id;
    String description;

    @JsonIgnore
    @ManyToMany(mappedBy = "permissions")
    List<Role> roles;
}
