001: /*
002: * Copyright (c) 2001 - 2005 ivata limited.
003: * All rights reserved.
004: * -----------------------------------------------------------------------------
005: * ivata groupware may be redistributed under the GNU General Public
006: * License as published by the Free Software Foundation;
007: * version 2 of the License.
008: *
009: * These programs are free software; you can redistribute them and/or
010: * modify them under the terms of the GNU General Public License
011: * as published by the Free Software Foundation; version 2 of the License.
012: *
013: * These programs are distributed in the hope that they will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016: *
017: * See the GNU General Public License in the file LICENSE.txt for more
018: * details.
019: *
020: * If you would like a copy of the GNU General Public License write to
021: *
022: * Free Software Foundation, Inc.
023: * 59 Temple Place - Suite 330
024: * Boston, MA 02111-1307, USA.
025: *
026: *
027: * To arrange commercial support and licensing, contact ivata at
028: * http://www.ivata.com/contact.jsp
029: * -----------------------------------------------------------------------------
030: * $Log: PublicHolidayDO.java,v $
031: * Revision 1.6 2005/10/11 18:56:34 colinmacleod
032: * Fixed some checkstyle and javadoc issues.
033: *
034: * Revision 1.5 2005/10/02 14:08:56 colinmacleod
035: * Added/improved log4j logging.
036: *
037: * Revision 1.4 2005/09/29 13:22:46 colinmacleod
038: * Added read-only functionality to data object classes (with a check on each
039: * setter).
040: *
041: * Revision 1.3 2005/09/14 15:12:20 colinmacleod
042: * Added serialVersionUID.
043: *
044: * Revision 1.2 2005/04/09 17:19:17 colinmacleod
045: * Changed copyright text to GPL v2 explicitly.
046: *
047: * Revision 1.1.1.1 2005/03/10 17:47:45 colinmacleod
048: * Restructured ivata op around Hibernate/PicoContainer.
049: * Renamed ivata groupware.
050: *
051: * Revision 1.2 2004/11/03 15:49:51 colinmacleod
052: * Changed todo comments to TODO: all caps.
053: *
054: * Revision 1.1 2004/07/13 19:42:13 colinmacleod
055: * Moved project to POJOs from EJBs.
056: * Applied PicoContainer to services layer (replacing session EJBs).
057: * Applied Hibernate to persistence layer (replacing entity EJBs).
058: *
059: * Revision 1.4 2004/03/21 21:16:21 colinmacleod
060: * Shortened name to ivata op.
061: *
062: * Revision 1.3 2004/02/10 19:57:22 colinmacleod
063: * Changed email address.
064: *
065: * Revision 1.2 2004/02/01 22:07:29 colinmacleod
066: * Added full names to author tags
067: *
068: * Revision 1.1.1.1 2004/01/27 20:58:20 colinmacleod
069: * Moved ivata openportal to SourceForge..
070: *
071: * Revision 1.6 2003/11/04 09:27:15 jano
072: * fixing mistaakes in XDoclet tags
073: *
074: * Revision 1.5 2003/11/03 11:28:48 jano
075: * commiting calendar,
076: * tryinjg to fix deploying problem
077: *
078: * Revision 1.4 2003/10/28 13:10:23 jano
079: * commiting calendar,
080: * still fixing compile and building openGroupware project
081: *
082: * Revision 1.3 2003/10/15 13:59:52 jano
083: * converting to XDoclet
084: *
085: * Revision 1.2 2003/10/15 13:57:23 colin
086: * fixing for XDoclet
087: *
088: * Revision 1.2 2003/02/25 14:38:13 colin
089: * implemented setModified methods on entity beans thro IvataEntityBean
090: * superclass
091: *
092: * Revision 1.1 2003/02/24 19:09:21 colin
093: * moved to business
094: * -----------------------------------------------------------------------------
095: */
096: package com.ivata.groupware.business.calendar.event.publicholiday;
097:
098: import org.apache.log4j.Logger;
099:
100: import com.ivata.groupware.business.addressbook.address.country.CountryDO;
101: import com.ivata.groupware.business.calendar.event.EventDO;
102:
103: /**
104: * <p>Public holiday is event with country and region code. TODO:</p>
105: *
106: * @since ivata groupware 0.9 (2002-08-02)
107: * @author Jan Boros
108: * <a href='mailto:janboros@sourceforge.net'>janboros@sourceforge.net</a>
109: * @author Colin MacLeod
110: * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
111: * @version $Revision: 1.6 $
112: *
113: * @hibernate.joined-subclass
114: * table="public_holiday"
115: * @hibernate.joined-subclass-key
116: * column="calendar_event"
117: */
118: public class PublicHolidayDO extends EventDO {
119: /**
120: * Logger for this class.
121: */
122: private static final Logger logger = Logger
123: .getLogger(PublicHolidayDO.class);
124:
125: /**
126: * Serialization version (for <code>Serializable</code> interface).
127: */
128: private static final long serialVersionUID = 1L;
129:
130: /**
131: * <p>The country to which this public holiday applies.</p>
132: */
133: private CountryDO country;
134:
135: /**
136: * <p>Get the region code to which this public holiday applies.</p>
137: */
138: private String regionCode;
139:
140: /**
141: * <p>Get the country to which this public holiday applies.</p>
142: *
143: * @return the country to which this public holiday applies.
144: *
145: * @hibernate.many-to-one
146: */
147: public final CountryDO getCountry() {
148: if (logger.isDebugEnabled()) {
149: logger.debug("getCountry() - start");
150: }
151:
152: if (logger.isDebugEnabled()) {
153: logger.debug("getCountry() - end - return value = "
154: + country);
155: }
156: return country;
157: }
158:
159: /**
160: * <p>Get the region code to which this public holiday applies.</p>
161: *
162: * @return region code to which this public holiday applies.
163: *
164: * @hibernate.property
165: * column="region_code"
166: */
167: public final String getRegionCode() {
168: if (logger.isDebugEnabled()) {
169: logger.debug("getRegionCode() - start");
170: }
171:
172: if (logger.isDebugEnabled()) {
173: logger.debug("getRegionCode() - end - return value = "
174: + regionCode);
175: }
176: return regionCode;
177: }
178:
179: /**
180: * <p>Set the country to which this public holiday applies.</p>
181: *
182: * @param countryParam to which this public holiday applies.
183: */
184: public final void setCountry(final CountryDO countryParam) {
185: if (logger.isDebugEnabled()) {
186: logger.debug("setCountry(CountryDO country = "
187: + countryParam + ") - start");
188: }
189:
190: checkSetter();
191: this .country = countryParam;
192:
193: if (logger.isDebugEnabled()) {
194: logger.debug("setCountry(CountryDO) - end");
195: }
196: }
197:
198: /**
199: * <p>Set the region code to which this public holiday applies.</p>
200: *
201: * @param regionCodeParam region code to which this public holiday applies.
202: */
203: public final void setRegionCode(final String regionCodeParam) {
204: if (logger.isDebugEnabled()) {
205: logger.debug("setRegionCode(String regionCode = "
206: + regionCodeParam + ") - start");
207: }
208:
209: checkSetter();
210: this .regionCode = regionCodeParam;
211:
212: if (logger.isDebugEnabled()) {
213: logger.debug("setRegionCode(String) - end");
214: }
215: }
216: }
|