From c9395404e02136b9589ad3540e91db3a0c7c5640 Mon Sep 17 00:00:00 2001 From: omenem Date: Sun, 26 Apr 2020 13:29:14 +0200 Subject: [PATCH 1/6] fix --- .../ch/usi/inf/sa4/sanmarinoes/smarthut/models/Trigger.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Trigger.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Trigger.java index 1ef68f0..9caeaee 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Trigger.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Trigger.java @@ -26,7 +26,7 @@ public abstract class Trigger { @ApiModelProperty(hidden = true) private long id; - @ManyToOne(targetEntity = OutputDevice.class) + @ManyToOne(targetEntity = Device.class) @JoinColumn(name = "device_id", updatable = false, insertable = false) @GsonExclude private D device; From 06dbd2bef0fee0df2d69176d53cbc6919dfa762a Mon Sep 17 00:00:00 2001 From: omenem Date: Sun, 26 Apr 2020 13:57:30 +0200 Subject: [PATCH 2/6] fix --- .../inf/sa4/sanmarinoes/smarthut/models/BooleanTrigger.java | 3 --- .../usi/inf/sa4/sanmarinoes/smarthut/models/RangeTrigger.java | 3 --- .../ch/usi/inf/sa4/sanmarinoes/smarthut/models/Trigger.java | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/BooleanTrigger.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/BooleanTrigger.java index f52e5ca..fde9b3b 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/BooleanTrigger.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/BooleanTrigger.java @@ -2,11 +2,8 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; @Entity -@Inheritance(strategy = InheritanceType.JOINED) public class BooleanTrigger extends Trigger { @Column(name = "switchable_on") diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/RangeTrigger.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/RangeTrigger.java index a03781d..db94966 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/RangeTrigger.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/RangeTrigger.java @@ -3,12 +3,9 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; import com.google.gson.annotations.SerializedName; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; import javax.validation.constraints.NotNull; @Entity -@Inheritance(strategy = InheritanceType.JOINED) public class RangeTrigger extends Trigger { @Override diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Trigger.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Trigger.java index 9caeaee..4e74b11 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Trigger.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Trigger.java @@ -15,7 +15,7 @@ import javax.persistence.PreRemove; import javax.validation.constraints.NotNull; @Entity -@Inheritance(strategy = InheritanceType.SINGLE_TABLE) +@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public abstract class Trigger { public abstract boolean triggered(); From cc2a16f3e308a13e8f43571635729fc69d4a1d47 Mon Sep 17 00:00:00 2001 From: omenem Date: Mon, 27 Apr 2020 11:54:31 +0200 Subject: [PATCH 3/6] fix --- .../smarthut/controller/ScenePriorityController.java | 7 +++++++ .../sa4/sanmarinoes/smarthut/models/ScenePriority.java | 10 +++++++++- .../smarthut/models/ScenePriorityRepository.java | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/ScenePriorityController.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/ScenePriorityController.java index d0bbb5a..8711d57 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/ScenePriorityController.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/ScenePriorityController.java @@ -4,6 +4,7 @@ import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.ScenePrioritySaveRequest; import ch.usi.inf.sa4.sanmarinoes.smarthut.error.NotFoundException; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.ScenePriority; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.ScenePriorityRepository; +import java.util.List; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -28,6 +29,12 @@ public class ScenePriorityController { return scenePriorityRepository.findById(id).orElseThrow(NotFoundException::new); } + @GetMapping("/{automationId}") + public List getByAutomationId(@PathVariable long automationId) + throws NotFoundException { + return scenePriorityRepository.findAllByAutomationId(automationId); + } + private ScenePriority save(ScenePriority newRL, ScenePrioritySaveRequest s) { newRL.setPriority(s.getPriority()); newRL.setAutomationId(s.getAutomationId()); diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriority.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriority.java index 0652e5e..d34714b 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriority.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriority.java @@ -1,8 +1,11 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; import ch.usi.inf.sa4.sanmarinoes.smarthut.config.GsonExclude; +import io.swagger.annotations.ApiModelProperty; import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; @@ -13,6 +16,12 @@ import javax.validation.constraints.NotNull; @Entity public class ScenePriority { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id", updatable = false, nullable = false, unique = true) + @ApiModelProperty(hidden = true) + private long id; + @ManyToOne @JoinColumn(name = "automation_id", updatable = false, insertable = false) @GsonExclude @@ -32,7 +41,6 @@ public class ScenePriority { @GsonExclude private Scene scene; - @Id @Column(name = "scene_id", nullable = false, updatable = false, unique = true) @NotNull private Long sceneId; diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriorityRepository.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriorityRepository.java index 020a369..1d9b3c6 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriorityRepository.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriorityRepository.java @@ -9,4 +9,6 @@ public interface ScenePriorityRepository extends CrudRepository findAllBySceneId(@Param("sceneId") long sceneId); void deleteBySceneId(@Param("sceneId") long sceneId); + + List findAllByAutomationId(@Param("automationId") long automationId); } From 719bde08406d4defb168b536c2255c1f9363c284 Mon Sep 17 00:00:00 2001 From: omenem Date: Mon, 27 Apr 2020 13:55:59 +0200 Subject: [PATCH 4/6] fix --- .../controller/AutomationController.java | 38 +++++++++---------- .../smarthut/models/Automation.java | 26 +++++++++++++ .../smarthut/models/AutomationRepository.java | 7 +++- 3 files changed, 49 insertions(+), 22 deletions(-) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/AutomationController.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/AutomationController.java index 445bb83..7abd499 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/AutomationController.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/AutomationController.java @@ -6,10 +6,9 @@ import ch.usi.inf.sa4.sanmarinoes.smarthut.models.Automation; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.AutomationRepository; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.ScenePriorityRepository; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.SceneRepository; +import ch.usi.inf.sa4.sanmarinoes.smarthut.models.UserRepository; import java.security.Principal; -import java.util.Collection; import java.util.List; -import java.util.stream.Collectors; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -31,24 +30,15 @@ public class AutomationController { @Autowired private AutomationRepository automationRepository; @Autowired private SceneRepository sceneRepository; @Autowired private ScenePriorityRepository scenePriorityRepository; + @Autowired private UserRepository userService; @GetMapping public List getAll( - @RequestParam(value = "hostId", required = false) Long hostId, final Principal user) + @RequestParam(value = "hostId", required = false) Long hostId, + final Principal principal) throws NotFoundException { - return sceneRepository - .findByUsername(user.getName()) - .stream() - .map(s -> scenePriorityRepository.findAllBySceneId(s.getId())) - .flatMap(Collection::stream) - .distinct() - .map( - t -> - automationRepository - .findById(t.getAutomationId()) - .orElseThrow(IllegalStateException::new)) - .distinct() - .collect(Collectors.toList()); + final Long userId = userService.findByUsername(principal.getName()).getId(); + return automationRepository.findAllByUserId(userId); } @GetMapping("/{id}") @@ -56,25 +46,31 @@ public class AutomationController { return automationRepository.findById(id).orElseThrow(NotFoundException::new); } - private Automation save(Automation newRL, AutomationSaveRequest s) { + private Automation save(Automation newRL, AutomationSaveRequest s, Principal principal) { + + final Long userId = userService.findByUsername(principal.getName()).getId(); newRL.setName(s.getName()); + newRL.setUserId(userId); return automationRepository.save(newRL); } @PostMapping - public Automation create(@Valid @RequestBody AutomationSaveRequest automationSaveRequest) { - return save(new Automation(), automationSaveRequest); + public Automation create( + @Valid @RequestBody AutomationSaveRequest automationSaveRequest, Principal principal) { + return save(new Automation(), automationSaveRequest, principal); } @PutMapping - public Automation update(@Valid @RequestBody AutomationSaveRequest automation) + public Automation update( + @Valid @RequestBody AutomationSaveRequest automation, Principal principal) throws NotFoundException { return save( automationRepository .findById(automation.getId()) .orElseThrow(NotFoundException::new), - automation); + automation, + principal); } @DeleteMapping("/{id}") 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 27bda84..17d5bfc 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 @@ -17,6 +17,16 @@ public class Automation { @ApiModelProperty(hidden = true) private long id; + @ManyToOne + @JoinColumn(name = "user_id", updatable = false, insertable = false) + @GsonExclude + private User user; + + @NotNull + @Column(name = "user_id", nullable = false) + @GsonExclude + private Long userId; + @OneToMany(mappedBy = "automation", orphanRemoval = true) @GsonExclude private Set> triggers = new HashSet<>(); @@ -50,4 +60,20 @@ public class Automation { public void setName(String name) { this.name = name; } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } } diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/AutomationRepository.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/AutomationRepository.java index b8b2ac2..a54a9ee 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/AutomationRepository.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/AutomationRepository.java @@ -1,5 +1,10 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; +import java.util.List; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; -public interface AutomationRepository extends CrudRepository {} +public interface AutomationRepository extends CrudRepository { + + List findAllByUserId(@Param("userId") long userId); +} From 579dcaacfdbf7c7fd8e102d91c0394d820bf5181 Mon Sep 17 00:00:00 2001 From: "Claudio Maggioni (maggicl)" Date: Mon, 27 Apr 2020 14:28:34 +0200 Subject: [PATCH 5/6] fix @SocketGsonExclude on device and children --- .../smarthut/controller/RangeTriggerController.java | 4 ++-- .../ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmable.java | 2 ++ .../ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmer.java | 2 ++ .../ch/usi/inf/sa4/sanmarinoes/smarthut/models/Switch.java | 2 ++ .../usi/inf/sa4/sanmarinoes/smarthut/models/Switchable.java | 2 ++ .../usi/inf/sa4/sanmarinoes/smarthut/models/Thermostat.java | 2 ++ 6 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/RangeTriggerController.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/RangeTriggerController.java index 7043566..655ce4b 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/RangeTriggerController.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/RangeTriggerController.java @@ -29,7 +29,7 @@ public class RangeTriggerController { return rangeTriggerRepository.findAllByAutomationId(automationId); } - private RangeTrigger save(RangeTrigger newRL, RangeTriggerSaveRequest s) { + private RangeTrigger save(RangeTrigger newRL, RangeTriggerSaveRequest s) { newRL.setDeviceId(s.getDeviceId()); newRL.setAutomationId(s.getAutomationId()); newRL.setOperator(s.getOperator()); @@ -41,7 +41,7 @@ public class RangeTriggerController { @PostMapping public RangeTrigger create( @Valid @RequestBody RangeTriggerSaveRequest booleanTriggerSaveRequest) { - return save(new RangeTrigger(), booleanTriggerSaveRequest); + return save(new RangeTrigger<>(), booleanTriggerSaveRequest); } @PutMapping diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmable.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmable.java index ab49dd0..6ae3150 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmable.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmable.java @@ -1,6 +1,7 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; import ch.usi.inf.sa4.sanmarinoes.smarthut.config.GsonExclude; +import ch.usi.inf.sa4.sanmarinoes.smarthut.config.SocketGsonExclude; import java.util.Set; import javax.persistence.*; import javax.validation.constraints.Max; @@ -23,6 +24,7 @@ public class Dimmable extends Switchable implements RangeTriggerable { @ManyToMany(mappedBy = "dimmables", cascade = CascadeType.DETACH) @GsonExclude + @SocketGsonExclude private Set dimmers; /** The light intensity value. Goes from 0 (off) to 100 (on) */ diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmer.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmer.java index 9b3d627..e920d2f 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmer.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmer.java @@ -1,6 +1,7 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; import ch.usi.inf.sa4.sanmarinoes.smarthut.config.GsonExclude; +import ch.usi.inf.sa4.sanmarinoes.smarthut.config.SocketGsonExclude; import java.util.HashSet; import java.util.Set; import javax.persistence.*; @@ -15,6 +16,7 @@ public abstract class Dimmer extends InputDevice { @ManyToMany(cascade = CascadeType.DETACH) @GsonExclude + @SocketGsonExclude @JoinTable( name = "dimmer_dimmable", joinColumns = @JoinColumn(name = "dimmer_id"), diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Switch.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Switch.java index 0768d6b..4b9ef3a 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Switch.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Switch.java @@ -1,6 +1,7 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; import ch.usi.inf.sa4.sanmarinoes.smarthut.config.GsonExclude; +import ch.usi.inf.sa4.sanmarinoes.smarthut.config.SocketGsonExclude; import java.util.HashSet; import java.util.Set; import javax.persistence.*; @@ -11,6 +12,7 @@ public class Switch extends InputDevice implements BooleanTriggerable { @ManyToMany(cascade = CascadeType.DETACH) @GsonExclude + @SocketGsonExclude @JoinTable( name = "switch_switchable", joinColumns = @JoinColumn(name = "switch_id"), diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Switchable.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Switchable.java index 7fbc64a..c7abc7e 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Switchable.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Switchable.java @@ -1,6 +1,7 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; import ch.usi.inf.sa4.sanmarinoes.smarthut.config.GsonExclude; +import ch.usi.inf.sa4.sanmarinoes.smarthut.config.SocketGsonExclude; import java.util.HashSet; import java.util.Set; import javax.persistence.*; @@ -15,6 +16,7 @@ public abstract class Switchable extends OutputDevice { @ManyToMany(mappedBy = "switchables", cascade = CascadeType.DETACH) @GsonExclude + @SocketGsonExclude private Set inputs = new HashSet<>(); protected Switchable(String kind) { diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Thermostat.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Thermostat.java index 2dd3772..689c7ee 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Thermostat.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Thermostat.java @@ -1,6 +1,7 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; import ch.usi.inf.sa4.sanmarinoes.smarthut.config.GsonExclude; +import ch.usi.inf.sa4.sanmarinoes.smarthut.config.SocketGsonExclude; import com.google.gson.annotations.SerializedName; import java.math.BigDecimal; import java.util.HashSet; @@ -87,6 +88,7 @@ public class Thermostat extends Switchable implements BooleanTriggerable { @OneToMany(mappedBy = "scene", orphanRemoval = true) @GsonExclude + @SocketGsonExclude private Set> triggers = new HashSet<>(); /** Creates a thermostat with a temperature sensor and its initial OFF state */ From c1147f02ae77d96a557eb75908de0cc3308afa41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Cape=C3=A1ns=20P=C3=A9rez?= Date: Mon, 27 Apr 2020 17:03:17 +0200 Subject: [PATCH 6/6] fixed some stuff not working on automations --- .../smarthut/controller/ScenePriorityController.java | 4 ---- .../inf/sa4/sanmarinoes/smarthut/models/ScenePriority.java | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/ScenePriorityController.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/ScenePriorityController.java index 8711d57..6e95f75 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/ScenePriorityController.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/ScenePriorityController.java @@ -24,10 +24,6 @@ public class ScenePriorityController { @Autowired ScenePriorityRepository scenePriorityRepository; - @GetMapping("/{id}") - public ScenePriority get(@PathVariable long id) throws NotFoundException { - return scenePriorityRepository.findById(id).orElseThrow(NotFoundException::new); - } @GetMapping("/{automationId}") public List getByAutomationId(@PathVariable long automationId) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriority.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriority.java index d34714b..04586d9 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriority.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriority.java @@ -41,7 +41,7 @@ public class ScenePriority { @GsonExclude private Scene scene; - @Column(name = "scene_id", nullable = false, updatable = false, unique = true) + @Column(name = "scene_id", nullable = false, updatable = false) @NotNull private Long sceneId;