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 OfferedGame extends BeanSupport<OfferedGame>
30  {
31      private User m_offerer;
32      private Date m_startTime;
33      private Integer m_duration;
34      private Location m_location;
35      
36      /***
37       * Get the duration in seconds of the game.
38       * 
39       * @return The duration in seconds of the game.
40       */
41      public Integer getDuration()
42      {
43          return m_duration;
44      }
45      
46      /***
47       * Set the duration in seconds of the game.
48       * 
49       * @param duration The duration in seconds of the game.
50       */
51      public void setDuration(Integer duration)
52      {
53          m_duration = duration;
54      }
55      
56      @ManyToOne
57      public Location getLocation()
58      {
59          return m_location;
60      }
61      
62      public void setLocation(Location location)
63      {
64          m_location = location;
65      }
66      
67      @ManyToOne
68      public User getOfferer()
69      {
70          return m_offerer;
71      }
72      
73      public void setOfferer(User offerer)
74      {
75          m_offerer = offerer;
76      }
77      
78      @Temporal(value=TemporalType.TIMESTAMP)
79      public Date getStartTime()
80      {
81          return m_startTime;
82      }
83      
84      public void setStartTime(Date startTime)
85      {
86          m_startTime = startTime;
87      }    
88  }