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
| @Entity
@Table(name = "participants")
@XmlRootElement
@NamedNativeQueries({
@NamedNativeQuery(name = "getAllParticipants", query = "SELECT codesoc,numcont, matricule, prenom, nom, sexe, datenaiss, nbenfant, nbfemme, "
+" date_part('year', age(CURRENT_DATE,dateemb)) as anc, adresse, "
+" date_part('year', age(CURRENT_DATE,datenaiss)) as agepart, dateemb,"
+" date_part('year', age(annee_retraite(datenaiss), CURRENT_DATE)) AS anrest,"
+" typecontrat, categprof"
+" FROM participants "
+" ORDER BY matricule", resultClass = Participants.class)}
)
public class Participants implements Serializable {
private static final long serialVersionUID = 1L;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 10)
@Column(name = "matricule")
private String matricule;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 20)
@Column(name = "matipm")
private String matipm;
@Size(max = 30)
@Column(name = "nom")
private String nom;
@Size(max = 50)
@Column(name = "prenom")
private String prenom;
@Size(max = 2)
@Column(name = "sexe")
private String sexe;
@Size(max = 20)
@Column(name = "sitfam")
private String sitfam;
@Column(name = "datenaiss")
@Temporal(TemporalType.DATE)
private Date datenaiss;
@Size(max = 60)
@Column(name = "lieunaiss")
private String lieunaiss;
@Size(max = 25)
@Column(name = "region")
private String region;
@Size(max = 30)
@Column(name = "pays")
private String pays;
@Size(max = 100)
@Column(name = "adresse")
private String adresse;
@Size(max = 20)
@Column(name = "portable")
private String portable;
// @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 = 100)
@Column(name = "email")
private String email;
@Column(name = "dateemb")
@Temporal(TemporalType.DATE)
private Date dateemb;
@Id
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 15)
@Column(name = "numcont")
private String numcont;
@Size(max = 2)
@Column(name = "etatcont")
private String etatcont;
@Column(name = "datesous")
@Temporal(TemporalType.TIMESTAMP)
private Date datesous;
@Column(name = "dateres")
@Temporal(TemporalType.DATE)
private Date dateres;
@Size(max = 2)
@Column(name = "codesoc")
private String codesoc;
@Size(max = 5)
@Column(name = "compte")
private String compte;
@Column(name = "numfiche")
private Integer numfiche;
@Column(name = "datedebcarte")
@Temporal(TemporalType.TIMESTAMP)
private Date datedebcarte;
@Column(name = "datefincarte")
@Temporal(TemporalType.DATE)
private Date datefincarte;
@Column(name = "nbfemme")
private Short nbfemme;
@Column(name = "nbenfant")
private Short nbenfant;
@Column(name = "dateradiation")
@Temporal(TemporalType.DATE)
private Date dateradiation;
@Size(max = 20)
@Column(name = "cin")
private String cin;
@Column(name = "typecontrat")
private Character typecontrat;
@Size(max = 20)
@Column(name = "categprof")
private String categprof;
@Column(name = "ajout")
private Character ajout;
@Column(name = "datecreationpart")
@Temporal(TemporalType.TIMESTAMP)
private Date datecreationpart;
@Size(max = 30)
@Column(name = "photo")
private String photo;
@Size(max = 2)
@Column(name = "indic")
private String indic;
@JoinColumn(name = "codeaffect", referencedColumnName = "codeaffect")
@ManyToOne
private Affectations codeaffect;
@JoinColumn(name = "codeserv", referencedColumnName = "codeserv")
@ManyToOne
private Services codeserv;
private int agepart = 0;
private int anc = 0;
private int anrest = 0;
public Participants() {
}
getters/setters ... |
Partager