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.jcontactsbusiness.branch;
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 company branch offices
35 * @author Roland Haeder
37 @Entity (name = "company_branches")
38 @Table (name = "company_branches")
39 public class CompanyBranchOffice implements BranchOffice, Comparable<BranchOffice> {
44 private static final long serialVersionUID = 47_957_817_276_871_852L;
50 @GeneratedValue (strategy = GenerationType.IDENTITY)
51 @Column (name = "branch_id", length = 20, nullable = false, updatable = false)
52 private Long branchId;
55 * Branch office's street name
57 @Basic (optional = false)
58 @Column (name = "branch_street", length = 100, nullable = false)
59 private String branchStreet;
62 * Branch office's house number
64 @Basic (optional = false)
65 @Column (name = "branch_house_number", length = 3, nullable = false)
66 private Short branchHouseNumber;
69 * Branch office's store (if multiple-store building)
71 @Column (name = "branch_store", length = 3)
72 private Short branchStore;
75 * Branch office's suite number (if applyable)
77 @Column (name = "branch_suite_number", length = 4)
78 private Short branchSuiteNumber;
81 * Branch office's ZIP code
83 @Basic (optional = false)
84 @Column (name = "branch_zip_code", length = 6, nullable = false)
85 private Integer branchZipCode;
88 * Branch office's city name
90 @Basic (optional = false)
91 @Column (name = "branch_city", length = 100, nullable = false)
92 private String branchCity;
95 * Branch office's country code
97 @JoinColumn (name = "branch_country_id", nullable = false)
98 @OneToOne(targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false)
99 private Country branchCountry;
102 * Branch office's main phone number: +ccxxxxxxxxxx
104 @Column (name = "branch_phone_number", length = 20)
105 private String branchPhoneNumber;
108 * Branch office's main fax number: +ccxxxxxxxxxx
110 @Column (name = "branch_fax_number", length = 20)
111 private String branchFaxNumber;
114 * Branch office's main email address (example: branch-name@company.com)
116 @Column (name = "branch_email_address", length = 100)
117 private String branchEmailAddress;
120 public int compareTo (final BranchOffice branchOffice) {
121 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
125 public String getBranchCity () {
126 return this.branchCity;
130 public void setBranchCity (final String branchCity) {
131 this.branchCity = branchCity;
135 public Country getBranchCountry () {
136 return this.branchCountry;
140 public void setBranchCountry (final Country branchCountry) {
141 this.branchCountry = branchCountry;
145 public String getBranchEmailAddress () {
146 return this.branchEmailAddress;
150 public void setBranchEmailAddress (final String branchEmailAddress) {
151 this.branchEmailAddress = branchEmailAddress;
155 public String getBranchFaxNumber () {
156 return this.branchFaxNumber;
160 public void setBranchFaxNumber (String branchFaxNumber) {
161 this.branchFaxNumber = branchFaxNumber;
165 public Short getBranchHouseNumber () {
166 return this.branchHouseNumber;
170 public void setBranchHouseNumber (final Short branchHouseNumber) {
171 this.branchHouseNumber = branchHouseNumber;
175 public String getBranchPhoneNumber () {
176 return this.branchPhoneNumber;
180 public void setBranchPhoneNumber (final String branchPhoneNumber) {
181 this.branchPhoneNumber = branchPhoneNumber;
185 public Short getBranchStore () {
186 return this.branchStore;
190 public void setBranchStore (final Short branchStore) {
191 this.branchStore = branchStore;
195 public String getBranchStreet () {
196 return this.branchStreet;
200 public void setBranchStreet (final String branchStreet) {
201 this.branchStreet = branchStreet;
205 public Short getBranchSuiteNumber () {
206 return this.branchSuiteNumber;
210 public void setBranchSuiteNumber (final Short branchSuiteNumber) {
211 this.branchSuiteNumber = branchSuiteNumber;
215 public Integer getBranchZipCode () {
216 return this.branchZipCode;
220 public void setBranchZipCode (final Integer branchZipCode) {
221 this.branchZipCode = branchZipCode;
225 public Long getBranchId () {
226 return this.branchId;
230 public void setBranchId (final Long branchId) {
231 this.branchId = branchId;