From: Roland Haeder Date: Fri, 2 Oct 2015 13:16:22 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e9bf959acbd00f0d6b72dc0b93804ccb3a1a65bf;p=jcontacts-business-core.git Continued: - POJOs and POJIs should be "basicly finished" now - maybe still some properties are missing Signed-off-by:Roland Häder --- diff --git a/lib/jcontacts-core.jar b/lib/jcontacts-core.jar new file mode 100644 index 0000000..13b4e24 Binary files /dev/null and b/lib/jcontacts-core.jar differ diff --git a/nbproject/project.properties b/nbproject/project.properties index 670d0c9..f3912e3 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,10 +1,11 @@ annotation.processing.enabled=true -annotation.processing.enabled.in.editor=false +annotation.processing.enabled.in.editor=true annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output application.title=jcontacts-business-core -application.vendor=KLC +application.vendor=Roland Haeder +auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: @@ -29,13 +30,17 @@ dist.jar=${dist.dir}/jcontacts-business-core.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= +file.reference.jcontacts-core.jar=lib/jcontacts-core.jar includes=** +jar.archive.disabled=${jnlp.enabled} jar.compress=false +jar.index=${jnlp.enabled} javac.classpath=\ + ${file.reference.jcontacts-core.jar}:\ ${libs.jpa20-persistence.classpath} # Space-separated list of extra javac options -javac.compilerargs= -javac.deprecation=false +javac.compilerargs=-Xlint:unchecked -Xlint:deprecation +javac.deprecation=true javac.processorpath=\ ${javac.classpath} javac.source=1.7 @@ -46,19 +51,33 @@ javac.test.classpath=\ javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= -javadoc.author=false +javadoc.author=true javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false -javadoc.private=false +javadoc.private=true javadoc.splitindex=true javadoc.use=true -javadoc.version=false -javadoc.windowtitle= +javadoc.version=true +javadoc.windowtitle=Business Contacts Library +jnlp.codebase.type=no.codebase +jnlp.descriptor=application +jnlp.enabled=false +jnlp.mixed.code=default +jnlp.offline-allowed=false +jnlp.signed=false +jnlp.signing= +jnlp.signing.alias= +jnlp.signing.keystore= +# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed +manifest.custom.codebase= +# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions) +manifest.custom.permissions= meta.inf.dir=${src.dir}/META-INF mkdist.disabled=true platform.active=default_platform +project.license=gpl30 run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} @@ -70,5 +89,6 @@ run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 +source.reference.jcontacts-core.jar=../jcontacts-core/src/ src.dir=src test.src.dir=test diff --git a/src/org/mxchange/jcontactsbusiness/BusinessContact.java b/src/org/mxchange/jcontactsbusiness/BusinessContact.java index 2362ba4..2728073 100644 --- a/src/org/mxchange/jcontactsbusiness/BusinessContact.java +++ b/src/org/mxchange/jcontactsbusiness/BusinessContact.java @@ -18,7 +18,8 @@ package org.mxchange.jcontactsbusiness; import java.io.Serializable; import java.util.List; -import org.mxchange.jcontactsbusiness.basicdata.BasicBusinessData; +import org.mxchange.jcontactsbusiness.basicdata.BusinessBasicData; +import org.mxchange.jcontactsbusiness.branch.BranchOffice; import org.mxchange.jcontactsbusiness.employee.Employee; import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData; @@ -34,14 +35,28 @@ public interface BusinessContact extends Serializable { *

