Skip to content

Commit

Permalink
feat: Added form to Event
Browse files Browse the repository at this point in the history
  • Loading branch information
miguel-merlin committed Mar 4, 2024
1 parent 02918ac commit 97dbcc6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/sitblueprint/admin/model/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@Entity
@Table(name = "events")
Expand All @@ -23,4 +24,7 @@ public class Event {
private Long budget;
private int numberOfAttendees;
private LocalDateTime date;

@OneToMany(mappedBy = "event", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Form> satisfactionForms;
}
10 changes: 10 additions & 0 deletions src/main/java/com/sitblueprint/admin/model/Form.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
package com.sitblueprint.admin.model;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Form {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;

private String name;
private String email;
private LocalDateTime dateCreated;

@ManyToOne
@JoinColumn(name = "event_id")
private Event event;
}

0 comments on commit 97dbcc6

Please sign in to comment.