import java.io.Serializable;
import java.util.Date;
+import java.util.List;
import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
import org.mxchange.jcontactsbusiness.model.employee.Employee;
import org.mxchange.jcontactsbusiness.model.opening_times.OpeningTimes;
* <p>
* @return Opening times
*/
- OpeningTimes getBranchOpeningTimes ();
+ List<OpeningTimes> getBranchOpeningTimes ();
/**
* Setter for opening times for this branch office
* <p>
* @param branchOpeningTimes Opening times
*/
- void setBranchOpeningTimes (final OpeningTimes branchOpeningTimes);
+ void setBranchOpeningTimes (final List<OpeningTimes> branchOpeningTimes);
/**
* Getter for branch office owning employee
import java.text.MessageFormat;
import java.util.Date;
+import java.util.List;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
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.BusinessOpeningTimes;
import org.mxchange.jcontactsbusiness.model.opening_times.OpeningTimes;
import org.mxchange.jcountry.model.data.Country;
import org.mxchange.jcountry.model.data.CountryData;
/**
* Branch office's main fax number: +ccxxxxxxxxxx
*/
- @JoinColumn (name = "branch_fax_number_id", referencedColumnName = "id_id")
+ @JoinColumn (name = "branch_fax_number_id", referencedColumnName = "fax_id")
@OneToOne (targetEntity = FaxNumber.class, cascade = CascadeType.ALL)
private DialableFaxNumber branchFaxNumber;
/**
* 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;
+ @JoinTable (name = "branch_opening_times", joinColumns = @JoinColumn(name = "branch_opening_id", referencedColumnName = "branch_id"), inverseJoinColumns = @JoinColumn(name = "opening_branch_id", referencedColumnName = "opening_times_id"))
+ @ManyToMany (targetEntity = BusinessOpeningTimes.class, cascade = CascadeType.REFRESH)
+ private List<OpeningTimes> branchOpeningTimes;
/**
* Reference to branch office owner (for example some franchise supermarkets
}
@Override
- public OpeningTimes getBranchOpeningTimes () {
+ public List<OpeningTimes> getBranchOpeningTimes () {
return this.branchOpeningTimes;
}
@Override
- public void setBranchOpeningTimes (final OpeningTimes branchOpeningTimes) {
+ public void setBranchOpeningTimes (final List<OpeningTimes> branchOpeningTimes) {
this.branchOpeningTimes = branchOpeningTimes;
}