45 lines
861 B
Java
45 lines
861 B
Java
package de.ph87.homeautomation.schedule.astro;
|
|
|
|
import jakarta.persistence.*;
|
|
import lombok.Getter;
|
|
import lombok.NoArgsConstructor;
|
|
import lombok.Setter;
|
|
import lombok.ToString;
|
|
import org.springframework.lang.NonNull;
|
|
import org.springframework.lang.Nullable;
|
|
|
|
@Entity
|
|
@Getter
|
|
@ToString
|
|
@NoArgsConstructor
|
|
public class Astro {
|
|
|
|
@Id
|
|
@GeneratedValue
|
|
private long id;
|
|
|
|
@Version
|
|
private long version;
|
|
|
|
@Setter
|
|
private boolean enabled = true;
|
|
|
|
@Setter
|
|
private String error;
|
|
|
|
@Column(unique = true)
|
|
private double zenith;
|
|
|
|
@Column(nullable = false)
|
|
private String name;
|
|
|
|
private String differentNameForSunset;
|
|
|
|
public Astro(final double zenith, @NonNull final String name, @Nullable final String differentNameForSunset) {
|
|
this.zenith = zenith;
|
|
this.name = name;
|
|
this.differentNameForSunset = differentNameForSunset;
|
|
}
|
|
|
|
}
|