thermostat in an entity now
This commit is contained in:
parent
7cfb2ffc73
commit
7bda571a27
1 changed files with 4 additions and 1 deletions
|
@ -2,9 +2,12 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.OneToOne;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/** A thermostat capable of controlling cooling and heating. */
|
/** A thermostat capable of controlling cooling and heating. */
|
||||||
|
@Entity
|
||||||
public class Thermostat extends InputDevice {
|
public class Thermostat extends InputDevice {
|
||||||
|
|
||||||
enum ThermostatState {
|
enum ThermostatState {
|
||||||
|
@ -18,7 +21,7 @@ public class Thermostat extends InputDevice {
|
||||||
|
|
||||||
@Column @NotNull BigDecimal averageTemperature;
|
@Column @NotNull BigDecimal averageTemperature;
|
||||||
|
|
||||||
@Column @NotNull private final Sensor temperatureSensor;
|
@Column @NotNull @OneToOne private final Sensor temperatureSensor;
|
||||||
|
|
||||||
@Column @NotNull private ThermostatState state;
|
@Column @NotNull private ThermostatState state;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue