001// license-header java merge-point 002// 003// Attention: Generated code! Do not modify by hand! 004// Generated by: hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge. 005// 006package fr.ifremer.adagio.core.dao.administration.user; 007 008/* 009 * #%L 010 * SIH-Adagio :: Core 011 * $Id:$ 012 * $HeadURL:$ 013 * %% 014 * Copyright (C) 2012 - 2014 Ifremer 015 * %% 016 * This program is free software: you can redistribute it and/or modify 017 * it under the terms of the GNU Affero General Public License as published by 018 * the Free Software Foundation, either version 3 of the License, or 019 * (at your option) any later version. 020 * 021 * This program is distributed in the hope that it will be useful, 022 * but WITHOUT ANY WARRANTY; without even the implied warranty of 023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 024 * GNU General Public License for more details. 025 * 026 * You should have received a copy of the GNU Affero General Public License 027 * along with this program. If not, see <http://www.gnu.org/licenses/>. 028 * #L% 029 */ 030 031import java.io.Serializable; 032import java.sql.Timestamp; 033 034/** 035 * <html> 036 * <head> 037 * </head> 038 * <body> 039 * <p> 040 * Liste des profils pouvant être affectés à un utilisateur. 041 * </p> 042 * <p> 043 * Pour la v1, les valeurs identifiées sont : 044 * </p> 045 * <p> 046 * - Administrateur de référentiel (pour info, pas encore de synonyme LDAP) 047 * : donne accès aux fonctionnalités d’aministration du référentiel, ainsi 048 * qu’aux autres fonctionn lité d’administration (ex : 049 * programmes/stratégies). 050 * </p> 051 * <p> 052 * - Observateur (pour info, synonyme LDAP = SIH_ROBS) : donne accès en 053 * consultation sur le référentiel (hors données navires). Si portefeuilles 054 * rattachés à l'observateur, alors droits en saisie sur la fonctionnalité 055 * correspondant au type du portefeuille (gestion des marées observées, 056 * calendriers d'activités navires, ...). Si superviseur de portefeuille, 057 * alors droits de correction sur les données saisies dans les 058 * portefeuilles supervisés. 059 * </p> 060 * <p> 061 * - Projet (pour info, synonyme LDAP = SIH_PROJET) : utilisateur membre de 062 * l'équipe projet du système ISIH : membre droits de consultation et de 063 * saisie que pour un observateur. 064 * </p> 065 * <p> 066 * - Utilisateur (pour info, synonyme LDAP = SIH_AUTRE) : utilisateur su 067 * système ISIH : pour la v1, ce profil ne donne accès à aucune 068 * fonctionnalité du système Allegro. 069 * <br> </p> 070 * <p> 071 * </p> 072 * <p> 073 * <u>note 1 :</u> les droits d'accès en saisie sur les fonctions 074 * (superviseur, activité sur les navires, marées observées) ne sont donc 075 * pas gérés ici, mais par l'intermédiaire des portefeuilles (cf classe 076 * "Portefeuille Navire"). 077 * </p> 078 * <p> 079 * <u>note 2 :</u> le synonyme LDAP "SIH_AUTRE" n'est pas utilisé pour le 080 * moment : il correspond à un utilisateur sans profil particulier 081 * </p> 082 * <p> 083 * Nombre de lignes : 4 084 * </p> 085 * </body> 086 * </html> 087 */ 088// HibernateEntity.vsl annotations merge-point 089public abstract class UserProfil 090 implements Serializable, Comparable<UserProfil> 091{ 092 /** 093 * The serial version UID of this class. Needed for serialization. 094 */ 095 private static final long serialVersionUID = 6935757165121081554L; 096 097 // Generate 4 attributes 098 private Integer id; 099 100 /** 101 * 102 * @return this.id Integer 103 */ 104 public Integer getId() 105 { 106 return this.id; 107 } 108 109 /** 110 * 111 * @param idIn Integer 112 */ 113 public void setId(Integer idIn) 114 { 115 this.id = idIn; 116 } 117 118 private String label; 119 120 /** 121 * Synonyme du profil dans LDAP 122 * @return this.label String 123 */ 124 public String getLabel() 125 { 126 return this.label; 127 } 128 129 /** 130 * Synonyme du profil dans LDAP 131 * @param labelIn String 132 */ 133 public void setLabel(String labelIn) 134 { 135 this.label = labelIn; 136 } 137 138 private String name; 139 140 /** 141 * 142 * @return this.name String 143 */ 144 public String getName() 145 { 146 return this.name; 147 } 148 149 /** 150 * 151 * @param nameIn String 152 */ 153 public void setName(String nameIn) 154 { 155 this.name = nameIn; 156 } 157 158 private Timestamp updateDate; 159 160 /** 161 * 162 * @return this.updateDate Timestamp 163 */ 164 public Timestamp getUpdateDate() 165 { 166 return this.updateDate; 167 } 168 169 /** 170 * 171 * @param updateDateIn Timestamp 172 */ 173 public void setUpdateDate(Timestamp updateDateIn) 174 { 175 this.updateDate = updateDateIn; 176 } 177 178 // Generate 1 associations 179 /** 180 * Returns <code>true</code> if the argument is an UserProfil instance and all identifiers for this entity 181 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise. 182 */ 183 @Override 184 public boolean equals(Object object) 185 { 186 if (this == object) 187 { 188 return true; 189 } 190 if (!(object instanceof UserProfil)) 191 { 192 return false; 193 } 194 final UserProfil that = (UserProfil)object; 195 if (this.id == null || that.getId() == null || !this.id.equals(that.getId())) 196 { 197 return false; 198 } 199 return true; 200 } 201 202 /** 203 * Returns a hash code based on this entity's identifiers. 204 */ 205 @Override 206 public int hashCode() 207 { 208 int hashCode = 0; 209 hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode()); 210 211 return hashCode; 212 } 213 214 /** 215 * Constructs new instances of {@link UserProfil}. 216 */ 217 public static final class Factory 218 { 219 /** 220 * Constructs a new instance of {@link UserProfil}. 221 * @return new UserProfilImpl() 222 */ 223 public static UserProfil newInstance() 224 { 225 return new UserProfilImpl(); 226 } 227 228 229 /** 230 * Constructs a new instance of {@link UserProfil}, taking all possible properties 231 * (except the identifier(s))as arguments. 232 * @param label String 233 * @param name String 234 * @param updateDate Timestamp 235 * @return newInstance UserProfil 236 */ 237 public static UserProfil newInstance(String label, String name, Timestamp updateDate) 238 { 239 final UserProfil entity = new UserProfilImpl(); 240 entity.setLabel(label); 241 entity.setName(name); 242 entity.setUpdateDate(updateDate); 243 return entity; 244 } 245 } 246 247 /** 248 * @see Comparable#compareTo 249 */ 250 public int compareTo(UserProfil o) 251 { 252 int cmp = 0; 253 if (this.getId() != null) 254 { 255 cmp = this.getId().compareTo(o.getId()); 256 } 257 else 258 { 259 if (this.getLabel() != null) 260 { 261 cmp = (cmp != 0 ? cmp : this.getLabel().compareTo(o.getLabel())); 262 } 263 if (this.getName() != null) 264 { 265 cmp = (cmp != 0 ? cmp : this.getName().compareTo(o.getName())); 266 } 267 if (this.getUpdateDate() != null) 268 { 269 cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate())); 270 } 271 } 272 return cmp; 273 } 274// HibernateEntity.vsl merge-point 275// UserProfil.java merge-point 276}