Homeautomation/src/main/java/de/ph87/homeautomation/property/Property.java

44 lines
751 B
Java

package de.ph87.homeautomation.property;
import de.ph87.homeautomation.channel.Channel;
import lombok.*;
import javax.persistence.*;
import java.time.ZonedDateTime;
@Getter
@Setter
@ToString
@Entity
@NoArgsConstructor
public final class Property {
@Id
@GeneratedValue
@Setter(AccessLevel.NONE)
private Long id;
@Column(nullable = false)
@Enumerated(EnumType.STRING)
private PropertyType type;
@Column(nullable = false, unique = true)
private String title;
private ZonedDateTime timestamp;
private Double value;
@ManyToOne
private Channel readChannel;
@ManyToOne
private Channel writeChannel;
public Property(final String title, final PropertyType type) {
this.title = title;
this.type = type;
}
}