Model class

PHOTO EMBED

Mon Jan 09 2023 07:46:16 GMT+0000 (Coordinated Universal Time)

Saved by @prachiii_c #springframework

@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "post_blog")
public class Posts {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id" , nullable = false)
    private Long id;

    @Column(name="title" , nullable = false)
    private String title;

    @Column(name="content" , nullable = false)
    private String content;

    @Column(name="description" , nullable = false)
    private String description;

    @OneToMany(mappedBy = "posts" , cascade = CascadeType.ALL , orphanRemoval = true)
    private Set<Comments> comments = new HashSet<>();
content_copyCOPY