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 fr.ifremer.adagio.core.dao.referential.Status; 032import java.io.Serializable; 033import java.sql.Timestamp; 034import java.util.Date; 035 036/** 037 * Transfert des droits entre un service et un autre service. 038 * @deprecated Use Program2Department instead 039 */ 040// HibernateEntity.vsl annotations merge-point 041public abstract class DepartmentPrivilegeTransfert 042 implements Serializable, Comparable<DepartmentPrivilegeTransfert> 043{ 044 /** 045 * The serial version UID of this class. Needed for serialization. 046 */ 047 private static final long serialVersionUID = 8128614373079839362L; 048 049 private DepartmentPrivilegeTransfertPK departmentPrivilegeTransfertPk; 050 051 /** 052 * Get the composite primary key identifier class 053 * @return departmentPrivilegeTransfertPk 054 */ 055 public DepartmentPrivilegeTransfertPK getDepartmentPrivilegeTransfertPk() 056 { 057 return this.departmentPrivilegeTransfertPk; 058 } 059 060 /** 061 * Set the composite primary key identifier class 062 * @param departmentPrivilegeTransfertPkIn 063 */ 064 public void setDepartmentPrivilegeTransfertPk(DepartmentPrivilegeTransfertPK departmentPrivilegeTransfertPkIn) { 065 this.departmentPrivilegeTransfertPk = departmentPrivilegeTransfertPkIn; 066 } 067 068 // Generate 2 attributes 069 private Date transfertDate; 070 071 /** 072 * Date du transfert des droits entre service 073 * @return this.transfertDate Date 074 */ 075 public Date getTransfertDate() 076 { 077 return this.transfertDate; 078 } 079 080 /** 081 * Date du transfert des droits entre service 082 * @param transfertDateIn Date 083 */ 084 public void setTransfertDate(Date transfertDateIn) 085 { 086 this.transfertDate = transfertDateIn; 087 } 088 089 private Timestamp updateDate; 090 091 /** 092 * 093 * @return this.updateDate Timestamp 094 */ 095 public Timestamp getUpdateDate() 096 { 097 return this.updateDate; 098 } 099 100 /** 101 * 102 * @param updateDateIn Timestamp 103 */ 104 public void setUpdateDate(Timestamp updateDateIn) 105 { 106 this.updateDate = updateDateIn; 107 } 108 109 // Generate 3 associations 110 private Department fromDepartment; 111 112 /** 113 * Identifiant interne du service possédant les droits à l''origine 114 * @return this.fromDepartment Department 115 */ 116 public Department getFromDepartment() 117 { 118 return this.fromDepartment; 119 } 120 121 /** 122 * Identifiant interne du service possédant les droits à l''origine 123 * @param fromDepartmentIn Department 124 */ 125 public void setFromDepartment(Department fromDepartmentIn) 126 { 127 this.fromDepartment = fromDepartmentIn; 128 } 129 130 private Status status; 131 132 /** 133 * Code de l''état de l''objet (actif ou inactif) 134 * @return this.status Status 135 */ 136 public Status getStatus() 137 { 138 return this.status; 139 } 140 141 /** 142 * Code de l''état de l''objet (actif ou inactif) 143 * @param statusIn Status 144 */ 145 public void setStatus(Status statusIn) 146 { 147 this.status = statusIn; 148 } 149 150 private Department toDepartment; 151 152 /** 153 * Identifiant interne du service vers qui les droits sont transférés 154 * @return this.toDepartment Department 155 */ 156 public Department getToDepartment() 157 { 158 return this.toDepartment; 159 } 160 161 /** 162 * Identifiant interne du service vers qui les droits sont transférés 163 * @param toDepartmentIn Department 164 */ 165 public void setToDepartment(Department toDepartmentIn) 166 { 167 this.toDepartment = toDepartmentIn; 168 } 169 170 /** 171 * This entity does not have any identifiers 172 * and is not extending any other entity, 173 * so this method will only return <code>true</code> if the argument reference and <code>this</code> 174 * refer to the same object. 175 */ 176 @Override 177 public boolean equals(Object object) 178 { 179 return super.equals(object); 180 } 181 182 /** 183 * This entity does not have any identifiers 184 * and is not extending any other entity, 185 * so this method will only take the identifiers of this entity into account when calculating the hash code. 186 */ 187 @Override 188 public int hashCode() 189 { 190 return super.hashCode(); 191 } 192 193 /** 194 * Constructs new instances of {@link DepartmentPrivilegeTransfert}. 195 */ 196 public static final class Factory 197 { 198 /** 199 * Constructs a new instance of {@link DepartmentPrivilegeTransfert}. 200 * @return new DepartmentPrivilegeTransfertImpl() 201 */ 202 public static DepartmentPrivilegeTransfert newInstance() 203 { 204 return new DepartmentPrivilegeTransfertImpl(); 205 } 206 207 208 /** 209 * Constructs a new instance of {@link DepartmentPrivilegeTransfert}, taking all possible properties 210 * (except the identifier(s))as arguments. 211 * @param transfertDate Date 212 * @param updateDate Timestamp 213 * @param fromDepartment Department 214 * @param status Status 215 * @param toDepartment Department 216 * @return newInstance DepartmentPrivilegeTransfert 217 */ 218 public static DepartmentPrivilegeTransfert newInstance(Date transfertDate, Timestamp updateDate, Department fromDepartment, Status status, Department toDepartment) 219 { 220 final DepartmentPrivilegeTransfert entity = new DepartmentPrivilegeTransfertImpl(); 221 entity.setTransfertDate(transfertDate); 222 entity.setUpdateDate(updateDate); 223 entity.setFromDepartment(fromDepartment); 224 entity.setStatus(status); 225 entity.setToDepartment(toDepartment); 226 return entity; 227 } 228 } 229 230 /** 231 * @see Comparable#compareTo 232 */ 233 public int compareTo(DepartmentPrivilegeTransfert o) 234 { 235 int cmp = 0; 236 if (this.getDepartmentPrivilegeTransfertPk() != null) 237 { 238 cmp = this.getDepartmentPrivilegeTransfertPk().compareTo(o.getDepartmentPrivilegeTransfertPk()); 239 } 240 if (this.getTransfertDate() != null) 241 { 242 cmp = (cmp != 0 ? cmp : this.getTransfertDate().compareTo(o.getTransfertDate())); 243 } 244 if (this.getUpdateDate() != null) 245 { 246 cmp = (cmp != 0 ? cmp : this.getUpdateDate().compareTo(o.getUpdateDate())); 247 } 248 return cmp; 249 } 250// HibernateEntity.vsl merge-point 251// DepartmentPrivilegeTransfert.java merge-point 252}