]> git.mxchange.org Git - jcontacts-business-core.git/blob - src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java
it should all be ids ...
[jcontacts-business-core.git] / src / org / mxchange / jcontactsbusiness / branch / CompanyBranchOffice.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.jcontactsbusiness.branch;
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 company branch offices
34  * <p>
35  * @author Roland Haeder
36  */
37 @Entity (name = "company_branches")
38 @Table (name = "company_branches")
39 public class CompanyBranchOffice implements BranchOffice, Comparable<BranchOffice> {
40
41         /**
42          * Serial number
43          */
44         private static final long serialVersionUID = 47_957_817_276_871_852L;
45
46         /**
47          * Id number
48          */
49         @Id
50         @GeneratedValue (strategy = GenerationType.IDENTITY)
51         @Column (name = "branch_id", length = 20, nullable = false, updatable = false)
52         private Long branchId;
53
54         /**
55          * Branch office's street name
56          */
57         @Basic (optional = false)
58         @Column (name = "branch_street", length = 100, nullable = false)
59         private String branchStreet;
60
61         /**
62          * Branch office's house number
63          */
64         @Basic (optional = false)
65         @Column (name = "branch_house_number", length = 3, nullable = false)
66         private Short branchHouseNumber;
67
68         /**
69          * Branch office's store (if multiple-store building)
70          */
71         @Column (name = "branch_store", length = 3)
72         private Short branchStore;
73
74         /**
75          * Branch office's suite number (if applyable)
76          */
77         @Column (name = "branch_suite_number", length = 4)
78         private Short branchSuiteNumber;
79
80         /**
81          * Branch office's ZIP code
82          */
83         @Basic (optional = false)
84         @Column (name = "branch_zip_code", length = 6, nullable = false)
85         private Integer branchZipCode;
86
87         /**
88          * Branch office's city name
89          */
90         @Basic (optional = false)
91         @Column (name = "branch_city", length = 100, nullable = false)
92         private String branchCity;
93
94         /**
95          * Branch office's country code
96          */
97         @JoinColumn (name = "branch_country_id", nullable = false)
98         @OneToOne(targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false)
99         private Country branchCountry;
100
101         /**
102          * Branch office's main phone number: +ccxxxxxxxxxx
103          */
104         @Column (name = "branch_phone_number", length = 20)
105         private String branchPhoneNumber;
106
107         /**
108          * Branch office's main fax number: +ccxxxxxxxxxx
109          */
110         @Column (name = "branch_fax_number", length = 20)
111         private String branchFaxNumber;
112
113         /**
114          * Branch office's main email address (example: branch-name@company.com)
115          */
116         @Column (name = "branch_email_address", length = 100)
117         private String branchEmailAddress;
118
119         @Override
120         public int compareTo (final BranchOffice branchOffice) {
121                 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
122         }
123
124         @Override
125         public String getBranchCity () {
126                 return this.branchCity;
127         }
128
129         @Override
130         public void setBranchCity (final String branchCity) {
131                 this.branchCity = branchCity;
132         }
133
134         @Override
135         public Country getBranchCountry () {
136                 return this.branchCountry;
137         }
138
139         @Override
140         public void setBranchCountry (final Country branchCountry) {
141                 this.branchCountry = branchCountry;
142         }
143
144         @Override
145         public String getBranchEmailAddress () {
146                 return this.branchEmailAddress;
147         }
148
149         @Override
150         public void setBranchEmailAddress (final String branchEmailAddress) {
151                 this.branchEmailAddress = branchEmailAddress;
152         }
153
154         @Override
155         public String getBranchFaxNumber () {
156                 return this.branchFaxNumber;
157         }
158
159         @Override
160         public void setBranchFaxNumber (String branchFaxNumber) {
161                 this.branchFaxNumber = branchFaxNumber;
162         }
163
164         @Override
165         public Short getBranchHouseNumber () {
166                 return this.branchHouseNumber;
167         }
168
169         @Override
170         public void setBranchHouseNumber (final Short branchHouseNumber) {
171                 this.branchHouseNumber = branchHouseNumber;
172         }
173
174         @Override
175         public String getBranchPhoneNumber () {
176                 return this.branchPhoneNumber;
177         }
178
179         @Override
180         public void setBranchPhoneNumber (final String branchPhoneNumber) {
181                 this.branchPhoneNumber = branchPhoneNumber;
182         }
183
184         @Override
185         public Short getBranchStore () {
186                 return this.branchStore;
187         }
188
189         @Override
190         public void setBranchStore (final Short branchStore) {
191                 this.branchStore = branchStore;
192         }
193
194         @Override
195         public String getBranchStreet () {
196                 return this.branchStreet;
197         }
198
199         @Override
200         public void setBranchStreet (final String branchStreet) {
201                 this.branchStreet = branchStreet;
202         }
203
204         @Override
205         public Short getBranchSuiteNumber () {
206                 return this.branchSuiteNumber;
207         }
208
209         @Override
210         public void setBranchSuiteNumber (final Short branchSuiteNumber) {
211                 this.branchSuiteNumber = branchSuiteNumber;
212         }
213
214         @Override
215         public Integer getBranchZipCode () {
216                 return this.branchZipCode;
217         }
218
219         @Override
220         public void setBranchZipCode (final Integer branchZipCode) {
221                 this.branchZipCode = branchZipCode;
222         }
223
224         @Override
225         public Long getBranchId () {
226                 return this.branchId;
227         }
228
229         @Override
230         public void setBranchId (final Long branchId) {
231                 this.branchId = branchId;
232         }
233 }