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 javax.persistence.Embedded;
22  import javax.persistence.Entity;
23  import javax.persistence.JoinColumn;
24  import javax.persistence.ManyToOne;
25  
26  import org.hibernate.annotations.Target;
27  import org.promotego.api.geocoder.beans.Geolocation;
28  import org.promotego.api.geocoder.beans.GeolocationImpl;
29  
30  @Entity
31  public class Address extends BeanSupport<Address>
32  {
33      private User m_user;
34      private String m_streetAddress;
35      private String m_city;
36      private String m_state;
37      private String m_postalCode;
38      private String m_country;
39      private String m_name;
40      private Geolocation m_geolocation;
41      
42      @Embedded
43      @Target(GeolocationImpl.class)
44      public Geolocation getGeolocation()
45      {
46          return m_geolocation;
47      }
48  
49      public void setGeolocation(Geolocation geolocation)
50      {
51          m_geolocation = geolocation;
52      }
53  
54      public String getCity()
55      {
56          return m_city;
57      }
58      
59      public void setCity(String city)
60      {
61          m_city = city;
62      }
63      
64      public String getCountry()
65      {
66          return m_country;
67      }
68      
69      public void setCountry(String country)
70      {
71          m_country = country;
72      }
73      
74      public String getPostalCode()
75      {
76          return m_postalCode;
77      }
78      
79      public void setPostalCode(String postalCode)
80      {
81          m_postalCode = postalCode;
82      }
83      
84      public String getState()
85      {
86          return m_state;
87      }
88      
89      public void setState(String state)
90      {
91          m_state = state;
92      }
93      
94      public String getStreetAddress()
95      {
96          return m_streetAddress;
97      }
98      
99      public void setStreetAddress(String streetAddress)
100     {
101         m_streetAddress = streetAddress;
102     }
103     
104     @ManyToOne
105     @JoinColumn(name="user_fk")
106     public User getUser()
107     {
108         return m_user;
109     }
110     
111     public void setUser(User user)
112     {
113         m_user = user;
114     }
115 
116     public String getName()
117     {
118         return m_name;
119     }
120 
121     public void setName(String name)
122     {
123         m_name = name;
124     }
125 }