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.programStrategy;
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.administration.user.Department;
032import fr.ifremer.adagio.core.dao.referential.location.Location;
033import java.io.Serializable;
034
035/**
036 * Liste des droits d''un service pour un programme particulier
037 */
038// HibernateEntity.vsl annotations merge-point
039public abstract class Program2Department
040    implements Serializable, Comparable<Program2Department>
041{
042    /**
043     * The serial version UID of this class. Needed for serialization.
044     */
045    private static final long serialVersionUID = -1578423454473058781L;
046
047    // Generate 1 attributes
048    private Integer id;
049
050    /**
051     * 
052     * @return this.id Integer
053     */
054    public Integer getId()
055    {
056        return this.id;
057    }
058
059    /**
060     * 
061     * @param idIn Integer
062     */
063    public void setId(Integer idIn)
064    {
065        this.id = idIn;
066    }
067
068    // Generate 4 associations
069    private ProgramPrivilege programPrivilege;
070
071    /**
072     * Identifiant du privilège (droit) sur les programmes
073     * @return this.programPrivilege ProgramPrivilege
074     */
075    public ProgramPrivilege getProgramPrivilege()
076    {
077        return this.programPrivilege;
078    }
079
080    /**
081     * Identifiant du privilège (droit) sur les programmes
082     * @param programPrivilegeIn ProgramPrivilege
083     */
084    public void setProgramPrivilege(ProgramPrivilege programPrivilegeIn)
085    {
086        this.programPrivilege = programPrivilegeIn;
087    }
088
089    private Department department;
090
091    /**
092     * Identifiant interne d''un service
093     * @return this.department Department
094     */
095    public Department getDepartment()
096    {
097        return this.department;
098    }
099
100    /**
101     * Identifiant interne d''un service
102     * @param departmentIn Department
103     */
104    public void setDepartment(Department departmentIn)
105    {
106        this.department = departmentIn;
107    }
108
109    private Location location;
110
111    /**
112     * Lieu sur lequel le département a les droits
113     * @return this.location Location
114     */
115    public Location getLocation()
116    {
117        return this.location;
118    }
119
120    /**
121     * Lieu sur lequel le département a les droits
122     * @param locationIn Location
123     */
124    public void setLocation(Location locationIn)
125    {
126        this.location = locationIn;
127    }
128
129    private Program program;
130
131    /**
132     * Code unique du programme
133     * @return this.program Program
134     */
135    public Program getProgram()
136    {
137        return this.program;
138    }
139
140    /**
141     * Code unique du programme
142     * @param programIn Program
143     */
144    public void setProgram(Program programIn)
145    {
146        this.program = programIn;
147    }
148
149    /**
150     * Returns <code>true</code> if the argument is an Program2Department instance and all identifiers for this entity
151     * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
152     */
153    @Override
154    public boolean equals(Object object)
155    {
156        if (this == object)
157        {
158            return true;
159        }
160        if (!(object instanceof Program2Department))
161        {
162            return false;
163        }
164        final Program2Department that = (Program2Department)object;
165        if (this.id == null || that.getId() == null || !this.id.equals(that.getId()))
166        {
167            return false;
168        }
169        return true;
170    }
171
172    /**
173     * Returns a hash code based on this entity's identifiers.
174     */
175    @Override
176    public int hashCode()
177    {
178        int hashCode = 0;
179        hashCode = 29 * hashCode + (this.id == null ? 0 : this.id.hashCode());
180
181        return hashCode;
182    }
183
184    /**
185     * Constructs new instances of {@link Program2Department}.
186     */
187    public static final class Factory
188    {
189        /**
190         * Constructs a new instance of {@link Program2Department}.
191         * @return new Program2DepartmentImpl()
192         */
193        public static Program2Department newInstance()
194        {
195            return new Program2DepartmentImpl();
196        }
197
198        /**
199         * Constructs a new instance of {@link Program2Department}, taking all required and/or
200         * read-only properties as arguments, except for identifiers.
201         * @param programPrivilege ProgramPrivilege
202         * @param department Department
203         * @param program Program
204         * @return newInstance
205         */
206        public static Program2Department newInstance(ProgramPrivilege programPrivilege, Department department, Program program)
207        {
208            final Program2Department entity = new Program2DepartmentImpl();
209            entity.setProgramPrivilege(programPrivilege);
210            entity.setDepartment(department);
211            entity.setProgram(program);
212            return entity;
213        }
214
215        /**
216         * Constructs a new instance of {@link Program2Department}, taking all possible properties
217         * (except the identifier(s))as arguments.
218         * @param programPrivilege ProgramPrivilege
219         * @param department Department
220         * @param location Location
221         * @param program Program
222         * @return newInstance Program2Department
223         */
224        public static Program2Department newInstance(ProgramPrivilege programPrivilege, Department department, Location location, Program program)
225        {
226            final Program2Department entity = new Program2DepartmentImpl();
227            entity.setProgramPrivilege(programPrivilege);
228            entity.setDepartment(department);
229            entity.setLocation(location);
230            entity.setProgram(program);
231            return entity;
232        }
233    }
234
235    /**
236     * @see Comparable#compareTo
237     */
238    public int compareTo(Program2Department o)
239    {
240        int cmp = 0;
241        if (this.getId() != null)
242        {
243            cmp = this.getId().compareTo(o.getId());
244        }
245        
246        return cmp;
247    }
248// HibernateEntity.vsl merge-point
249// Program2Department.java merge-point
250}