package com.drakun.annonce.model; // Generated 25 mai 2012 15:20:37 by Hibernate Tools 3.4.0.CR1 import java.util.HashSet; import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import static javax.persistence.GenerationType.IDENTITY; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; /** * Utilisateur generated by hbm2java */ @Entity @Table(name = "utilisateur", catalog = "webannonce") public class Utilisateur implements java.io.Serializable { private Integer idUtilisateur; private Profil profil; private String nom; private String prenom; private String numTel; private String adresse; private String email; private String ville; private String region; private String pays; private String sexe; private String userName; private String password; private Set annonces = new HashSet(0); public Utilisateur() { } public Utilisateur(Profil profil, String nom, String prenom, String numTel, String adresse, String email, String ville, String region, String pays, String sexe, String userName, String password) { this.profil = profil; this.nom = nom; this.prenom = prenom; this.numTel = numTel; this.adresse = adresse; this.email = email; this.ville = ville; this.region = region; this.pays = pays; this.sexe = sexe; this.userName = userName; this.password = password; } public Utilisateur(Profil profil, String nom, String prenom, String numTel, String adresse, String email, String ville, String region, String pays, String sexe, String userName, String password, Set annonces) { this.profil = profil; this.nom = nom; this.prenom = prenom; this.numTel = numTel; this.adresse = adresse; this.email = email; this.ville = ville; this.region = region; this.pays = pays; this.sexe = sexe; this.userName = userName; this.password = password; this.annonces = annonces; } @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "IdUtilisateur", unique = true, nullable = false) public Integer getIdUtilisateur() { return this.idUtilisateur; } public void setIdUtilisateur(Integer idUtilisateur) { this.idUtilisateur = idUtilisateur; } @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "IdCat", nullable = false) public Profil getProfil() { return this.profil; } public void setProfil(Profil profil) { this.profil = profil; } @Column(name = "Nom", nullable = false, length = 45) public String getNom() { return this.nom; } public void setNom(String nom) { this.nom = nom; } @Column(name = "Prenom", nullable = false, length = 45) public String getPrenom() { return this.prenom; } public void setPrenom(String prenom) { this.prenom = prenom; } @Column(name = "NumTel", nullable = false, length = 45) public String getNumTel() { return this.numTel; } public void setNumTel(String numTel) { this.numTel = numTel; } @Column(name = "Adresse", nullable = false, length = 45) public String getAdresse() { return this.adresse; } public void setAdresse(String adresse) { this.adresse = adresse; } @Column(name = "Email", nullable = false, length = 45) public String getEmail() { return this.email; } public void setEmail(String email) { this.email = email; } @Column(name = "Ville", nullable = false, length = 45) public String getVille() { return this.ville; } public void setVille(String ville) { this.ville = ville; } @Column(name = "Region", nullable = false, length = 45) public String getRegion() { return this.region; } public void setRegion(String region) { this.region = region; } @Column(name = "Pays", nullable = false, length = 45) public String getPays() { return this.pays; } public void setPays(String pays) { this.pays = pays; } @Column(name = "Sexe", nullable = false, length = 45) public String getSexe() { return this.sexe; } public void setSexe(String sexe) { this.sexe = sexe; } @Column(name = "UserName", nullable = false, length = 45) public String getUserName() { return this.userName; } public void setUserName(String userName) { this.userName = userName; } @Column(name = "Password", nullable = false, length = 45) public String getPassword() { return this.password; } public void setPassword(String password) { this.password = password; } @OneToMany(fetch = FetchType.EAGER, mappedBy = "utilisateur") public Set getAnnonces() { return this.annonces; } public void setAnnonces(Set annonces) { this.annonces = annonces; } @Override public String toString() { // ADDME Auto-generated method stub return this.getProfil().getCategorie() + " " + this.getNom() + " " + this.getPrenom() + " " + this.getSexe(); } }