Jean-Francois Leveque

Editeur a maintenant un pays

1 +package org.legrog.entities;
2 +
3 +import javax.persistence.*;
4 +
5 +@Entity
6 +//@Table(name="pays")
7 +public class Country /* extends org.roliste.data.DbEntity */ {
8 + // @Column(name = "ID_PAYS")
9 + @Id
10 + @GeneratedValue(strategy = GenerationType.AUTO)
11 + private int countryId;
12 + private String countryName;
13 +
14 + public int getCountryId() {
15 + return countryId;
16 + }
17 +
18 + public void setCountryId(int countryId) {
19 + this.countryId = countryId;
20 + }
21 +
22 + public String getCountryName() {
23 + return countryName;
24 + }
25 +
26 + public void setCountryName(String countryName) {
27 + this.countryName = countryName;
28 + }
29 +
30 + /**
31 + * Returns a string representation of this country definition.
32 + * @return a string representing this country definition.
33 + * @hidden
34 + */
35 + public String toString()
36 + {
37 + StringBuilder sb = new StringBuilder();
38 +
39 + sb.append("ID_PAYS=");
40 + sb.append(countryId);
41 +
42 + sb.append(" LIB_PAYS=");
43 + sb.append(countryName);
44 +
45 + return sb.toString();
46 + }
47 +}
...\ No newline at end of file ...\ No newline at end of file
...@@ -14,8 +14,8 @@ public class PublisherRevision { ...@@ -14,8 +14,8 @@ public class PublisherRevision {
14 private String publisherPostOfficeBoxNumber; 14 private String publisherPostOfficeBoxNumber;
15 private String publisherAddressRegion; 15 private String publisherAddressRegion;
16 private String publisherAddressLocality; 16 private String publisherAddressLocality;
17 - // TODO Créer l'entité Country 17 + @ManyToOne
18 -// private Country publisherAddressCountry; 18 + private Country publisherAddressCountry;
19 private String publisherTelephone; 19 private String publisherTelephone;
20 private String publisherEmail; 20 private String publisherEmail;
21 private String publisherURL; 21 private String publisherURL;
...@@ -128,4 +128,20 @@ public class PublisherRevision { ...@@ -128,4 +128,20 @@ public class PublisherRevision {
128 public void setPublisherName(String publisherName) { 128 public void setPublisherName(String publisherName) {
129 this.publisherName = publisherName; 129 this.publisherName = publisherName;
130 } 130 }
131 +
132 + public Country getPublisherAddressCountry() {
133 + return publisherAddressCountry;
134 + }
135 +
136 + public void setPublisherAddressCountry(Country publisherAddressCountry) {
137 + this.publisherAddressCountry = publisherAddressCountry;
138 + }
139 +
140 + public User getPublisherRevisionAuthor() {
141 + return publisherRevisionAuthor;
142 + }
143 +
144 + public void setPublisherRevisionAuthor(User publisherRevisionAuthor) {
145 + this.publisherRevisionAuthor = publisherRevisionAuthor;
146 + }
131 } 147 }
...\ No newline at end of file ...\ No newline at end of file
......