]> git.mxchange.org Git - jphone-core.git/blob - src/org/mxchange/jphone/phonenumbers/smsprovider/CellphoneProvider.java
missed to add annotations here
[jphone-core.git] / src / org / mxchange / jphone / phonenumbers / smsprovider / CellphoneProvider.java
1 /*
2  * Copyright (C) 2015 Roland Haeder
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 package org.mxchange.jphone.phonenumbers.smsprovider;
18
19 import javax.persistence.Basic;
20 import javax.persistence.CascadeType;
21 import javax.persistence.Column;
22 import javax.persistence.Entity;
23 import javax.persistence.GeneratedValue;
24 import javax.persistence.GenerationType;
25 import javax.persistence.Id;
26 import javax.persistence.JoinColumn;
27 import javax.persistence.OneToOne;
28 import javax.persistence.Table;
29 import org.mxchange.jcountry.data.Country;
30 import org.mxchange.jcountry.data.CountryData;
31
32 /**
33  * A POJO for cellphone providers
34  * <p>
35  * @author Roland Haeder
36  */
37 @Entity (name = "cellphone_provider")
38 @Table (name = "cellphone_provider")
39 public class CellphoneProvider implements SmsProvider {
40
41         /**
42          * Serial number
43          */
44         private static final long serialVersionUID = 185_878_567_810_590L;
45
46         /**
47          * Id number
48          */
49         @Id
50         @GeneratedValue (strategy = GenerationType.IDENTITY)
51         @Column (name = "provider_id", length = 20, nullable = false, updatable = false)
52         private Long providerId;
53
54         /**
55          * Provider dial prefix (example: 0177 for German E+)
56          */
57         @Basic (optional = false)
58         @Column (name = "provider_dial_prefix", length = 10, nullable = false)
59         private Long providerDialPrefix;
60
61         /**
62          * Name of the provider
63          */
64         @Basic (optional = false)
65         @Column (name = "provider_name", length = 30, nullable = false)
66         private String providerName;
67
68         /**
69          * Country instance ('s dial data)
70          */
71         @JoinColumn (name = "provider_country_id", nullable = false)
72         @OneToOne (targetEntity = CountryData.class, optional = false, cascade = CascadeType.ALL)
73         private Country country;
74
75         @Override
76         public Long getProviderId () {
77                 return providerId;
78         }
79
80         @Override
81         public void setProviderId (final Long providerId) {
82                 this.providerId = providerId;
83         }
84
85         @Override
86         public Long getProviderDialPrefix () {
87                 return providerDialPrefix;
88         }
89
90         @Override
91         public void setProviderDialPrefix (final Long providerDialPrefix) {
92                 this.providerDialPrefix = providerDialPrefix;
93         }
94
95         @Override
96         public String getProviderName () {
97                 return providerName;
98         }
99
100         @Override
101         public void setProviderName (final String providerName) {
102                 this.providerName = providerName;
103         }
104
105         @Override
106         public Country getCountry () {
107                 return this.country;
108         }
109
110         @Override
111         public void setCountry (final Country country) {
112                 this.country = country;
113         }
114
115 }