Repository navigation
Expand file tree
/
Copy pathDog.java
More file actions
89 lines (71 loc) · 1.81 KB
/
Copy pathDog.java
File metadata and controls
89 lines (71 loc) · 1.81 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
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.URL;
@Entity
@Table(name="dogs")
public class Dog {
@Id
@SequenceGenerator(name="dog_generator", sequenceName = "dogs_id_seq", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="dog_generator")
@Column(name="id", nullable=false, unique=true)
private Long id;
@NotEmpty
@Column(name="first_name", nullable=false)
private String firstName;
@NotEmpty
@Column(name="last_name", nullable=false)
private String lastName;
@NotNull
@URL
@Column(name="photo_url", nullable=false)
private String photoUrl;
@NotEmpty
@Column(name="breed", nullable=false)
private String breed;
@NotEmpty
@Column(name="sex", nullable=false)
private String sex;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getPhotoUrl() {
return photoUrl;
}
public void setPhotoUrl(String photoUrl) {
this.photoUrl = photoUrl;
}
public String getBreed() {
return breed;
}
public void setBreed(String breed) {
this.breed = breed;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
}