Offer
⬇️ Lembrar de criar Getters and Setters + equals&hashcode com ID.
❗Nunca coloque um Set do relacionamento dentro do construtor.
Atualizado
⬇️ Lembrar de criar Getters and Setters + equals&hashcode com ID.
❗Nunca coloque um Set do relacionamento dentro do construtor.
@Entity
@Table(name = "tb_offer")
public class Offer {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String edition;
@Column(columnDefinition = "TIMESTAMP WITHOUT TIME ZONE")
private Instant startMoment;
@Column(columnDefinition = "TIMESTAMP WITHOUT TIME ZONE")
private Instant endMoment;
@ManyToOne
@JoinColumn(name = "course_id")
private Course course;
@OneToMany(mappedBy = "offer")
private List<Resource> resources = new ArrayList<>();
@OneToMany(mappedBy = "offer")
private List<Topic> topics = new ArrayList<>();
Atualizado