KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ivata > groupware > business > addressbook > person > employee > EmployeeDO


1 /*
2  * Copyright (c) 2001 - 2005 ivata limited.
3  * All rights reserved.
4  * -----------------------------------------------------------------------------
5  * ivata groupware may be redistributed under the GNU General Public
6  * License as published by the Free Software Foundation;
7  * version 2 of the License.
8  *
9  * These programs are free software; you can redistribute them and/or
10  * modify them under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; version 2 of the License.
12  *
13  * These programs are distributed in the hope that they will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  * See the GNU General Public License in the file LICENSE.txt for more
18  * details.
19  *
20  * If you would like a copy of the GNU General Public License write to
21  *
22  * Free Software Foundation, Inc.
23  * 59 Temple Place - Suite 330
24  * Boston, MA 02111-1307, USA.
25  *
26  *
27  * To arrange commercial support and licensing, contact ivata at
28  * http://www.ivata.com/contact.jsp
29  * -----------------------------------------------------------------------------
30  * $Log: EmployeeDO.java,v $
31  * Revision 1.3 2005/04/10 20:09:35 colinmacleod
32  * Added new themes.
33  * Changed id type to String.
34  * Changed i tag to em and b tag to strong.
35  * Improved PicoContainerFactory with NanoContainer scripts.
36  *
37  * Revision 1.2 2005/04/09 17:19:07 colinmacleod
38  * Changed copyright text to GPL v2 explicitly.
39  *
40  * Revision 1.1.1.1 2005/03/10 17:50:31 colinmacleod
41  * Restructured ivata op around Hibernate/PicoContainer.
42  * Renamed ivata groupware.
43  *
44  * Revision 1.3 2004/07/13 19:41:13 colinmacleod
45  * Moved project to POJOs from EJBs.
46  * Applied PicoContainer to services layer (replacing session EJBs).
47  * Applied Hibernate to persistence layer (replacing entity EJBs).
48  *
49  * Revision 1.2 2004/03/21 21:16:06 colinmacleod
50  * Shortened name to ivata op.
51  *
52  * Revision 1.1.1.1 2004/01/27 20:57:50 colinmacleod
53  * Moved ivata openportal to SourceForge..
54  *
55  * Revision 1.3 2003/10/17 12:36:12 jano
56  * fixing problems with building
57  * converting intranet -> portal
58  * Eclipse building
59  *
60  * Revision 1.2 2003/10/15 13:18:02 colin
61  * fixing for XDoclet
62  *
63  * Revision 1.1 2003/02/24 19:09:21 colin
64  * moved to business
65  *
66  * Revision 1.2 2003/02/04 17:43:45 colin
67  * copyright notice
68  *
69  * Revision 1.1 2002/08/30 09:52:02 colin
70  * added new employee EJB
71  * -----------------------------------------------------------------------------
72  */

73 package com.ivata.groupware.business.addressbook.person.employee;
74
75
76 import com.ivata.groupware.business.addressbook.address.country.CountryDO;
77 import com.ivata.groupware.container.persistence.BaseDO;
78
79
80 /**
81  * <p>Tracks which people are employees and the number of vacation days they
82  * have remaining for the current calendar year.</p>
83  *
84  * <p>This is a dependent value class, used to pass data back from the.</p>
85  * {@link EmployeeBean EmployeeBean} to a client application.</p>
86  *
87  * <p><strong>Note:</strong> This class provides data from {@link EmployeeBean EmployeeBean}.
88  * This is no local copy of the bean class, however, and changes here
89  * will not be automatically reflected in {@link EmployeeBean EmployeeBean}.</p>
90  *
91  * @since 2002-08-30
92  * @author Colin MacLeod
93  * <a HREF='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
94  * @version $Revision: 1.3 $
95  *
96  * @hibernate.class
97  * table="person_employee"
98  * @hibernate.cache
99  * usage="read-write"
100  */

