forked from neo4j-examples/movies-java-spring-data-neo4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Movie.java
65 lines (51 loc) · 1.15 KB
/
Movie.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package movies.spring.data.neo4j.domain;
import java.util.ArrayList;
import java.util.List;
import org.neo4j.ogm.annotation.GeneratedValue;
import org.neo4j.ogm.annotation.Id;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Relationship;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
/**
* @author Mark Angrish
*/
@NodeEntity
public class Movie {
@Id
@GeneratedValue
private Long id;
private String title;
private int released;
private String tagline;
@JsonIgnoreProperties("movie")
@Relationship(type = "ACTED_IN", direction = Relationship.INCOMING)
private List<Role> roles;
public Movie() {
}
public Movie(String title, int released, String tagline) {
this.title = title;
this.released = released;
this.tagline = tagline;
}
public Long getId() {
return id;
}
public String getTitle() {
return title;
}
public int getReleased() {
return released;
}
public String getTagline() {
return tagline;
}
public List<Role> getRoles() {
return roles;
}
public void addRole(Role role) {
if (this.roles == null) {
this.roles = new ArrayList<>();
}
this.roles.add(role);
}
}