1 package de.dlr.shepard.context.semantic.entities;
2
3 import de.dlr.shepard.common.util.Constants;
4 import de.dlr.shepard.common.util.HasId;
5 import java.util.ArrayList;
6 import java.util.List;
7 import lombok.Data;
8 import lombok.NoArgsConstructor;
9 import org.neo4j.ogm.annotation.GeneratedValue;
10 import org.neo4j.ogm.annotation.Id;
11 import org.neo4j.ogm.annotation.NodeEntity;
12 import org.neo4j.ogm.annotation.Relationship;
13
14 @NodeEntity
15 @Data
16 @NoArgsConstructor
17 public class AnnotatableTimeseries implements HasId {
18
19 @Id
20 @GeneratedValue
21 private Long id;
22
23 private long containerId;
24
25 private int timeseriesId;
26
27 @Relationship(type = Constants.HAS_ANNOTATION)
28 private List<SemanticAnnotation> annotations = new ArrayList<>();
29
30 public AnnotatableTimeseries(long containerId, int timeseriesId, List<SemanticAnnotation> annotations) {
31 this.containerId = containerId;
32 this.timeseriesId = timeseriesId;
33 this.annotations = annotations;
34 }
35
36 @Override
37 public String getUniqueId() {
38 return String.valueOf(id);
39 }
40 }