import java.util.Date;
import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
import org.mxchange.jcontactsbusiness.model.employee.Employee;
+import org.mxchange.jcontactsbusiness.model.opening_times.OpeningTimes;
import org.mxchange.jcountry.model.data.Country;
import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
*/
void setBranchSuiteNumber (final Short branchSuiteNumber);
+ /**
+ * Getter for opening times for this branch office
+ * <p>
+ * @return Opening times
+ */
+ OpeningTimes getBranchOpeningTimes ();
+
+ /**
+ * Setter for opening times for this branch office
+ * <p>
+ * @param branchOpeningTimes Opening times
+ */
+ void setBranchOpeningTimes (final OpeningTimes branchOpeningTimes);
+
+ /**
+ * Getter for branch office owning employee
+ * <p>
+ * @return Owning employee
+ */
+ Employee getBranchOwnerEmployee ();
+
+ /**
+ * Setter for branch office owning employee
+ * <p>
+ * @param branchOwnerEmployee Owning employee
+ */
+ void setBranchOwnerEmployee (final Employee branchOwnerEmployee);
+
/**
* Getter for branch office's ZIP code
* <p>
import org.mxchange.jcontactsbusiness.model.basicdata.CompanyBasicData;
import org.mxchange.jcontactsbusiness.model.employee.CompanyEmployee;
import org.mxchange.jcontactsbusiness.model.employee.Employee;
+import org.mxchange.jcontactsbusiness.model.opening_times.OpeningTimes;
import org.mxchange.jcountry.model.data.Country;
import org.mxchange.jcountry.model.data.CountryData;
import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
/**
* Reference to contact person
*/
- @JoinColumn (name = "branch_contact_employee_id")
+ @JoinColumn (name = "branch_contact_employee_id", referencedColumnName = "employee_id")
@OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.REFRESH)
private Employee branchContactEmployee;
/**
* Branch office's country code
*/
- @JoinColumn (name = "branch_country_id", nullable = false)
+ @JoinColumn (name = "branch_country_id", referencedColumnName = "country_id", nullable = false)
@OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false)
private Country branchCountry;
/**
* Branch office's main fax number: +ccxxxxxxxxxx
*/
- @JoinColumn (name = "branch_fax_number_id")
+ @JoinColumn (name = "branch_fax_number_id", referencedColumnName = "id_id")
@OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL)
private DialableFaxNumber branchFaxNumber;
/**
* Branch office's main land-line number: +ccxxxxxxxxxx
*/
- @JoinColumn (name = "branch_landline_number_id")
+ @JoinColumn (name = "branch_landline_number_id", referencedColumnName = "landline_id")
@OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL)
private DialableLandLineNumber branchLandLineNumber;
/**
* Numer of this branch office
*/
- @Column(name = "branch_number")
+ @Column (name = "branch_number")
private Long branchNumber;
+ /**
+ * Opening times for this branch office
+ */
+ @JoinColumn (name = "branch_owner_employee_id", referencedColumnName = "opening_times_id")
+ @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.REFRESH)
+ private OpeningTimes branchOpeningTimes;
+
+ /**
+ * Reference to branch office owner (for example some franchise supermarkets
+ * will have an owning person (here generally referred as "employee") who
+ * will own one or more branch offices.
+ */
+ @JoinColumn (name = "branch_owner_employee_id", referencedColumnName = "employee_id")
+ @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.REFRESH)
+ private Employee branchOwnerEmployee;
+
/**
* Branch office's store (if multiple-store building)
*/
/**
* User owner instance
*/
- @JoinColumn (name = "branch_user_id")
+ @JoinColumn (name = "branch_user_id", referencedColumnName = "user_id")
@OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH)
private User branchUserOwner;
this.branchNumber = branchNumber;
}
+ @Override
+ public OpeningTimes getBranchOpeningTimes () {
+ return this.branchOpeningTimes;
+ }
+
+ @Override
+ public void setBranchOpeningTimes (final OpeningTimes branchOpeningTimes) {
+ this.branchOpeningTimes = branchOpeningTimes;
+ }
+
+ @Override
+ public Employee getBranchOwnerEmployee () {
+ return this.branchOwnerEmployee;
+ }
+
+ @Override
+ public void setBranchOwnerEmployee (final Employee branchOwnerEmployee) {
+ this.branchOwnerEmployee = branchOwnerEmployee;
+ }
+
@Override
public Short getBranchStore () {
return this.branchStore;