* @return Basic company data */ - public BasicBusinessData getBasicBusinessData (); + public BusinessBasicData getBasicBusinessData (); /** * Setter for basic company data *

* @param basicBusinessData Basic company data */ - public void setBasicBusinessData (final BasicBusinessData basicBusinessData); + public void setBasicBusinessData (final BusinessBasicData basicBusinessData); + + /** + * Getter for branches list + *

+ * @return Branches list + */ + public List getBranches (); + + /** + * Setter for branches list + *

+ * @param branches Branches list + */ + public void setBranches (final List branches); /** * Getter for basic company data @@ -50,6 +65,11 @@ public interface BusinessContact extends Serializable { */ public Long getCompanyContactId (); + /** + * Setter for basic company data + *

+ * @param companyContactId Basic company data + */ public void setCompanyContactId (final Long companyContactId); /** diff --git a/src/org/mxchange/jcontactsbusiness/CompanyContact.java b/src/org/mxchange/jcontactsbusiness/CompanyContact.java index 1a049a2..781fd46 100644 --- a/src/org/mxchange/jcontactsbusiness/CompanyContact.java +++ b/src/org/mxchange/jcontactsbusiness/CompanyContact.java @@ -26,8 +26,10 @@ import javax.persistence.JoinColumn; import javax.persistence.OneToMany; import javax.persistence.OneToOne; import javax.persistence.Table; -import org.mxchange.jcontactsbusiness.basicdata.BasicBusinessData; +import org.mxchange.jcontactsbusiness.basicdata.BusinessBasicData; import org.mxchange.jcontactsbusiness.basicdata.CompanyBasicData; +import org.mxchange.jcontactsbusiness.branch.BranchOffice; +import org.mxchange.jcontactsbusiness.branch.CompanyBranchOffice; import org.mxchange.jcontactsbusiness.employee.CompanyEmployee; import org.mxchange.jcontactsbusiness.employee.Employee; import org.mxchange.jcontactsbusiness.headquarters.CompanyHeadQuartersData; @@ -48,56 +50,73 @@ public class CompanyContact implements BusinessContact, Comparable branches; /** - * Reference to headquarters data + * Id number */ - @JoinColumn (name = "headquarters_data_id", nullable = false, updatable = false, unique = true) - @OneToOne (targetEntity = CompanyHeadQuartersData.class, optional = false) - private HeadQuartersData headQuartersData; + @Id + @Column (name = "company_contact_id", length = 20, nullable = false, unique = true, updatable = false) + @GeneratedValue (strategy = GenerationType.IDENTITY) + private Long companyContactId; /** * Reference to CEO "employee" */ - @JoinColumn(name = "company_founder_id", nullable = false, updatable = false) - @OneToOne(targetEntity = CompanyEmployee.class, optional = false) + @JoinColumn (name = "company_founder_id", nullable = false, updatable = false) + @OneToOne (targetEntity = CompanyEmployee.class, optional = false) private Employee companyFounder; /** * Reference to employee list */ - @JoinColumn (name = "employees_id", nullable = false, updatable = false, unique = true) - @OneToMany(targetEntity = CompanyEmployee.class) + @JoinColumn (name = "company_employees_id", nullable = false, updatable = false, unique = true) + @OneToMany (targetEntity = CompanyEmployee.class) private List employees; + /** + * Reference to headquarters data + */ + @JoinColumn (name = "company_headquarters_data_id", nullable = false, updatable = false, unique = true) + @OneToOne (targetEntity = CompanyHeadQuartersData.class, optional = false) + private HeadQuartersData headQuartersData; + @Override public int compareTo (final BusinessContact businessContact) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override - public BasicBusinessData getBasicBusinessData () { + public BusinessBasicData getBasicBusinessData () { return this.basicBusinessData; } @Override - public void setBasicBusinessData (final BasicBusinessData basicBusinessData) { + public void setBasicBusinessData (final BusinessBasicData basicBusinessData) { this.basicBusinessData = basicBusinessData; } + @Override + public List getBranches () { + return this.branches; + } + + @Override + public void setBranches (final List branches) { + this.branches = branches; + } + @Override public Long getCompanyContactId () { return this.companyContactId; diff --git a/src/org/mxchange/jcontactsbusiness/basicdata/BasicBusinessData.java b/src/org/mxchange/jcontactsbusiness/basicdata/BasicBusinessData.java deleted file mode 100644 index dad32ca..0000000 --- a/src/org/mxchange/jcontactsbusiness/basicdata/BasicBusinessData.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.jcontactsbusiness.basicdata; - -import java.io.Serializable; -import org.mxchange.jcontactsbusiness.logo.BusinessLogo; - -/** - * A POJI for basic business data - *

- * @author Roland Haeder - */ -public interface BasicBusinessData extends Serializable { - - /** - * Getter for id number - *

- * @return Id number - */ - public Long getCompanyBasicId (); - - /** - * Setter for id number - *

- * @param companyBasicId Id number - */ - public void setCompanyBasicId (final Long companyBasicId); - - /** - * Getter for comments - *

- * @return Comments - */ - public String getCompanyComments (); - - /** - * Setter for comments - *

- * @param companyComments Comments - */ - public void setCompanyComments (final String companyComments); - - /** - * Getter for email address - *

- * @return Email address - */ - public String getCompanyEmailAddress (); - - /** - * Setter for email address - *

- * @param companyEmailAddress Email address - */ - public void setCompanyEmailAddress (final String companyEmailAddress); - - /** - * Getter for fax number - *

- * @return Fax number - */ - public String getCompanyFaxNumber (); - - /** - * Setter for fax number - *

- * @param companyFaxNumber Fax number - */ - public void setCompanyFaxNumber (final String companyFaxNumber); - - /** - * Getter for legal status - *

- * @return Legal status - */ - public String getCompanyLegalStatus (); - - /** - * Setter for legal status - *

- * @param companyLegalStatus Legal status - */ - public void setCompanyLegalStatus (final String companyLegalStatus); - - /** - * Getter for company logo - *

- * @return Company logo - */ - public BusinessLogo getCompanyLogo (); - - /** - * Setter for company logo - *

- * @param companyLogo Company logo - */ - public void setCompanyLogo (final BusinessLogo companyLogo); - - /** - * Getter for company name - *

- * @return Company name - */ - public String getCompanyName (); - - /** - * Setter for company name - *

- * @param companyName Company name - */ - public void setCompanyName (final String companyName); - - /** - * Getter for phone number - *

- * @return Phone number - */ - public String getCompanyPhoneNumber (); - - /** - * Setter for phone number - *

- * @param companyPhoneNumber Phone number - */ - public void setCompanyPhoneNumber (final String companyPhoneNumber); - - /** - * Getter for tax number - *

- * @return Tax number - */ - public String getCompanyTaxNumber (); - - /** - * Setter for tax number - *

- * @param companyTaxNumber Tax number - */ - public void setCompanyTaxNumber (final String companyTaxNumber); - - /** - * Getter for website URL - *

- * @return Website URL - */ - public String getCompanyWebsiteUrl (); - - /** - * Setter for website URL - *

- * @param companyWebsiteUrl Website URL - */ - public void setCompanyWebsiteUrl (final String companyWebsiteUrl); -} diff --git a/src/org/mxchange/jcontactsbusiness/basicdata/BusinessBasicData.java b/src/org/mxchange/jcontactsbusiness/basicdata/BusinessBasicData.java new file mode 100644 index 0000000..d0c2ff6 --- /dev/null +++ b/src/org/mxchange/jcontactsbusiness/basicdata/BusinessBasicData.java @@ -0,0 +1,168 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcontactsbusiness.basicdata; + +import java.io.Serializable; +import org.mxchange.jcontactsbusiness.logo.BusinessLogo; + +/** + * A POJI for basic business data + *

+ * @author Roland Haeder + */ +public interface BusinessBasicData extends Serializable { + + /** + * Getter for id number + *

+ * @return Id number + */ + public Long getCompanyBasicId (); + + /** + * Setter for id number + *

+ * @param companyBasicId Id number + */ + public void setCompanyBasicId (final Long companyBasicId); + + /** + * Getter for comments + *

+ * @return Comments + */ + public String getCompanyComments (); + + /** + * Setter for comments + *

+ * @param companyComments Comments + */ + public void setCompanyComments (final String companyComments); + + /** + * Getter for email address + *

+ * @return Email address + */ + public String getCompanyEmailAddress (); + + /** + * Setter for email address + *

+ * @param companyEmailAddress Email address + */ + public void setCompanyEmailAddress (final String companyEmailAddress); + + /** + * Getter for fax number + *

+ * @return Fax number + */ + public String getCompanyFaxNumber (); + + /** + * Setter for fax number + *

+ * @param companyFaxNumber Fax number + */ + public void setCompanyFaxNumber (final String companyFaxNumber); + + /** + * Getter for legal status + *

+ * @return Legal status + */ + public String getCompanyLegalStatus (); + + /** + * Setter for legal status + *

+ * @param companyLegalStatus Legal status + */ + public void setCompanyLegalStatus (final String companyLegalStatus); + + /** + * Getter for company logo + *

+ * @return Company logo + */ + public BusinessLogo getCompanyLogo (); + + /** + * Setter for company logo + *

+ * @param companyLogo Company logo + */ + public void setCompanyLogo (final BusinessLogo companyLogo); + + /** + * Getter for company name + *

+ * @return Company name + */ + public String getCompanyName (); + + /** + * Setter for company name + *

+ * @param companyName Company name + */ + public void setCompanyName (final String companyName); + + /** + * Getter for phone number + *

+ * @return Phone number + */ + public String getCompanyPhoneNumber (); + + /** + * Setter for phone number + *

+ * @param companyPhoneNumber Phone number + */ + public void setCompanyPhoneNumber (final String companyPhoneNumber); + + /** + * Getter for tax number + *

+ * @return Tax number + */ + public String getCompanyTaxNumber (); + + /** + * Setter for tax number + *

+ * @param companyTaxNumber Tax number + */ + public void setCompanyTaxNumber (final String companyTaxNumber); + + /** + * Getter for website URL + *

+ * @return Website URL + */ + public String getCompanyWebsiteUrl (); + + /** + * Setter for website URL + *

+ * @param companyWebsiteUrl Website URL + */ + public void setCompanyWebsiteUrl (final String companyWebsiteUrl); +} diff --git a/src/org/mxchange/jcontactsbusiness/basicdata/CompanyBasicData.java b/src/org/mxchange/jcontactsbusiness/basicdata/CompanyBasicData.java index 690602d..a632344 100644 --- a/src/org/mxchange/jcontactsbusiness/basicdata/CompanyBasicData.java +++ b/src/org/mxchange/jcontactsbusiness/basicdata/CompanyBasicData.java @@ -36,17 +36,13 @@ import org.mxchange.jcontactsbusiness.logo.CompanyLogo; */ @Entity (name = "company_basic_data") @Table (name = "company_basic_data") -public class CompanyBasicData implements BasicBusinessData, Comparable { +public class CompanyBasicData implements BusinessBasicData, Comparable { /** * Serial number */ private static final long serialVersionUID = 486_895_878_178_761L; - public static long getSerialVersionUID () { - return serialVersionUID; - } - /** * Id number */ @@ -115,7 +111,7 @@ public class CompanyBasicData implements BasicBusinessData, Comparable. + */ +package org.mxchange.jcontactsbusiness.branch; + +import java.io.Serializable; + +/** + * A POJI for branch offices + *

+ * @author Roland Haeder + */ +public interface BranchOffice extends Serializable { + + /** + * Getter for branch office's city name + *

+ * @return Branch office's city name + */ + public String getBranchCity (); + + /** + * Setter for branch office's city name + *

+ * @param branchCity Branch office's city name + */ + public void setBranchCity (final String branchCity); + + /** + * Getter for branch office's email address + *

+ * @return Branch office's email address + */ + public String getBranchEmailAddress (); + + /** + * Setter for branch office's email address + *

+ * @param branchEmailAddress Branch office's email address + */ + public void setBranchEmailAddress (final String branchEmailAddress); + + /** + * Getter for branch office's fax number + *

+ * @return Branch office's fax number + */ + public String getBranchFaxNumber (); + + /** + * Setter for branch office's fax number + *

+ * @param branchFaxNumber Branch office's fax number + */ + public void setBranchFaxNumber (String branchFaxNumber); + + /** + * Getter for branch office's house number + *

+ * @return Branch office's house number + */ + public Short getBranchHouseNumber (); + + /** + * Setter for branch office's house number + *

+ * @param branchHouseNumber Branch office's house number + */ + public void setBranchHouseNumber (final Short branchHouseNumber); + + /** + * Getter for branch office's phone number + *

+ * @return Branch office's phone number + */ + public String getBranchPhoneNumber (); + + /** + * Setter for branch office's phone number + *

+ * @param branchPhoneNumber Branch office's phone number + */ + public void setBranchPhoneNumber (final String branchPhoneNumber); + + /** + * Getter for branch office's store + *

+ * @return Branch office's store + */ + public Short getBranchStore (); + + /** + * Setter for branch office's store + *

+ * @param branchStore Branch office's store + */ + public void setBranchStore (final Short branchStore); + + /** + * Getter for branch office's street name + *

+ * @return Branch office's street name + */ + public String getBranchStreet (); + + /** + * Setter for branch office's street name + *

+ * @param branchStreet Branch office's street name + */ + public void setBranchStreet (final String branchStreet); + + /** + * Getter for branch office's suite number + *

+ * @return Branch office's suite number + */ + public Short getBranchSuiteNumber (); + + /** + * Setter for branch office's suite number + *

+ * @param branchSuiteNumber Branch office's suite number + */ + public void setBranchSuiteNumber (final Short branchSuiteNumber); + + /** + * Getter for branch office's ZIP code + *

+ * @return Branch office's ZIP code + */ + public Integer getBranchZipCode (); + + /** + * Setter for branch office's ZIP code + *

+ * @param branchZipCode Branch office's ZIP code + */ + public void setBranchZipCode (final Integer branchZipCode); + + /** + * Getter for branch office's id number + *

+ * @return Branch office's id number + */ + public Long getBranchId (); + + /** + * Setter for branch office's id number + *

+ * @param branchId Branch office's id number + */ + public void setBranchId (final Long branchId); + + /** + * Getter for branch office's country code + *

+ * @return Branch office's country code + */ + public String getBranchCountryCode (); + + /** + * Setter for branch office's country code + *

+ * @param branchCountryCode Branch office's country code + */ + public void setBranchCountryCode (final String branchCountryCode); +} diff --git a/src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java b/src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java new file mode 100644 index 0000000..c0d0c9e --- /dev/null +++ b/src/org/mxchange/jcontactsbusiness/branch/CompanyBranchOffice.java @@ -0,0 +1,228 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcontactsbusiness.branch; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * A POJO for company branch offices + *

+ * @author Roland Haeder + */ +@Entity (name = "company_branches") +@Table (name = "company_branches") +public class CompanyBranchOffice implements BranchOffice, Comparable { + + /** + * Serial number + */ + private static final long serialVersionUID = 47_957_817_276_871_852L; + + /** + * Id number + */ + @Id + @GeneratedValue (strategy = GenerationType.IDENTITY) + @Column (name = "branch_id", length = 20, nullable = false, unique = true, updatable = false) + private Long branchId; + + /** + * Branch office's street name + */ + @Basic (optional = false) + @Column (name = "branch_street", length = 100, nullable = false) + private String branchStreet; + + /** + * Branch office's house number + */ + @Basic(optional = false) + @Column(name = "branch_house_number", length = 3, nullable = false) + private Short branchHouseNumber; + + /** + * Branch office's store (if multiple-store building) + */ + @Column(name = "branch_store", length = 3) + private Short branchStore; + + /** + * Branch office's suite number (if applyable) + */ + @Column(name = "branch_suite_number", length = 4) + private Short branchSuiteNumber; + + /** + * Branch office's ZIP code + */ + @Basic(optional = false) + @Column(name = "branch_zip_code", length = 6, nullable = false) + private Integer branchZipCode; + + /** + * Branch office's city name + */ + @Basic(optional = false) + @Column(name = "branch_city", length = 100, nullable = false) + private String branchCity; + + /** + * Branch office's country code + */ + @Basic(optional = false) + @Column(name = "branch_country_code", length = 100, nullable = false) + private String branchCountryCode; + + /** + * Branch office's main phone number: +ccxxxxxxxxxx + */ + @Column (name = "branch_phone_number", length = 20) + private String branchPhoneNumber; + + /** + * Branch office's main fax number: +ccxxxxxxxxxx + */ + @Column (name = "branch_fax_number", length = 20) + private String branchFaxNumber; + + /** + * Branch office's main email address (example: branch-name@company.com) + */ + @Column (name = "branch_email_address", length = 100) + private String branchEmailAddress; + + @Override + public int compareTo (final BranchOffice branchOffice) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public String getBranchCity () { + return this.branchCity; + } + + @Override + public void setBranchCity (final String branchCity) { + this.branchCity = branchCity; + } + + @Override + public String getBranchCountryCode () { + return this.branchCountryCode; + } + + @Override + public void setBranchCountryCode (final String branchCountryCode) { + this.branchCountryCode = branchCountryCode; + } + + @Override + public String getBranchEmailAddress () { + return this.branchEmailAddress; + } + + @Override + public void setBranchEmailAddress (final String branchEmailAddress) { + this.branchEmailAddress = branchEmailAddress; + } + + @Override + public String getBranchFaxNumber () { + return this.branchFaxNumber; + } + + @Override + public void setBranchFaxNumber (String branchFaxNumber) { + this.branchFaxNumber = branchFaxNumber; + } + + @Override + public Short getBranchHouseNumber () { + return this.branchHouseNumber; + } + + @Override + public void setBranchHouseNumber (final Short branchHouseNumber) { + this.branchHouseNumber = branchHouseNumber; + } + + @Override + public String getBranchPhoneNumber () { + return this.branchPhoneNumber; + } + + @Override + public void setBranchPhoneNumber (final String branchPhoneNumber) { + this.branchPhoneNumber = branchPhoneNumber; + } + + @Override + public Short getBranchStore () { + return this.branchStore; + } + + @Override + public void setBranchStore (final Short branchStore) { + this.branchStore = branchStore; + } + + @Override + public String getBranchStreet () { + return this.branchStreet; + } + + @Override + public void setBranchStreet (final String branchStreet) { + this.branchStreet = branchStreet; + } + + @Override + public Short getBranchSuiteNumber () { + return this.branchSuiteNumber; + } + + @Override + public void setBranchSuiteNumber (final Short branchSuiteNumber) { + this.branchSuiteNumber = branchSuiteNumber; + } + + @Override + public Integer getBranchZipCode () { + return this.branchZipCode; + } + + @Override + public void setBranchZipCode (final Integer branchZipCode) { + this.branchZipCode = branchZipCode; + } + + @Override + public Long getBranchId () { + return this.branchId; + } + + @Override + public void setBranchId (final Long branchId) { + this.branchId = branchId; + } +} diff --git a/src/org/mxchange/jcontactsbusiness/department/CompanyDepartment.java b/src/org/mxchange/jcontactsbusiness/department/CompanyDepartment.java new file mode 100644 index 0000000..4cc7195 --- /dev/null +++ b/src/org/mxchange/jcontactsbusiness/department/CompanyDepartment.java @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcontactsbusiness.department; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import org.mxchange.jcontactsbusiness.BusinessContact; +import org.mxchange.jcontactsbusiness.CompanyContact; +import org.mxchange.jcontactsbusiness.employee.Employee; + +/** + * A POJO for company departments + *

+ * @author Roland Haeder + */ +@Entity (name = "company_departments") +@Table (name = "company_departments") +public class CompanyDepartment implements Department, Comparable { + + /** + * Serial number + */ + private static final long serialVersionUID = 94_835_918_958_717_660L; + + /** + * Connection to company contact + */ + @JoinColumn (name = "department_company_id", nullable = false, updatable = false) + @ManyToOne (targetEntity = CompanyContact.class, optional = false) + private BusinessContact departmentCompany; + + /** + * Id number + */ + @Id + @GeneratedValue (strategy = GenerationType.IDENTITY) + @Column (name = "department_id", length = 20, nullable = false, unique = true, updatable = false) + private Long departmentId; + + /** + * Department lead employee + */ + @Basic (optional = false) + @JoinColumn (name = "department_lead_id", nullable = false) + private Employee departmentLead; + + /** + * Department name + */ + @Basic (optional = false) + @Column (name = "department_name", length = 100, nullable = false) + private String departmentName; + + @Override + public int compareTo (final Department department) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public BusinessContact getDepartmentCompany () { + return this.departmentCompany; + } + + @Override + public void setDepartmentCompany (final BusinessContact departmentCompany) { + this.departmentCompany = departmentCompany; + } + + @Override + public Long getDepartmentId () { + return this.departmentId; + } + + @Override + public void setDepartmentId (final Long departmentId) { + this.departmentId = departmentId; + } + + @Override + public Employee getDepartmentLead () { + return this.departmentLead; + } + + @Override + public void setDepartmentLead (final Employee departmentLead) { + this.departmentLead = departmentLead; + } + + @Override + public String getDepartmentName () { + return this.departmentName; + } + + @Override + public void setDepartmentName (final String departmentName) { + this.departmentName = departmentName; + } +} diff --git a/src/org/mxchange/jcontactsbusiness/department/Department.java b/src/org/mxchange/jcontactsbusiness/department/Department.java new file mode 100644 index 0000000..6eca9b8 --- /dev/null +++ b/src/org/mxchange/jcontactsbusiness/department/Department.java @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcontactsbusiness.department; + +import java.io.Serializable; +import org.mxchange.jcontactsbusiness.BusinessContact; +import org.mxchange.jcontactsbusiness.employee.Employee; + +/** + * A POJI for company departments + *

+ * @author Roland Haeder + */ +public interface Department extends Serializable { + + /** + * Getter for connection to company contact + *

+ * @return Connection to company contact + */ + public BusinessContact getDepartmentCompany (); + + /** + * Setter for connection to company contact + *

+ * @param departmentCompany Connection to company contact + */ + public void setDepartmentCompany (final BusinessContact departmentCompany); + + /** + * Getter for department id + *

+ * @return Department id + */ + public Long getDepartmentId (); + + /** + * Setter for department id + *

+ * @param departmentId Department id + */ + public void setDepartmentId (final Long departmentId); + + /** + * Getter for department lead employee + *

+ * @return Department lead employee + */ + public Employee getDepartmentLead (); + + /** + * Setter for department lead employee + *

+ * @param departmentLead Department lead employee + */ + public void setDepartmentLead (final Employee departmentLead); + + /** + * Getter for department name + *

+ * @return Department name + */ + public String getDepartmentName (); + + /** + * Setter for department name + *

+ * @param departmentName Department name + */ + public void setDepartmentName (final String departmentName); +} diff --git a/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java b/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java index 9036f6d..1b96e1f 100644 --- a/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java +++ b/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployee.java @@ -16,20 +16,29 @@ */ package org.mxchange.jcontactsbusiness.employee; +import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; import javax.persistence.Table; +import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jcontacts.contact.UserContact; +import org.mxchange.jcontactsbusiness.branch.BranchOffice; +import org.mxchange.jcontactsbusiness.branch.CompanyBranchOffice; +import org.mxchange.jcontactsbusiness.department.CompanyDepartment; +import org.mxchange.jcontactsbusiness.department.Department; /** * A POJO for company employees (including CEO) *

* @author Roland Haeder */ -@Entity(name = "company_employees") -@Table(name = "company_employees") +@Entity (name = "employees") +@Table (name = "employees") public class CompanyEmployee implements Employee, Comparable { /** @@ -41,12 +50,155 @@ public class CompanyEmployee implements Employee, Comparable { * Id number */ @Id - @Column(name = "company_employee_id", length = 20, nullable = false, unique = true, updatable = false) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long companyEmployeeId; + @Column (name = "employee_id", length = 20, nullable = false, unique = true, updatable = false) + @GeneratedValue (strategy = GenerationType.IDENTITY) + private Long employeeId; + + /** + * Branch office the employee works at + */ + @JoinColumn (name = "employee_branch_id") + @OneToOne (targetEntity = CompanyBranchOffice.class, orphanRemoval = true) + private BranchOffice employeeBranchOffice; + + /** + * Department the employee works at + */ + @JoinColumn (name = "employee_department_id", nullable = false) + @OneToOne (targetEntity = CompanyDepartment.class, optional = false) + private Department employeeDepartment; + + /** + * Employee's email address + */ + @Column (name = "employee_email_address", length = 30) + private String employeeEmailAddress; + + /** + * Employee's business mobile number + */ + @Column (name = "employee_mobile_number", length = 20) + private String employeeMobileNumber; + + /** + * Employee's number + */ + @Basic (optional = false) + @Column (name = "employee_number", length = 20, nullable = false) + private String employeeNumber; + + /** + * Employee's personal data + */ + @JoinColumn (name = "employee_personal_id", nullable = false, unique = true, updatable = false) + @OneToOne (optional = false, targetEntity = UserContact.class) + private Contact employeePersonalData; + + /** + * Employee's phone extension (or number if different) + */ + @Column (name = "employee_phone_extension", length = 20) + private String employeePhoneExtension; + + /** + * Employee's position (example: CEO) + */ + @Basic (optional = false) + @Column (name = "employee_status", length = 50, nullable = false) + private String employeePosition; @Override public int compareTo (final Employee employee) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } + + @Override + public BranchOffice getEmployeeBranchOffice () { + return this.employeeBranchOffice; + } + + @Override + public void setEmployeeBranchOffice (final BranchOffice employeeBranchOffice) { + this.employeeBranchOffice = employeeBranchOffice; + } + + @Override + public Department getEmployeeDepartment () { + return this.employeeDepartment; + } + + @Override + public void setEmployeeDepartment (final Department employeeDepartment) { + this.employeeDepartment = employeeDepartment; + } + + @Override + public String getEmployeeEmailAddress () { + return this.employeeEmailAddress; + } + + @Override + public void setEmployeeEmailAddress (final String employeeEmailAddress) { + this.employeeEmailAddress = employeeEmailAddress; + } + + @Override + public Long getEmployeeId () { + return this.employeeId; + } + + @Override + public void setEmployeeId (final Long employeeId) { + this.employeeId = employeeId; + } + + @Override + public String getEmployeeMobileNumber () { + return this.employeeMobileNumber; + } + + @Override + public void setEmployeeMobileNumber (final String employeeMobileNumber) { + this.employeeMobileNumber = employeeMobileNumber; + } + + @Override + public String getEmployeeNumber () { + return this.employeeNumber; + } + + @Override + public void setEmployeeNumber (final String employeeNumber) { + this.employeeNumber = employeeNumber; + } + + @Override + public Contact getEmployeePersonalData () { + return this.employeePersonalData; + } + + @Override + public void setEmployeePersonalData (final Contact employeePersonalData) { + this.employeePersonalData = employeePersonalData; + } + + @Override + public String getEmployeePhoneExtension () { + return this.employeePhoneExtension; + } + + @Override + public void setEmployeePhoneExtension (final String employeePhoneExtension) { + this.employeePhoneExtension = employeePhoneExtension; + } + + @Override + public String getEmployeePosition () { + return this.employeePosition; + } + + @Override + public void setEmployeePosition (final String employeePosition) { + this.employeePosition = employeePosition; + } } diff --git a/src/org/mxchange/jcontactsbusiness/employee/Employee.java b/src/org/mxchange/jcontactsbusiness/employee/Employee.java index 61ed021..04f0aa8 100644 --- a/src/org/mxchange/jcontactsbusiness/employee/Employee.java +++ b/src/org/mxchange/jcontactsbusiness/employee/Employee.java @@ -17,6 +17,9 @@ package org.mxchange.jcontactsbusiness.employee; import java.io.Serializable; +import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jcontactsbusiness.branch.BranchOffice; +import org.mxchange.jcontactsbusiness.department.Department; /** * A POJI for employees @@ -25,4 +28,129 @@ import java.io.Serializable; */ public interface Employee extends Serializable { + /** + * Getter for employee's branch office + *

+ * @return Employee's branch office + */ + public BranchOffice getEmployeeBranchOffice (); + + /** + * Setter for employee's branch office + *

+ * @param employeeBranchOffice Employee's branch office + */ + public void setEmployeeBranchOffice (final BranchOffice employeeBranchOffice); + + /** + * Getter for employee's department + *

+ * @return Employee's department + */ + public Department getEmployeeDepartment (); + + /** + * Setter for employee's department + *

+ * @param employeeDepartment Employee's department + */ + public void setEmployeeDepartment (final Department employeeDepartment); + + /** + * Getter for employee's email address + *

+ * @return Employee's email address + */ + public String getEmployeeEmailAddress (); + + /** + * Setter for employee's email address + *

+ * @param employeeEmailAddress Employee's email address + */ + public void setEmployeeEmailAddress (final String employeeEmailAddress); + + /** + * Getter for employee's id number + *

+ * @return Employee's id number + */ + public Long getEmployeeId (); + + /** + * Setter for employee's id number + *

+ * @param employeeId Employee's id number + */ + public void setEmployeeId (final Long employeeId); + + /** + * Getter for employee's mobile number + *

+ * @return Employee's mobile number + */ + public String getEmployeeMobileNumber (); + + /** + * Setter for employee's mobile number + *

+ * @param employeeMobileNumber Employee's mobile number + */ + public void setEmployeeMobileNumber (final String employeeMobileNumber); + + /** + * Getter for employee's number + *

+ * @return Employee's number + */ + public String getEmployeeNumber (); + + /** + * Setter for employee's number + *

+ * @param employeeNumber Employee's number + */ + public void setEmployeeNumber (final String employeeNumber); + + /** + * Getter for employee's personal data + *

+ * @return Employee's personal data + */ + public Contact getEmployeePersonalData (); + + /** + * Setter for employee's personal data + *

+ * @param employeePersonalData Employee's personal data + */ + public void setEmployeePersonalData (final Contact employeePersonalData); + + /** + * Getter for employee's phone number/extension + *

+ * @return Employee's phone number/extension + */ + public String getEmployeePhoneExtension (); + + /** + * Setter for employee's phone number/extension + *

+ * @param employeePhoneExtension Employee's phone number/extension + */ + public void setEmployeePhoneExtension (final String employeePhoneExtension); + + /** + * Getter for employee's position + *

+ * @return Employee's position + */ + public String getEmployeePosition (); + + /** + * Setter for employee's position + *

+ * @param employeePosition Employee's position + */ + public void setEmployeePosition (final String employeePosition); } diff --git a/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java b/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java index 5cc445b..445ea3a 100644 --- a/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java +++ b/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadQuartersData.java @@ -16,6 +16,7 @@ */ package org.mxchange.jcontactsbusiness.headquarters; +import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -28,8 +29,8 @@ import javax.persistence.Table; *

* @author Roland Haeder */ -@Entity (name = "company_headquarters") -@Table (name = "company_headquarters") +@Entity (name = "headquarters") +@Table (name = "headquarters") public class CompanyHeadQuartersData implements HeadQuartersData, Comparable { /** @@ -37,6 +38,27 @@ public class CompanyHeadQuartersData implements HeadQuartersData, Comparable + * @return Headquarters' city name + */ + public String getHeadquartersCity (); + + /** + * Setter for headquarters' city name + *

+ * @param headquartersCity Headquarters' city name + */ + public void setHeadquartersCity (final String headquartersCity); + + /** + * Getter for headquarters' country code + *

+ * @return Headquarters' country code + */ + public String getHeadquartersCountryCode (); + + /** + * Setter for headquarters' country code + *

+ * @param headquartersCountryCode Headquarters' country code + */ + public void setHeadquartersCountryCode (final String headquartersCountryCode); + + /** + * Getter for headquarters' house number + *

+ * @return Headquarters' house number + */ + public Short getHeadquartersHouseNumber (); + + /** + * Setter for headquarters' house number + *

+ * @param headquartersHouseNumber Headquarters' house number + */ + public void setHeadquartersHouseNumber (final Short headquartersHouseNumber); + + /** + * Getter for headquarters' id number + *

+ * @return Headquarters' id number + */ + public Long getHeadquartersId (); + + /** + * Setter for headquarters' id number + *

+ * @param headquartersId Headquarters' id number + */ + public void setHeadquartersId (final Long headquartersId); + + /** + * Getter for headquarters' store number + *

+ * @return Headquarters' store number + */ + public Short getHeadquartersStore (); + + /** + * Setter for headquarters' store number + *

+ * @param headquartersStore Headquarters' store number + */ + public void setHeadquartersStore (final Short headquartersStore); + + /** + * Getter for headquarters' street name + *

+ * @return Headquarters' street name + */ + public String getHeadquartersStreet (); + + /** + * Setter for headquarters' street name + *

+ * @param headquartersStreet Headquarters' street name + */ + public void setHeadquartersStreet (final String headquartersStreet); + + /** + * Getter for headquarters' suite number + *

+ * @return Headquarters' suite number + */ + public Short getHeadquartersSuiteNumber (); + + /** + * Setter for headquarters' suite number + *

+ * @param headquartersSuiteNumber Headquarters' suite number + */ + public void setHeadquartersSuiteNumber (final Short headquartersSuiteNumber); + + /** + * Getter for headquarters' ZIP code + *

+ * @return Headquarters' ZIP code + */ + public Integer getHeadquartersZipCode (); + + /** + * Setter for headquarters' ZIP code + *

+ * @param headquartersZipCode Headquarters' ZIP code + */ + public void setHeadquartersZipCode (final Integer headquartersZipCode); } diff --git a/src/org/mxchange/jcontactsbusiness/logo/BusinessLogo.java b/src/org/mxchange/jcontactsbusiness/logo/BusinessLogo.java index 7900aca..3304ff7 100644 --- a/src/org/mxchange/jcontactsbusiness/logo/BusinessLogo.java +++ b/src/org/mxchange/jcontactsbusiness/logo/BusinessLogo.java @@ -25,4 +25,17 @@ import java.io.Serializable; */ public interface BusinessLogo extends Serializable { + /** + * Getter for logo's id number + *

+ * @return Logo's id number + */ + public Long getLogoId (); + + /** + * Setter for logo's id number + *

+ * @param logoId Logo's id number + */ + public void setLogoId (final Long logoId); } diff --git a/src/org/mxchange/jcontactsbusiness/logo/CompanyLogo.java b/src/org/mxchange/jcontactsbusiness/logo/CompanyLogo.java index 7dbe2fb..77c32e5 100644 --- a/src/org/mxchange/jcontactsbusiness/logo/CompanyLogo.java +++ b/src/org/mxchange/jcontactsbusiness/logo/CompanyLogo.java @@ -16,7 +16,11 @@ */ package org.mxchange.jcontactsbusiness.logo; +import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; import javax.persistence.Table; /** @@ -33,9 +37,27 @@ public class CompanyLogo implements BusinessLogo, Comparable { */ private static final long serialVersionUID = 475_871_875_718_751_285L; + /** + * Id number + */ + @Id + @GeneratedValue (strategy = GenerationType.IDENTITY) + @Column (name = "logo_id", length = 20, nullable = false, unique = true, updatable = false) + private Long logoId; + @Override public int compareTo (final BusinessLogo businessLogo) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } + @Override + public Long getLogoId () { + return this.logoId; + } + + @Override + public void setLogoId (final Long logoId) { + this.logoId = logoId; + } + }