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 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370
|
/*
* 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 fr.ietevents.client.Entity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author IETEVENTS
*/
@Entity
@Table(name = "Personne")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Personne.findAll", query = "SELECT p FROM Personne p"),
@NamedQuery(name = "Personne.findByKeyClient", query = "SELECT p FROM Personne p WHERE p.keyClient = :keyClient"),
@NamedQuery(name = "Personne.CountPersonneParPay", query = "SELECT COUNT(p) FROM Personne p JOIN p.sessionCollection sc WHERE sc.keySession = :keySession and p.entreprise.adresse.localite.pays.keyPays = :keyPays and P.dateCreation BETWEEN :StatDate and :endate and p.typeInscription = :typeInscription"),
@NamedQuery(name = "Personne.CountPersonneLocalite", query = "SELECT COUNT(p) FROM Personne p JOIN p.sessionCollection sc WHERE sc.keySession = :keySession and p.entreprise.adresse.localite.ville = :keyVille and P.dateCreation BETWEEN :StatDate and :endate and p.typeInscription = :typeInscription"),
@NamedQuery(name = "Personne.CountPersonneTotal", query = "SELECT COUNT(p) FROM Personne p JOIN p.sessionCollection sc WHERE sc.keySession = :keySession and P.dateCreation BETWEEN :StatDate and :endate and p.typeInscription = :typeInscription"),
@NamedQuery(name = "Personne.findByNom", query = "SELECT p FROM Personne p WHERE p.nom = :nom"),
@NamedQuery(name = "Personne.findByPrenom", query = "SELECT p FROM Personne p WHERE p.prenom = :prenom"),
@NamedQuery(name = "Personne.findByEmail", query = "SELECT p FROM Personne p WHERE p.email = :email"),
@NamedQuery(name = "Personne.findByTelephone", query = "SELECT p FROM Personne p WHERE p.telephone = :telephone"),
@NamedQuery(name = "Personne.findByPortable", query = "SELECT p FROM Personne p WHERE p.portable = :portable"),
@NamedQuery(name = "Personne.findByFax", query = "SELECT p FROM Personne p WHERE p.fax = :fax"),
@NamedQuery(name = "Personne.findByDateModification", query = "SELECT p FROM Personne p WHERE p.dateModification = :dateModification"),
@NamedQuery(name = "Personne.findByDateCreation", query = "SELECT p FROM Personne p WHERE p.dateCreation = :dateCreation"),
@NamedQuery(name = "Personne.findByActif", query = "SELECT p FROM Personne p WHERE p.actif = :actif")})
public class Personne implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Column(name = "KeyClient")
private String keyClient;
@Size(max = 255)
@Column(name = "Nom")
private String nom;
@Size(max = 255)
@Column(name = "Prenom")
private String prenom;
// @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
@Size(max = 255)
@Column(name = "Email")
private String email;
@Size(max = 255)
@Column(name = "Telephone")
private String telephone;
@Size(max = 255)
@Column(name = "Portable")
private String portable;
@Size(max = 255)
@Column(name = "TypeInscription")
private String typeInscription;
// @Pattern(regexp="^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$", message="Invalid phone/fax format, should be as xxx-xxx-xxxx")//if the field contains phone or fax number consider using this annotation to enforce field validation
@Size(max = 255)
@Column(name = "Fax")
private String fax;
@Column(name = "DateModification")
@Temporal(TemporalType.DATE)
private Date dateModification;
@Column(name = "DateCreation")
@Temporal(TemporalType.DATE)
private Date dateCreation;
@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "KeyTypeUser")
private TypeUser typeUser;
@Size(max = 1)
@Column(name = "actif")
private String actif;
@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "KeyEntreprise")
private Entreprise entreprise;
@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "KeyCivilite")
private Civilite civilite;
@OneToMany(mappedBy = "personne",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
private List<Login> loginCollection;
@OneToMany(mappedBy = "personne",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
private List<SourceInscription> sourceInscriptionCollection;
@OneToMany(mappedBy = "personne",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
private List<CorrespondanceImportation> CorrespondanceImportationCollection;
@OneToMany(mappedBy = "personne",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
private List<Hotesse> hotesseCollection;
@OneToMany(mappedBy = "personne",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
private List<Passage> passageCollection;
@OneToMany(mappedBy = "personne",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
private List<Produit> produitCollection;
@OneToMany(mappedBy = "personne",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
private List<Droit> droitCollection;
@OneToMany(mappedBy = "personne",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
private List<ReponseClient> reponseClientCollection;
@OneToMany(mappedBy = "utilisateurSource",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
private List<SourceInscription> PersonneUtilisateurSourceCollection;
@OneToMany(mappedBy = "personne",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
private List<AutreInformation> autreInformationCollection;
@OneToMany(mappedBy = "personne",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
private List<CrmLien> CrmLienCollection;
@ManyToMany(cascade = CascadeType.ALL)
private List<Session> sessionCollection;
public Personne() {
}
public Personne(String keyClient) {
this.keyClient = keyClient;
}
public String getKeyClient() {
return keyClient;
}
public void setKeyClient(String keyClient) {
this.keyClient = keyClient;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
public String getTypeInscription() {
return typeInscription;
}
public void setTypeInscription(String typeInscription) {
this.typeInscription = typeInscription;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getPortable() {
return portable;
}
public void setPortable(String portable) {
this.portable = portable;
}
public String getFax() {
return fax;
}
public void setFax(String fax) {
this.fax = fax;
}
public Date getDateModification() {
return dateModification;
}
public void setDateModification(Date dateModification) {
this.dateModification = dateModification;
}
public Date getDateCreation() {
return dateCreation;
}
public void setDateCreation(Date dateCreation) {
this.dateCreation = dateCreation;
}
public String getActif() {
return actif;
}
public void setActif(String actif) {
this.actif = actif;
}
public TypeUser getTypeUser() {
return typeUser;
}
public void setTypeUser(TypeUser typeUser) {
this.typeUser = typeUser;
}
@XmlTransient
public List<Login> getLoginCollection() {
return loginCollection;
}
public void setLoginCollection(List<Login> loginCollection) {
this.loginCollection = loginCollection;
}
@XmlTransient
public List<CrmLien> getCrmLienCollection() {
return CrmLienCollection;
}
public void setCrmLienCollection(List<CrmLien> CrmLienCollection) {
this.CrmLienCollection = CrmLienCollection;
}
@XmlTransient
public List<SourceInscription> getSourceInscriptionCollection() {
return sourceInscriptionCollection;
}
public void setSourceInscriptionCollection(List<SourceInscription> sourceInscriptionCollection) {
this.sourceInscriptionCollection = sourceInscriptionCollection;
}
public Entreprise getEntreprise() {
return entreprise;
}
public void setEntreprise(Entreprise entreprise) {
this.entreprise = entreprise;
}
@XmlTransient
public List<CorrespondanceImportation> getCorrespondanceImportationCollection() {
return CorrespondanceImportationCollection;
}
public void setCorrespondanceImportationCollection(List<CorrespondanceImportation> CorrespondanceImportationCollection) {
this.CorrespondanceImportationCollection = CorrespondanceImportationCollection;
}
public Civilite getCivilite() {
return civilite;
}
public void setCivilite(Civilite civilite) {
this.civilite = civilite;
}
@XmlTransient
public List<Hotesse> getHotesseCollection() {
return hotesseCollection;
}
public void setHotesseCollection(List<Hotesse> hotesseCollection) {
this.hotesseCollection = hotesseCollection;
}
@XmlTransient
public List<Passage> getPassageCollection() {
return passageCollection;
}
public void setPassageCollection(List<Passage> passageCollection) {
this.passageCollection = passageCollection;
}
@XmlTransient
public List<SourceInscription> getPersonneUtilisateurSourceCollection() {
return PersonneUtilisateurSourceCollection;
}
public void setPersonneUtilisateurSourceCollection(List<SourceInscription> PersonneUtilisateurSourceCollection) {
this.PersonneUtilisateurSourceCollection = PersonneUtilisateurSourceCollection;
}
@XmlTransient
public List<Produit> getProduitCollection() {
return produitCollection;
}
public void setProduitCollection(List<Produit> produitCollection) {
this.produitCollection = produitCollection;
}
@XmlTransient
public List<Droit> getDroitCollection() {
return droitCollection;
}
public void setDroitCollection(List<Droit> droitCollection) {
this.droitCollection = droitCollection;
}
@XmlTransient
public List<ReponseClient> getReponseClientCollection() {
return reponseClientCollection;
}
public void setReponseClientCollection(List<ReponseClient> reponseClientCollection) {
this.reponseClientCollection = reponseClientCollection;
}
@XmlTransient
public List<AutreInformation> getAutreInformationCollection() {
return autreInformationCollection;
}
public void setAutreInformationCollection(List<AutreInformation> autreInformationCollection) {
this.autreInformationCollection = autreInformationCollection;
}
@XmlTransient
public List<Session> getSessionCollection() {
return sessionCollection;
}
public void setSessionCollection(List<Session> sessionCollection) {
this.sessionCollection = sessionCollection;
}
@Override
public int hashCode() {
int hash = 0;
hash += (keyClient != null ? keyClient.hashCode() : 0);
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 Personne)) {
return false;
}
Personne other = (Personne) object;
if ((this.keyClient == null && other.keyClient != null) || (this.keyClient != null && !this.keyClient.equals(other.keyClient))) {
return false;
}
return true;
}
@Override
public String toString() {
return "fr.ietevents.client.Entity.Personne[ keyClient=" + keyClient + " ]";
}
} |
Partager