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 95 96 97 98 99 100 101 102
|
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;
import common.utils.FlagActivation;
@Entity
//@Table(catalog="referentiel",name="Personne")
@Table(name="Personne")
public class Personne implements java.io.Serializable {
private static final long serialVersionUID = 1610274747295951644L;
private int id;
private long version;
private String nom;
private String nomJF;
private String prenom;
private String login;
private String password;
private Ville residencePersonnelle;
private FlagActivation flag;
public Personne() {
}
public Personne(String nom, String nomJF, String prenom, String login) {
this.nom = nom;
this.nomJF = nomJF;
this.prenom = prenom;
this.login = login;
}
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public int getId() {
return this.id;
}
@Version
public long getVersion() {
return version;
}
@Column(name="nom",nullable = false)
public String getNom() {
return this.nom;
}
@Column(name="nomJF")
public String getNomJF() {
return this.nomJF;
}
@Column(name="prenom",nullable = false)
public String getPrenom() {
return this.prenom;
}
@Column(name="login",nullable = false,unique=true)
public String getLogin() {
return this.login;
}
@Transient
//@ManyToOne(targetEntity=Ville.class,cascade=javax.persistence.CascadeType.PERSIST )
public Ville getResidencePersonnelle() {
return residencePersonnelle;
}
@Column(name="password",nullable = false)
public String getPassword() {
return password;
}
@Column(name="flag")
@Enumerated(EnumType.STRING)
public FlagActivation getFlag() {
return flag;
} |
Partager