content: package com.alibou.book.role;
  
  import com.alibou.book.user.User;
  import com.fasterxml.jackson.annotation.JsonIgnore;
  import jakarta.persistence.Column;
  import jakarta.persistence.Entity;
  import jakarta.persistence.EntityListeners;
  import jakarta.persistence.GeneratedValue;
  import jakarta.persistence.Id;
  import jakarta.persistence.ManyToMany;
  import jakarta.persistence.Table;
  import lombok.AllArgsConstructor;
  import lombok.Builder;
  import lombok.Getter;
  import lombok.NoArgsConstructor;
  import lombok.Setter;
  import org.springframework.data.annotation.CreatedDate;
  import org.springframework.data.annotation.LastModifiedDate;
  import org.springframework.data.jpa.domain.support.AuditingEntityListener;
  
  import java.time.LocalDateTime;
  import java.util.List;
  
  @Getter
  @Setter
  @Builder
  @NoArgsConstructor
  @AllArgsConstructor
  // @Entity
  // @Table(name = "role")
  // @EntityListeners(AuditingEntityListener.class)
  public class Role {
  
      @Id
      @GeneratedValue
      private Integer id;
      @Column(unique = true)
      private String name;
      @ManyToMany(mappedBy = "roles")
      @JsonIgnore
      private List<User> user;
  
      @CreatedDate
      @Column(nullable = false, updatable = false)
      private LocalDateTime createdDate;
  
      @LastModifiedDate
      @Column(insertable = false)
      private LocalDateTime lastModifiedDate;
  }
  