101 public class EmployeeDO extends BaseDO {
102     /**
103      * Static definitiaion of the display value prefix.
104      */

105     public static final String JavaDoc DISPLAY_VALUE_PREFIX = "[employee] ";
106     /**
107      * <p>Store the country for this employee.</p>
108      */

109     private CountryDO country;
110
111     /**
112      * <p>Store the internal company employee number. This number is used
113      * by the client company for reference/internal use and is not required by
114      * the ivata groupware system.</p>
115      */

116     private String JavaDoc number;
117
118     /**
119      * <p>Store the region for this employee. The region code together with the
120      * country code is used to filter the employee's public holidays in the
121      * calendar.</p>
122      */

123     private String JavaDoc regionCode;
124
125     /**
126      * <p>Store the total number of days vacation this employee has for the
127      * current calendar year. <strong>Note:</strong> this is the total number of days
128      * for the employee, not the number of days remaining. The system calculates
129      * the days remaining by adding all previous vacation days within the
130      * current calendar year.</p>
131      */

132     private Integer JavaDoc vacationDays;
133
134     /**
135      * <p>Get the country for this employee.</p>
136      *
137      * @return the country for the employee.
138      * @hibernate.many-to-one
139      * column="address_country"
140      */

141     public final CountryDO getCountry() {
142         return country;
143     }
144     /**
145      * Just returns the text "[employee] " followed by the employee number.
146      * Refer to {@link #getName}.
147      * @return Refer to {@link #getName}.
148      */

149     public String JavaDoc getDisplayValue() {
150         return DISPLAY_VALUE_PREFIX + getNumber();
151     }
152     /**
153      * <p>Get the internal company employee number. This number is used
154      * by the client company for reference/internal use and is not required by
155      * the ivata groupware system.</p>
156      *
157      * @return employee number, for company records. Need not be numeric only.
158      * @hibernate.property
159      * column="number"
160      */

161     public final String JavaDoc getNumber() {
162         return number;
163     }
164
165     /**
166      * <p>Get the region for this employee. The region code together with the
167      * country code is used to filter the employee's public holidays in the
168      * calendar.</p>
169      *
170      * @return text value for the region code.
171      * @hibernate.property
172      * column="region_code"
173      */

174     public final String JavaDoc getRegionCode() {
175         return regionCode;
176     }
177
178     /**
179      * <p>Get the total number of days vacation this employee has for the
180      * current calendar year. <strong>Note:</strong> this is the total number of days
181      * for the employee, not the number of days remaining. The system calculates
182      * the days remaining by adding all previous vacation days within the
183      * current calendar year.</p>
184      *
185      * @return total number of days vacation for this employee for the current
186      * calendar year.
187      * @hibernate.property
188      * column="vacation_days"
189      */

190     public final Integer JavaDoc getVacationDays() {
191         return vacationDays;
192     }
193     /**
194      * <p>Set the country for this employee.</p>
195      *
196      * @param country new value of the country for the employee.
197      */

198     public final void setCountry(final CountryDO country) {
199         this.country = country;
200     }
201
202     /**
203      * <p>Set the internal company employee number. This number is used
204      * by the client company for reference/internal use and is not required by
205      * the ivata groupware system.</p>
206      *
207      * @param number employee number, for company records. Need not be numeric
208      * only.
209      */

210     public final void setNumber(final String JavaDoc number) {
211         this.number = number;
212     }
213
214     /**
215      * <p>Set the region for this employee. The region code together with the
216      * country code is used to filter the employee's public holidays in the
217      * calendar.</p>
218      *
219      * @param regionCode new text value for the region code. Can be a maximum of
220      * ten characters.
221      */

222     public final void setRegionCode(final String JavaDoc regionCode) {
223         this.regionCode = regionCode;
224     }
225
226     /**
227      * <p>Set the total number of days vacation this employee has for the
228      * current calendar year. <strong>Note:</strong> this is the total number of days
229      * for the employee, not the number of days remaining. The system calculates
230      * the days remaining by adding all previous vacation days within the
231      * current calendar year.</p>
232      *
233      * @param vacationDays total number of days vacation for this employee for
234      * the current calendar year.
235      */

236     public final void setVacationDays(final Integer JavaDoc vacationDays) {
237         this.vacationDays = vacationDays;
238     }
239 }
240
Popular Tags