| package eu.mulk.mulkcms2.entity; |
| |
| import io.quarkus.hibernate.orm.panache.PanacheEntityBase; |
| import java.util.Collection; |
| import javax.persistence.Column; |
| import javax.persistence.Entity; |
| import javax.persistence.FetchType; |
| import javax.persistence.Id; |
| import javax.persistence.JoinColumn; |
| import javax.persistence.ManyToOne; |
| import javax.persistence.OneToMany; |
| import javax.persistence.Table; |
| |
| @Entity |
| @Table(name = "comments", schema = "public", catalog = "mulkcms") |
| public class Comment extends PanacheEntityBase { |
| |
| @Id |
| @Column(name = "id", nullable = false) |
| public int id; |
| |
| @Column(name = "global_id", nullable = true, length = -1) |
| public String globalId; |
| |
| @OneToMany(mappedBy = "comment", fetch = FetchType.LAZY) |
| public Collection<CommentRevision> revisions; |
| |
| @ManyToOne(fetch = FetchType.LAZY) |
| @JoinColumn(name = "article", referencedColumnName = "id", nullable = false) |
| public Article article; |
| } |