-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathPublisher.java
More file actions
94 lines (73 loc) · 2.32 KB
/
Publisher.java
File metadata and controls
94 lines (73 loc) · 2.32 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
package guru.springframework.spring6webapp.domain;
import jakarta.persistence.*;
import java.util.Objects;
import java.util.Set;
@Entity
public class Publisher {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long idPublisher;
private String publisherName;
private String publisherAddress;
private String publisherCity;
private String publisherState;
private String publisherZip;
@OneToMany(mappedBy = "publisher")
private Set<Book> books;
public Long getIdPublisher() {
return idPublisher;
}
public void setIdPublisher(Long idPublisher) {
this.idPublisher = idPublisher;
}
public String getPublisherName() {
return publisherName;
}
public void setPublisherName(String publisherName) {
this.publisherName = publisherName;
}
public String getPublisherAddress() {
return publisherAddress;
}
public void setPublisherAddress(String publisherAddress) {
this.publisherAddress = publisherAddress;
}
public String getPublisherCity() {
return publisherCity;
}
public void setPublisherCity(String publisherCity) {
this.publisherCity = publisherCity;
}
public String getPublisherState() {
return publisherState;
}
public void setPublisherState(String publisherState) {
this.publisherState = publisherState;
}
public String getPublisherZip() {
return publisherZip;
}
public void setPublisherZip(String publisherZip) {
this.publisherZip = publisherZip;
}
@Override
public String toString() {
return "Publisher{" +
"idPublisher=" + idPublisher +
", publisherName='" + publisherName + '\'' +
", publisherAddress='" + publisherAddress + '\'' +
", publisherCity='" + publisherCity + '\'' +
", publisherState='" + publisherState + '\'' +
", publisherZip='" + publisherZip + '\'' +
'}';
}
@Override
public final boolean equals(Object o) {
if (!(o instanceof Publisher publisher)) return false;
return Objects.equals(getIdPublisher(), publisher.getIdPublisher());
}
@Override
public int hashCode() {
return Objects.hashCode(getIdPublisher());
}
}