001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */
019: package org.apache.openjpa.persistence.kernel.common.apps;
020:
021: import java.util.Arrays;
022: import java.util.Calendar;
023: import java.util.List;
024: import java.util.TimeZone;
025: import javax.persistence.Entity;
026: import javax.persistence.GeneratedValue;
027: import javax.persistence.GenerationType;
028: import javax.persistence.Id;
029: import javax.persistence.Table;
030:
031: @Entity
032: @Table(name="CAL_FLDS")
033: public class CalendarFields {
034:
035: @Id
036: @GeneratedValue(strategy=GenerationType.AUTO)
037: private int id;
038:
039: private Calendar unassigned;
040: private Calendar gmt = Calendar.getInstance(TimeZone
041: .getTimeZone("GMT"));
042: private Calendar pacific = Calendar.getInstance(TimeZone
043: .getTimeZone("US/Pacific"));
044: private Calendar newYork = Calendar.getInstance(TimeZone
045: .getTimeZone("America/New_York"));
046: private Calendar berlin = Calendar.getInstance(TimeZone
047: .getTimeZone("Europe/Berlin"));
048: private Calendar singapore = Calendar.getInstance(TimeZone
049: .getTimeZone("Asia/Singapore"));
050:
051: public CalendarFields() {
052: }
053:
054: public void setGmt(Calendar gmt) {
055: this .gmt = gmt;
056: }
057:
058: public Calendar getGmt() {
059: return this .gmt;
060: }
061:
062: public void setPacific(Calendar pacific) {
063: this .pacific = pacific;
064: }
065:
066: public Calendar getPacific() {
067: return this .pacific;
068: }
069:
070: public void setNewYork(Calendar newYork) {
071: this .newYork = newYork;
072: }
073:
074: public Calendar getNewYork() {
075: return this .newYork;
076: }
077:
078: public void setBerlin(Calendar berlin) {
079: this .berlin = berlin;
080: }
081:
082: public Calendar getBerlin() {
083: return this .berlin;
084: }
085:
086: public void setSingapore(Calendar singapore) {
087: this .singapore = singapore;
088: }
089:
090: public Calendar getSingapore() {
091: return this .singapore;
092: }
093:
094: public void setUnassigned(Calendar unassigned) {
095: this .unassigned = unassigned;
096: }
097:
098: public Calendar getUnassigned() {
099: return this .unassigned;
100: }
101:
102: public List getCalendars() {
103: return Arrays.asList(new Calendar[] { unassigned, gmt, pacific,
104: newYork, berlin, singapore });
105: }
106:
107: public int getId() {
108: return id;
109: }
110: }
|