2 * Copyright (C) 2015 Roland Haeder
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.
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.
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/>.
17 package org.mxchange.jphone.phonenumbers.smsprovider;
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;
33 * A POJO for cellphone providers
35 * @author Roland Haeder
37 @Entity (name = "cellphone_provider")
38 @Table (name = "cellphone_provider")
39 public class CellphoneProvider implements SmsProvider {
44 private static final long serialVersionUID = 185_878_567_810_590L;
50 @GeneratedValue (strategy = GenerationType.IDENTITY)
51 @Column (name = "provider_id", length = 20, nullable = false, updatable = false)
52 private Long providerId;
55 * Provider dial prefix (example: 0177 for German E+)
57 @Basic (optional = false)
58 @Column (name = "provider_dial_prefix", length = 10, nullable = false)
59 private Long providerDialPrefix;
62 * Name of the provider
64 @Basic (optional = false)
65 @Column (name = "provider_name", length = 30, nullable = false)
66 private String providerName;
69 * Country instance ('s dial data)
71 @JoinColumn (name = "provider_country_id", nullable = false)
72 @OneToOne (targetEntity = CountryData.class, optional = false, cascade = CascadeType.ALL)
73 private Country country;
76 public Long getProviderId () {
81 public void setProviderId (final Long providerId) {
82 this.providerId = providerId;
86 public Long getProviderDialPrefix () {
87 return providerDialPrefix;
91 public void setProviderDialPrefix (final Long providerDialPrefix) {
92 this.providerDialPrefix = providerDialPrefix;
96 public String getProviderName () {
101 public void setProviderName (final String providerName) {
102 this.providerName = providerName;
106 public Country getCountry () {
111 public void setCountry (final Country country) {
112 this.country = country;