JAVA: I am getting this error : Repeated column in mapping for collection: com.example.javaauthenticationapp.Model.Permission.permissionSet column: id. below is my Permission class: @Entity @Table(name="permissions") @Getter @Setter @Embeddable public class Permission { //removed getter and setter to save space @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(unique = true, nullable = false) private String title; private String slug; private String description; @CreatedDate @CreationTimestamp @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private LocalDateTime createdAt; @LastModifiedDate @UpdateTimestamp @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private LocalDateTime updatedAt; @ManyToMany(mappedBy = "id", cascade = CascadeType.REMOVE) Set permissionSet;
JAVA:
I am getting this error : Repeated column in mapping for collection: com.example.javaauthenticationapp.Model.Permission.permissionSet column: id.
below is my Permission class:
@Entity
@Table(name="permissions")
@Getter
@Setter
@Embeddable
public class Permission {
//removed getter and setter to save space
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(unique = true, nullable = false)
private String title;
private String slug;
private String description;
@CreatedDate
@CreationTimestamp
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private LocalDateTime createdAt;
@LastModifiedDate
@UpdateTimestamp
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private LocalDateTime updatedAt;
@ManyToMany(mappedBy = "id",
cascade = CascadeType.REMOVE)
Set<Role> permissionSet;
}
Trending now
This is a popular solution!
Step by step
Solved in 3 steps