From 74364effe6773408e33c61d907b6c9778255650b Mon Sep 17 00:00:00 2001 From: omenem Date: Thu, 7 May 2020 10:04:05 +0200 Subject: [PATCH] wip --- .../inf/sa4/sanmarinoes/smarthut/models/Automation.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Automation.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Automation.java index e17e870..18eb71a 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Automation.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Automation.java @@ -33,6 +33,9 @@ public class Automation { @OneToMany(mappedBy = "automation", cascade = CascadeType.REMOVE) private Set scenes = new HashSet<>(); + @OneToMany(mappedBy = "automation", orphanRemoval = true, cascade = CascadeType.REMOVE) + private Set> conditions = new HashSet<>(); + @NotNull @NotEmpty private String name; public long getId() { @@ -78,4 +81,8 @@ public class Automation { public void setUserId(Long userId) { this.userId = userId; } + + public Set> getConditions() { + return conditions; + } }