Rev 883 | Blame | Last modification | View Log | RSS feed
package org.tela_botanica.client.modeles;import com.google.gwt.json.client.JSONObject;public class CollectionAPersonne extends aDonnee {private static final long serialVersionUID = 1L;public static final String PREFIXE = "ccap";private Personne personneLiee = null;public CollectionAPersonne() {initialiser(new JSONObject());}public CollectionAPersonne(JSONObject collectionAPersonneListe) {initialiser(collectionAPersonneListe);}@Overrideprotected String getPrefixe() {return PREFIXE;}private void initialiser(JSONObject collectionAPersonneListe) {setPersonne(new Personne(collectionAPersonneListe));initialiserModele(collectionAPersonneListe);initialiserChampsPourGrille();}// PERSONNEpublic Personne getPersonne() {return personneLiee;}public void setPersonne(Personne personne) {personneLiee = personne;initialiserChampsPourGrille();if (personne != null) {setIdPersonne(personne.getId());}}private void initialiserChampsPourGrille() {set("_role_", getIdRole());set("fmt_nom_complet", getPersonne().getNomComplet());set("nom", getPersonne().getNom());set("prenom", getPersonne().getPrenom());set("naissance_date", getPersonne().getNaissanceDate());set("naissance_lieu", getPersonne().getNaissanceLieu());set("_deces_", getPersonne().getDeces());set("deces_date", getPersonne().getDecesDate());set("deces_lieu", getPersonne().getDecesLieu());set("_etat_", "");}// ID/** Génère un identifiant de CollectionAPersonne.** C'est une concaténation des clés primaires de la table coel_collection_a_personne séparées par un tiret "-".** @return identifiant unique d'une relation "collection à personne".*/public String getId() {String idCollection = getIdCollection();String idPersonne = getIdPersonne();String idRole = getIdRole();if (idCollection.equals("") && idPersonne.equals("") && idRole.equals("")) {return null;} else {return (idCollection+"-"+idPersonne+"-"+idRole);}}//+---------------------------------------------------------------------------------------------------------------+// CHAMPS PROVENANT de la TABLE COEL_COLLECTION_A_PERSONNE// ID COLLECTIONpublic String getIdCollection() {return renvoyerValeurCorrecte("id_collection");}public void setIdCollection(String idCollection) {set("id_collection", idCollection);}// ID PERSONNEpublic String getIdPersonne() {return renvoyerValeurCorrecte("id_personne");}public void setIdPersonne(String ip) {set("id_personne", ip);}// ID RôLEpublic String getIdRole() {return renvoyerValeurCorrecte("id_role");}public void setIdRole(String ir) {set("id_role", ir);}}