import javax.persistence.Table;
import org.mxchange.jcontactsbusiness.BusinessContact;
import org.mxchange.jcontactsbusiness.CompanyContact;
+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;
+import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData;
/**
* A POJO for company departments
@ManyToOne (targetEntity = CompanyContact.class, cascade = CascadeType.ALL, optional = false, fetch = FetchType.EAGER)
private BusinessContact departmentCompany;
+ /**
+ * Where this department is located
+ */
+ @JoinColumn (name = "department_branch_id")
+ @ManyToOne (targetEntity = CompanyBranchOffice.class, cascade = CascadeType.ALL)
+ private BranchOffice departmentBranchOffice;
+
+ /**
+ * Where this department is located
+ */
+ @JoinColumn (name = "department_headquarters_id")
+ @OneToOne (targetEntity = CompanyHeadQuartersData.class, cascade = CascadeType.ALL)
+ private HeadQuartersData departentHeadquarters;
+
/**
* Id number
*/
return true;
}
+ @Override
+ public HeadQuartersData getDepartentHeadquarters () {
+ return this.departentHeadquarters;
+ }
+
+ @Override
+ public void setDepartentHeadquarters (final HeadQuartersData departentHeadquarters) {
+ this.departentHeadquarters = departentHeadquarters;
+ }
+
+ @Override
+ public BranchOffice getDepartmentBranchOffice () {
+ return this.departmentBranchOffice;
+ }
+
+ @Override
+ public void setDepartmentBranchOffice (final BranchOffice departmentBranchOffice) {
+ this.departmentBranchOffice = departmentBranchOffice;
+ }
+
@Override
public BusinessContact getDepartmentCompany () {
return this.departmentCompany;
import java.io.Serializable;
import org.mxchange.jcontactsbusiness.BusinessContact;
+import org.mxchange.jcontactsbusiness.branch.BranchOffice;
import org.mxchange.jcontactsbusiness.employee.Employee;
+import org.mxchange.jcontactsbusiness.headquarters.HeadQuartersData;
/**
* A POJI for company departments
*/
void setDepartmentCompany (final BusinessContact departmentCompany);
+ /**
+ * Getter for connection to company headquarters
+ * <p>
+ * @return Connection to company headquarters
+ */
+ HeadQuartersData getDepartentHeadquarters ();
+
+ /**
+ * Setter for connection to company headquarters
+ * <p>
+ * @param departentHeadquarters Connection to company headquarters
+ */
+ void setDepartentHeadquarters (final HeadQuartersData departentHeadquarters);
+
+ /**
+ * Getter for connection to company branch office
+ * <p>
+ * @return Connection to company branch office
+ */
+ BranchOffice getDepartmentBranchOffice ();
+
+ /**
+ * Setter for connection to company branch office
+ * <p>
+ * @param departmentBranchOffice Connection to company branch office
+ */
+ void setDepartmentBranchOffice (final BranchOffice departmentBranchOffice);
+
/**
* Getter for department id
* <p>
void setDepartmentName (final String departmentName);
@Override
- boolean equals (final Object object);
+ boolean equals (final Object object);
@Override
- int hashCode ();
+ int hashCode ();
}