import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@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 = BusinessOpeningTime.class, cascade = CascadeType.ALL)
+ @ManyToMany (targetEntity = BusinessOpeningTime.class, cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private List<OpeningTime> branchOpeningTimes;
/**