View Javadoc

1   /*
2    * Copyright (C) 2007 Alf Mikula
3    * 
4    * This file is part of PromoteGo.
5    *
6    * PromoteGo is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU General Public License as published by
8    * the Free Software Foundation, either version 3 of the License, or
9    * (at your option) any later version.
10   *
11   * PromoteGo is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU General Public License for more details.
15   *
16   * You should have received a copy of the GNU General Public License
17   * along with PromoteGo.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  package org.promotego.beans;
20  
21  import java.util.Date;
22  
23  import javax.persistence.Entity;
24  import javax.persistence.ManyToOne;
25  import javax.persistence.Temporal;
26  import javax.persistence.TemporalType;
27  
28  @Entity
29  public class ScheduledGame extends BeanSupport<ScheduledGame>
30  {
31      private User m_offerer;
32      private User m_accepter;
33      private Date m_startTime;
34      private int m_duration;
35      private Location m_location;
36      private Date m_lastReminder;
37  
38  	public ScheduledGame() { }
39      
40      public ScheduledGame(OfferedGame offeredGame)
41      {
42          setOfferer(offeredGame.getOfferer());
43          setStartTime(offeredGame.getStartTime());
44          setDuration(offeredGame.getDuration());
45          setLocation(offeredGame.getLocation());
46      }
47  
48      @ManyToOne
49      public User getAccepter()
50      {
51          return m_accepter;
52      }
53      
54      public void setAccepter(User accepter)
55      {
56          m_accepter = accepter;
57      }
58      
59      public int getDuration()
60      {
61          return m_duration;
62      }
63      
64      public void setDuration(int duration)
65      {
66          m_duration = duration;
67      }
68      
69      @ManyToOne
70      public Location getLocation()
71      {
72          return m_location;
73      }
74      
75      public void setLocation(Location location)
76      {
77          m_location = location;
78      }
79      
80      @ManyToOne
81      public User getOfferer()
82      {
83          return m_offerer;
84      }
85      
86      public void setOfferer(User offerer)
87      {
88          m_offerer = offerer;
89      }
90      
91      @Temporal(value=TemporalType.TIMESTAMP)
92      public Date getStartTime()
93      {
94          return m_startTime;
95      }
96      
97      public void setStartTime(Date startTime)
98      {
99          m_startTime = startTime;
100     }
101     
102     @Temporal(value=TemporalType.TIMESTAMP)
103 	public Date getLastReminder()
104 	{
105 		return m_lastReminder;
106 	}
107 
108 	public void setLastReminder(Date lastReminder)
109 	{
110 		m_lastReminder = lastReminder;
111 	}
112 }