Merge branch '63-fix-table-relation-in-trigger' into 'dev'

fix

Closes #63

See merge request sa4-2020/the-sanmarinoes/backend!91
This commit is contained in:
Matteo Omenetti 2020-04-26 14:01:16 +02:00
commit 15c6e99e4e
3 changed files with 1 additions and 7 deletions

View file

@ -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<D extends Device & BooleanTriggerable> extends Trigger<D> {
@Column(name = "switchable_on")

View file

@ -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<D extends Device & RangeTriggerable> extends Trigger<D> {
@Override

View file

@ -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<D extends Device> {
public abstract boolean triggered();