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 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
|
// Generated 5 avr. 2012 23:43:32 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.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.search.annotations.Analyze;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.IndexedEmbedded;
import org.hibernate.search.annotations.Store;
/**
* Utilisateur generated by hbm2java
*/
@Entity
@Indexed
@Table(name = "UTILISATEUR", schema = "ADM")
public class Utilisateur implements java.io.Serializable {
private String codeutilisateur;
private Service service;
@Field(index=Index.YES, analyze=Analyze.YES, store=Store.NO)
private String nomutilisateur;
private String telephone;
private String mail;
private Set<Service> services = new HashSet<Service>(0);
@IndexedEmbedded
private Set<Profil> profils = new HashSet<Profil>(0);
public Utilisateur() {
}
public Utilisateur(String codeutilisateur, Service service,
String nomutilisateur, String telephone, String mail) {
this.codeutilisateur = codeutilisateur;
this.service = service;
this.nomutilisateur = nomutilisateur;
this.telephone = telephone;
this.mail = mail;
}
public Utilisateur(String codeutilisateur, Service service,
String nomutilisateur, String telephone, String mail,
Set<Service> services, Set<Profil> profils) {
this.codeutilisateur = codeutilisateur;
this.service = service;
this.nomutilisateur = nomutilisateur;
this.telephone = telephone;
this.mail = mail;
this.services = services;
this.profils = profils;
}
@Id
@Column(name = "CODEUTILISATEUR", unique = true, nullable = false, length = 50)
public String getCodeutilisateur() {
return this.codeutilisateur;
}
public void setCodeutilisateur(String codeutilisateur) {
this.codeutilisateur = codeutilisateur;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CODESERVICE", nullable = false)
public Service getService() {
return this.service;
}
public void setService(Service service) {
this.service = service;
}
@Column(name = "NOMUTILISATEUR", nullable = false, length = 50)
public String getNomutilisateur() {
return this.nomutilisateur;
}
public void setNomutilisateur(String nomutilisateur) {
this.nomutilisateur = nomutilisateur;
}
@Column(name = "TELEPHONE", nullable = false, length = 50)
public String getTelephone() {
return this.telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
@Column(name = "MAIL", nullable = false, length = 50)
public String getMail() {
return this.mail;
}
public void setMail(String mail) {
this.mail = mail;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "utilisateur")
public Set<Service> getServices() {
return this.services;
}
public void setServices(Set<Service> services) {
this.services = services;
}
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(name = "UTILISATEURPROFIL", schema = "ADM", joinColumns = { @JoinColumn(name = "CODEUTILISATEUR", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "IDPROFIL", nullable = false, updatable = false) })
public Set<Profil> getProfils() {
return this.profils;
}
public void setProfils(Set<Profil> profils) {
this.profils = profils;
}
public void addToProfil(Profil profil) {
this.getProfils().add(profil);
profil.getUtilisateurs().add(this);
}
public void removeFromProfil(Profil profil) {
this.getProfils().remove(profil);
profil.getUtilisateurs().remove(this);
}
} |
Partager