Location.java
1.02 KB
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
package core.repository;
import javax.persistence.*;
import java.io.Serializable;
/**
* Created by Guillaume on 09/05/2017.
*/
@Entity
@Table(name = "LOCATION")
public class Location implements Serializable {
@Id @GeneratedValue
private int id;
private Double x, y;
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "id", nullable = false)
private Map map;
public Location () {
}
public Location(double posx, double posy, Map map) {
this.x = posx;
this.y = posy;
this.map = map;
}
public Integer getId(){return id;}
public void setId(Integer id){this.id = id;}
public Double getX () {
return x;
}
public void setX (final Double x) {
this.x = x;
}
public Double getY () {
return y;
}
public void setY (final Double y) {
this.y = y;
}
public Map getMap() {
return map;
}
public void setMap(final Map map) {
this.map = map;
}
}