File tree Expand file tree Collapse file tree
src/main/java/edu/tamu/app/model Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313
1414import org .hibernate .annotations .Fetch ;
1515
16- import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
17-
1816import edu .tamu .framework .model .BaseEntity ;
1917
2018import static javax .persistence .InheritanceType .JOINED ;
2422@ Inheritance (strategy = JOINED )
2523public abstract class AbstractScheduler extends BaseEntity implements Scheduler {
2624
27- @ OneToMany (fetch = EAGER , cascade = CascadeType .ALL , orphanRemoval = true )
25+ @ OneToMany (fetch = EAGER , cascade = { CascadeType .ALL } , orphanRemoval = true )
2826 @ Fetch (value = SELECT )
29- @ JsonIgnoreProperties ("scheduler" )
3027 private List <Schedule > schedules ;
3128
3229 @ Column (nullable = false )
Original file line number Diff line number Diff line change @@ -28,18 +28,19 @@ public class Schedule extends BaseEntity {
2828 @ Column (nullable = false )
2929 private Long scheduledPostingEnd ;
3030
31- @ ManyToOne
31+ @ ManyToOne ( optional = false )
3232 @ JsonIgnoreProperties ("schedules" )
3333 private AbstractScheduler scheduler ;
3434
3535 @ ElementCollection (fetch = FetchType .EAGER )
3636 @ MapKeyColumn (name = "key" )
3737 @ Column (name = "value" )
3838 @ CollectionTable (name = "schedule_data" , joinColumns = @ JoinColumn (name = "schedule_id" ))
39- private Map <String , String > scheduleData = new HashMap < String , String >() ;
39+ private Map <String , String > scheduleData ;
4040
4141 public Schedule () {
4242 super ();
43+ setScheduleData (new HashMap <String , String >());
4344 }
4445
4546 public Schedule (Long start , Long end ) {
You can’t perform that action at this time.
0 commit comments