Jean-Francois Leveque

Editeur a maintenant un pays

package org.legrog.entities;
import javax.persistence.*;
@Entity
//@Table(name="pays")
public class Country /* extends org.roliste.data.DbEntity */ {
// @Column(name = "ID_PAYS")
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int countryId;
private String countryName;
public int getCountryId() {
return countryId;
}
public void setCountryId(int countryId) {
this.countryId = countryId;
}
public String getCountryName() {
return countryName;
}
public void setCountryName(String countryName) {
this.countryName = countryName;
}
/**
* Returns a string representation of this country definition.
* @return a string representing this country definition.
* @hidden
*/
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append("ID_PAYS=");
sb.append(countryId);
sb.append(" LIB_PAYS=");
sb.append(countryName);
return sb.toString();
}
}
\ No newline at end of file
......@@ -14,8 +14,8 @@ public class PublisherRevision {
private String publisherPostOfficeBoxNumber;
private String publisherAddressRegion;
private String publisherAddressLocality;
// TODO Créer l'entité Country
// private Country publisherAddressCountry;
@ManyToOne
private Country publisherAddressCountry;
private String publisherTelephone;
private String publisherEmail;
private String publisherURL;
......@@ -128,4 +128,20 @@ public class PublisherRevision {
public void setPublisherName(String publisherName) {
this.publisherName = publisherName;
}
public Country getPublisherAddressCountry() {
return publisherAddressCountry;
}
public void setPublisherAddressCountry(Country publisherAddressCountry) {
this.publisherAddressCountry = publisherAddressCountry;
}
public User getPublisherRevisionAuthor() {
return publisherRevisionAuthor;
}
public void setPublisherRevisionAuthor(User publisherRevisionAuthor) {
this.publisherRevisionAuthor = publisherRevisionAuthor;
}
}
\ No newline at end of file
......