View Javadoc
1   package de.dlr.shepard.labJournal.entities;
2   
3   import de.dlr.shepard.neo4Core.entities.AbstractEntity;
4   import de.dlr.shepard.neo4Core.entities.DataObject;
5   import de.dlr.shepard.util.Constants;
6   import de.dlr.shepard.util.HasId;
7   import lombok.Getter;
8   import lombok.NoArgsConstructor;
9   import lombok.Setter;
10  import lombok.ToString;
11  import org.neo4j.ogm.annotation.NodeEntity;
12  import org.neo4j.ogm.annotation.Relationship;
13  import org.neo4j.ogm.annotation.Relationship.Direction;
14  
15  @NodeEntity
16  @Getter
17  @Setter
18  @ToString
19  @NoArgsConstructor
20  public class LabJournalEntry extends AbstractEntity {
21  
22    private String content;
23  
24    @Relationship(type = Constants.HAS_LABJOURNAL_ENTRY, direction = Direction.INCOMING)
25    private DataObject dataObject;
26  
27    @Override
28    public boolean equals(Object obj) {
29      if (!(obj instanceof LabJournalEntry)) return false;
30      LabJournalEntry other = (LabJournalEntry) obj;
31      return super.equals(other) && content.equals(other.content) && HasId.equalsHelper(dataObject, other.dataObject);
32    }
33  }