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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113 | package com.eisti.models.Station;
import com.eisti.account.Account;
import com.eisti.models.Contract.Contract;
import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Entity
@Table(name = "stations")
public class Station implements Serializable{
@Id
@GeneratedValue
private long id;
private String address;
private String name;
@ManyToMany(mappedBy = "favorites", cascade = CascadeType.PERSIST, fetch = FetchType.EAGER)
private List<Account> accounts;
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="contract_id")
private Contract contract;
private String gps;
private boolean banking;
private boolean bonus;
public Station(){
this.accounts = new ArrayList<>();
}
public Station(String address, String name, Contract contract, String gps, boolean banking, boolean bonus) {
this();
this.address = address;
this.name = name;
this.contract = contract;
this.gps = gps;
this.banking = banking;
this.bonus = bonus;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getGPSPosition() {
return gps;
}
public void setGPSPosition(String gps) { this.gps = gps; }
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isBanking() {
return banking;
}
public void setBanking(boolean banking) {
this.banking = banking;
}
public boolean isBonus() {
return bonus;
}
public void setBonus(boolean bonus) {
this.bonus = bonus;
}
public Contract getContract() {
return contract;
}
public void setContract(Contract contract) {
this.contract = contract;
}
public List<Account> getAccounts() {
return accounts;
}
public void setAccounts(List<Account> accounts) {
this.accounts = accounts;
}
}
|