001    /**
002     * Copyright 2005-2012 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package edu.sampleu.travel.approval;
017    
018    import edu.sampleu.travel.approval.dataobject.PrimaryDestination;
019    import org.kuali.rice.krad.document.TransactionalDocumentBase;
020    
021    import javax.persistence.*;
022    import java.util.Date;
023    
024    /**
025     * Travel authorization transactional document.
026     *
027     * <p>
028     *  This is a sample KRAD transactional document that demonstrates how
029     *  to implement transactional documents within the KRAD UIF.
030     * </p>
031     *
032     * @author Kuali Rice Team (rice.collab@kuali.org)
033     */
034    @Entity
035    @Table(name = "TRVL_AUTH_DOC_T")
036    public class TravelAuthorizationDocument extends TransactionalDocumentBase {
037    
038        private String travelDocumentIdentifier;
039        private String tripTypeCode;
040        private Date tripBegin;
041        private Date tripEnd;
042        private String tripDescription;
043        private Boolean primaryDestinationIndicator = false;
044    
045        private Integer primaryDestinationId;
046        private String primaryDestinationName;
047        private String primaryDestinationCountryState;
048        private String primaryDestinationCounty;
049    
050        private PrimaryDestination primaryDestination;
051    
052        public TravelAuthorizationDocument() {
053            super();
054        }
055    
056        /**
057         * Returns the travel document identifier.
058         *
059         * <p>
060         * Gets the travel document identifier.
061         * </p>
062         *
063         * @return String - document service
064         */
065        public String getTravelDocumentIdentifier() {
066            return travelDocumentIdentifier;
067        }
068    
069        /**
070         * Initializes the document identifier.
071         *
072         * <p>
073         * Sets the document identifier.
074         * </p>
075         *
076         * @param travelDocumentIdentifier - document identifier
077         */
078        public void setTravelDocumentIdentifier(String travelDocumentIdentifier) {
079            this.travelDocumentIdentifier = travelDocumentIdentifier;
080        }
081    
082        /**
083         * Returns the trip type code.
084         *
085         * <p>
086         * Gets the trip type code.
087         * </p>
088         *
089         * @return String - trip type code
090         */
091        public String getTripTypeCode() {
092            return tripTypeCode;
093        }
094    
095        /**
096         * Initializes the trip type code.
097         *
098         * <p>
099         * Sets the trip type code.
100         * </p>
101         *
102         * @param tripTypeCode - trip type code
103         */
104        public void setTripTypeCode(String tripTypeCode) {
105            this.tripTypeCode = tripTypeCode;
106        }
107    
108        /**
109         * Returns the trip begin date.
110         *
111         * <p>
112         * Gets the trip begin date.
113         * </p>
114         *
115         * @return Date - trip begin date
116         */
117        public Date getTripBegin() {
118            return tripBegin;
119        }
120    
121        /**
122         * Initializes the trip starting date.
123         *
124         * <p>
125         * Sets the trip begin date.
126         * </p>
127         *
128         * @param tripBegin - trip starting date
129         */
130        public void setTripBegin(Date tripBegin) {
131            this.tripBegin = tripBegin;
132        }
133    
134        /**
135         * Returns the trip end date.
136         *
137         * <p>
138         * Gets the trip end date.
139         * </p>
140         *
141         * @return Date - trip end date
142         */
143        public Date getTripEnd() {
144            return tripEnd;
145        }
146    
147        /**
148         * Initializes the trip ending date.
149         *
150         * <p>
151         * Sets the trip end date.
152         * </p>
153         *
154         * @param tripEnd - trip ending date
155         */
156        public void setTripEnd(Date tripEnd) {
157            this.tripEnd = tripEnd;
158        }
159    
160        /**
161         * Returns the trip description.
162         *
163         * <p>
164         * Gets the trip description.
165         * </p>
166         *
167         * @return Strin - trip description
168         */
169        public String getTripDescription() {
170            return tripDescription;
171        }
172    
173        /**
174         * Initializes the trip description.
175         *
176         * <p>
177         * Sets the trip description.
178         * </p>
179         *
180         * @param tripDescription- trip description
181         */
182        public void setTripDescription(String tripDescription) {
183            this.tripDescription = tripDescription;
184        }
185    
186        /**
187         * Returns the destination id.
188         *
189         * <p>
190         * Gets the primary key for the destination.
191         * </p>
192         *
193         * @return Integer - destination id
194         */
195        public Integer getPrimaryDestinationId() {
196            return primaryDestinationId;
197        }
198    
199        /**
200         * Initializes the primary destination id.
201         *
202         * <p>
203         * Sets the primary destination id.
204         * </p>
205         *
206         * @param primaryDestinationId - integer of primary destination id
207         */
208        public void setPrimaryDestinationId(Integer primaryDestinationId) {
209            this.primaryDestinationId = primaryDestinationId;
210        }
211    
212        /**
213         * Returns whether the destination is indicated.
214         *
215         * <p>
216         * Gets the primary destination indicator flag.
217         * </p>
218         *
219         * @return Boolean - primary destination indicator flag
220         */
221        public Boolean getPrimaryDestinationIndicator() {
222            return primaryDestinationIndicator;
223        }
224    
225        /**
226         * Initializes the primary destination flag.
227         *
228         * <p>
229         * Sets the flag whether a primary destination is indicated.
230         * </p>
231         *
232         * @param primaryDestinationIndicator - primary destination indicator
233         */
234        public void setPrimaryDestinationIndicator(Boolean primaryDestinationIndicator) {
235            this.primaryDestinationIndicator = primaryDestinationIndicator;
236        }
237    
238        /**
239         * Returns primary destination name.
240         *
241         * <p>
242         * Gets the name of the primary destination
243         * </p>
244         *
245         * @return String - primary destination name
246         */
247        public String getPrimaryDestinationName() {
248            return primaryDestinationName;
249        }
250    
251        /**
252         * Initializes the primary destination name.
253         *
254         * <p>
255         *    Sets the name for the primary destination.
256         * </p>
257         *
258         * @param primaryDestinationName - primary destination name
259         */
260        public void setPrimaryDestinationName(String primaryDestinationName) {
261            this.primaryDestinationName = primaryDestinationName;
262        }
263    
264        /**
265         * Returns primary destination state.
266         *
267         * <p>
268         * Gets the state of the primary destination
269         * </p>
270         *
271         * @return String - primary destination state
272         */
273        public String getPrimaryDestinationCountryState() {
274            return primaryDestinationCountryState;
275        }
276    
277        /**
278         * Initializes the primary destination state.
279         *
280         * <p>
281         * Sets the state for the primary destination.
282         * </p>
283         *
284         * @param primaryDestinationCountryState - primary destination state
285         */
286        public void setPrimaryDestinationCountryState(String primaryDestinationCountryState) {
287            this.primaryDestinationCountryState = primaryDestinationCountryState;
288        }
289    
290        /**
291         * Returns primary destination county.
292         *
293         * <p>
294         * Gets the county of the primary destination
295         * </p>
296         *
297         * @return String - primary destination county
298         */
299        public String getPrimaryDestinationCounty() {
300            return primaryDestinationCounty;
301        }
302    
303        /**
304         * Initializes the primary destination county.
305         *
306         * <p>
307         * Sets the county for the primary destination.
308         * </p>
309         *
310         * @param primaryDestinationCounty - primary destination county
311         */
312        public void setPrimaryDestinationCounty(String primaryDestinationCounty) {
313            this.primaryDestinationCounty = primaryDestinationCounty;
314        }
315    
316        /**
317         * Returns primary destination.
318         *
319         * <p>
320         * Gets the primary destination
321         * </p>
322         *
323         * @return PrimaryDestination - primary destination
324         */
325        public PrimaryDestination getPrimaryDestination() {
326            return primaryDestination;
327        }
328    
329        /**
330         * Initializes the primary destination.
331         *
332         * <p>
333         * Sets the primary destination.
334         * </p>
335         *
336         * @param primaryDestination - primary destination
337         */
338        public void setPrimaryDestination(PrimaryDestination primaryDestination) {
339            this.primaryDestination = primaryDestination;
340        }
341    }