JAVA: is there anything wrong with this my RolePermission class below? I am getting error: Error creating bean with name 'rolePermissionController' below is the class @Entity @Getter @Setter @NoArgsConstructor public class RolePermission { @Id @GeneratedValue( strategy = GenerationType.SEQUENCE, generator = "Id") // @Column(name = "id", nullable = false) private Long id; // @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) // @ManyToOne @JoinColumn(name = "roleId") @JsonIgnore private Role role; @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) // @ManyToOne @JoinColumn(name = "permissionId") // @JoinColumn(name = "permissionId", referencedColumnName = "permission", // insertable = false,updatable = false) @LazyToOne(LazyToOneOption.NO_PROXY) @JsonIgnore private Permission permission; @CreatedDate @CreationTimestamp @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime createdAt; @LastModifiedDate @UpdateTimestamp @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime updatedAt;
JAVA:
is there anything wrong with this my RolePermission class below? I am getting error: Error creating bean with name 'rolePermissionController'
below is the class
@Entity
@Getter
@Setter
@NoArgsConstructor
public class RolePermission {
@Id
@GeneratedValue(
strategy = GenerationType.SEQUENCE,
generator = "Id")
// @Column(name = "id", nullable = false)
private Long id;
//
@ManyToOne(fetch = FetchType.LAZY,
cascade = CascadeType.REMOVE)
// @ManyToOne
@JoinColumn(name = "roleId")
@JsonIgnore
private Role role;
@ManyToOne(fetch = FetchType.LAZY,
cascade = CascadeType.REMOVE)
// @ManyToOne
@JoinColumn(name = "permissionId")
// @JoinColumn(name = "permissionId", referencedColumnName = "permission",
// insertable = false,updatable = false)
@LazyToOne(LazyToOneOption.NO_PROXY)
@JsonIgnore
private Permission permission;
@CreatedDate
@CreationTimestamp
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
LocalDateTime createdAt;
@LastModifiedDate
@UpdateTimestamp
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
LocalDateTime updatedAt;
}
Step by step
Solved in 3 steps