-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShip.java
More file actions
132 lines (103 loc) · 2.8 KB
/
Copy pathShip.java
File metadata and controls
132 lines (103 loc) · 2.8 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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
package com.space.model;
import javax.persistence.*;
import java.util.Date;
/**
* Domain object what represent ship.
*/
@Entity
@Table(name = "ship")
public class Ship extends AbstractBaseEntity {
@Column(name = "name", length = 50)
private String name;
@Column(name = "planet", length = 50)
private String planet;
@Column(name = "shipType")
@Enumerated(EnumType.STRING)
private ShipType shipType;
@Column(name = "prodDate")
@Temporal(TemporalType.DATE)
private Date prodDate;
@Column(name = "isUsed")
private Boolean isUsed;
@Column(name = "speed", precision = 3, scale = 2)
private Double speed;
@Column(name = "crewSize")
private Integer crewSize;
@Column(name = "rating", precision = 5, scale = 2)
private Double rating;
public Ship(Long id, String name, String planet, ShipType shipType, Date prodDate, Boolean isUsed, Double speed, Integer crewSize, Double rating) {
super(id);
this.name = name;
this.planet = planet;
this.shipType = shipType;
this.prodDate = prodDate;
this.isUsed = isUsed;
this.speed = speed;
this.crewSize = crewSize;
this.rating = rating;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPlanet() {
return planet;
}
public void setPlanet(String planet) {
this.planet = planet;
}
public ShipType getShipType() {
return shipType;
}
public void setShipType(ShipType shipType) {
this.shipType = shipType;
}
public Date getProdDate() {
return prodDate;
}
public void setProdDate(Date prodDate) {
this.prodDate = prodDate;
}
public Boolean getUsed() {
return isUsed;
}
public void setUsed(Boolean used) {
isUsed = used;
}
public Double getSpeed() {
return speed;
}
public void setSpeed(Double sped) {
this.speed = sped;
}
public Integer getCrewSize() {
return crewSize;
}
public void setCrewSize(Integer crewSize) {
this.crewSize = crewSize;
}
public Double getRating() {
return rating;
}
public void setRating(Double rating) {
this.rating = rating;
}
public Ship() {
}
@Override
public String toString() {
return "Ship{" +
"id=" + id +
", name='" + name + '\'' +
", planet='" + planet + '\'' +
", shipType=" + shipType +
", prodDate=" + prodDate +
", isUsed=" + isUsed +
", speed=" + speed +
", crewSize=" + crewSize +
", rating=" + rating +
'}';
}
}