1 |
package dk.thoerup.pictureposterservice; |
2 |
|
3 |
|
4 |
import java.util.Date; |
5 |
import java.util.Set; |
6 |
|
7 |
|
8 |
import javax.persistence.*; |
9 |
|
10 |
@Entity |
11 |
@Table(name="posting") |
12 |
public class Posting { |
13 |
@Id |
14 |
@GeneratedValue(strategy=GenerationType.IDENTITY) |
15 |
int id; |
16 |
|
17 |
@Column(name = "title") |
18 |
String title; |
19 |
|
20 |
@Column(name = "note") |
21 |
String note; |
22 |
|
23 |
@Column(name = "latitude") |
24 |
double latitude; |
25 |
|
26 |
@Column(name = "longitude") |
27 |
double longitude; |
28 |
|
29 |
@Column(name = "author") |
30 |
String author; |
31 |
|
32 |
@Column(name = "postdate") |
33 |
Date postdate; |
34 |
|
35 |
@OneToMany |
36 |
@JoinColumn(name="postId") |
37 |
Set<Comment> comments; |
38 |
|
39 |
public int getId() { |
40 |
return id; |
41 |
} |
42 |
|
43 |
|
44 |
public String getTitle() { |
45 |
return title; |
46 |
} |
47 |
|
48 |
public void setTitle(String title) { |
49 |
this.title = title; |
50 |
} |
51 |
|
52 |
public String getNote() { |
53 |
return note; |
54 |
} |
55 |
|
56 |
public void setNote(String note) { |
57 |
this.note = note; |
58 |
} |
59 |
|
60 |
public double getLatitude() { |
61 |
return latitude; |
62 |
} |
63 |
|
64 |
public void setLatitude(double latitude) { |
65 |
this.latitude = latitude; |
66 |
} |
67 |
|
68 |
public double getLongitude() { |
69 |
return longitude; |
70 |
} |
71 |
|
72 |
public void setLongitude(double longitude) { |
73 |
this.longitude = longitude; |
74 |
} |
75 |
|
76 |
public String getAuthor() { |
77 |
return author; |
78 |
} |
79 |
|
80 |
public void setAuthor(String author) { |
81 |
this.author = author; |
82 |
} |
83 |
|
84 |
public Date getPostdate() { |
85 |
return postdate; |
86 |
} |
87 |
|
88 |
public void setPostdate(Date postdate) { |
89 |
this.postdate = postdate; |
90 |
} |
91 |
|
92 |
public Set<Comment> getComments() { |
93 |
return comments; |
94 |
} |
95 |
|
96 |
public void setComments(Set<Comment> comments) { |
97 |
this.comments = comments; |
98 |
} |
99 |
|
100 |
|
101 |
|
102 |
} |