Skip to content

Instantly share code, notes, and snippets.

@KFMichael
Created May 11, 2015 18:22
Show Gist options
  • Save KFMichael/5d483e859c5ed0cf5390 to your computer and use it in GitHub Desktop.
Save KFMichael/5d483e859c5ed0cf5390 to your computer and use it in GitHub Desktop.
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
/**
*
* @author vanrise
*/
@Entity
public class Adresse implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
private String nomRue;
private String ville;
private String pays;
private int codePostale;
@ManyToOne
private Contact LeContactAdr;
public Adresse(String nomRue, String ville, String pays, int codePostale) {
this.nomRue = nomRue ;
this.codePostale = codePostale ;
this.pays = pays ;
this.ville = ville ;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Override
public int hashCode() {
int hash = 0;
hash += (int) id;
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Adresse)) {
return false;
}
Adresse other = (Adresse) object;
if (this.id != other.id) {
return false;
}
return true;
}
@Override
public String toString() {
return "entities.Adresse[ id=" + id + " ]";
}
public String getNomRue() {
return nomRue;
}
public void setNomRue(String nomRue) {
this.nomRue = nomRue;
}
public String getVille() {
return ville;
}
public void setVille(String ville) {
this.ville = ville;
}
public String getPays() {
return pays;
}
public void setPays(String pays) {
this.pays = pays;
}
public int getCodePostale() {
return codePostale;
}
public void setCodePostale(int codePostale) {
this.codePostale = codePostale;
}
public Contact getLeContactAdr() {
return LeContactAdr;
}
public void setLeContactAdr(Contact LeContactAdr) {
this.LeContactAdr = LeContactAdr;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment