2 * Copyright (C) 2015 KLC
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.headquarters;
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 headquarts data
35 * @author Roland Haeder
37 @Entity (name = "company_headquarters")
38 @Table (name = "company_headquarters")
39 public class CompanyHeadQuartersData implements HeadQuartersData, Comparable<HeadQuartersData> {
44 private static final long serialVersionUID = 385_752_948_781_761L;
47 * Headquarters' city name
49 @Basic (optional = false)
50 @Column (name = "headquarters_city", length = 100, nullable = false)
51 private String headquartersCity;
54 * Headquarter's country code
56 @JoinColumn (name = "headquarters_country_code", nullable = false)
57 @OneToOne(targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false)
58 private Country headquartersCountry;
61 * Headquarters' house number
63 @Basic (optional = false)
64 @Column (name = "headquarters_house_number", length = 4, nullable = false)
65 private Short headquartersHouseNumber;
71 @GeneratedValue (strategy = GenerationType.IDENTITY)
72 @Column (name = "headquarters_id", length = 20, nullable = false, updatable = false)
73 private Long headquartersId;
76 * Headquarters' store number (multi-store building only)
78 @Column (name = "headquarters_store", length = 3)
79 private Short headquartersStore;
82 * Headquarters' street name
84 @Basic (optional = false)
85 @Column (name = "headquarters_street", length = 100, nullable = false)
86 private String headquartersStreet;
89 * Headquarters' suite number
91 @Column (name = "headquarters_suite_number", length = 4)
92 private Short headquartersSuiteNumber;
95 * Headquarters' ZIP code
97 @Basic (optional = false)
98 @Column (name = "headquarters_zip_code", length = 6, nullable = false)
99 private Integer headquartersZipCode;
102 public int compareTo (final HeadQuartersData headQuartersData) {
103 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
107 public String getHeadquartersCity () {
108 return this.headquartersCity;
112 public void setHeadquartersCity (final String headquartersCity) {
113 this.headquartersCity = headquartersCity;
117 public Country getHeadquartersCountry () {
118 return this.headquartersCountry;
122 public void setHeadquartersCountry (final Country headquartersCountry) {
123 this.headquartersCountry = headquartersCountry;
127 public Short getHeadquartersHouseNumber () {
128 return this.headquartersHouseNumber;
132 public void setHeadquartersHouseNumber (final Short headquartersHouseNumber) {
133 this.headquartersHouseNumber = headquartersHouseNumber;
137 public Long getHeadquartersId () {
138 return this.headquartersId;
142 public void setHeadquartersId (final Long headquartersId) {
143 this.headquartersId = headquartersId;
147 public Short getHeadquartersStore () {
148 return this.headquartersStore;
152 public void setHeadquartersStore (final Short headquartersStore) {
153 this.headquartersStore = headquartersStore;
157 public String getHeadquartersStreet () {
158 return this.headquartersStreet;
162 public void setHeadquartersStreet (final String headquartersStreet) {
163 this.headquartersStreet = headquartersStreet;
167 public Short getHeadquartersSuiteNumber () {
168 return this.headquartersSuiteNumber;
172 public void setHeadquartersSuiteNumber (final Short headquartersSuiteNumber) {
173 this.headquartersSuiteNumber = headquartersSuiteNumber;
177 public Integer getHeadquartersZipCode () {
178 return this.headquartersZipCode;
182 public void setHeadquartersZipCode (final Integer headquartersZipCode) {
183 this.headquartersZipCode = headquartersZipCode;