44 lines
763 B
Java
44 lines
763 B
Java
package de.ph87.data.series;
|
|
|
|
import de.ph87.data.value.Value;
|
|
import jakarta.persistence.*;
|
|
import lombok.*;
|
|
|
|
@Entity
|
|
@Getter
|
|
@ToString
|
|
@NoArgsConstructor
|
|
public class Series {
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private long id;
|
|
|
|
@Setter
|
|
@NonNull
|
|
@Column(nullable = false, unique = true)
|
|
private String name;
|
|
|
|
@Setter
|
|
@NonNull
|
|
@Column(nullable = false, unique = true)
|
|
private String title;
|
|
|
|
@Setter
|
|
@NonNull
|
|
@Column(nullable = false)
|
|
@Enumerated(EnumType.STRING)
|
|
private Value.Unit unit;
|
|
|
|
@Setter
|
|
@Column(nullable = false)
|
|
private int decimals = 1;
|
|
|
|
public Series(@NonNull final String name, @NonNull final Value.Unit unit) {
|
|
this.name = name;
|
|
this.title = name;
|
|
this.unit = unit;
|
|
}
|
|
|
|
}
|