Skip to content

Commit

Permalink
add default values for many to many relation
Browse files Browse the repository at this point in the history
  • Loading branch information
a-lor-cab committed Nov 20, 2023
1 parent add8630 commit 384c7d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

Expand Down Expand Up @@ -59,6 +60,7 @@ public class SpotlightBatch {
@JoinTable(name = "spotlight_batch_submission", joinColumns = @JoinColumn(name = "spotlight_batch_id"),
inverseJoinColumns = @JoinColumn(name = "spotlight_submission_id"))
@JsonIgnoreProperties("batches")
private List<SpotlightSubmission> spotlightSubmissions;
@Builder.Default
private List<SpotlightSubmission> spotlightSubmissions = new ArrayList<>();

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import javax.persistence.OneToOne;
import javax.persistence.Table;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

Expand Down Expand Up @@ -61,6 +62,6 @@ public class SpotlightSubmission {
private Instant lastUpdated;

@ManyToMany
private List<SpotlightBatch> batches;
private List<SpotlightBatch> batches = new ArrayList<>();

}

0 comments on commit 384c7d5

Please sign in to comment.