Skip to content
Snippets Groups Projects
Commit 87913acb authored by birk's avatar birk
Browse files

fixed the problem with the relations

parent 5fbc5f5b
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,8 @@ public class ShoppingList { ...@@ -34,7 +34,8 @@ public class ShoppingList {
long shoppingListID; long shoppingListID;
@OneToOne(cascade = CascadeType.ALL) @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "group_id")
private Group group; private Group group;
@ManyToMany @ManyToMany
......
...@@ -50,7 +50,7 @@ public class Group { ...@@ -50,7 +50,7 @@ public class Group {
@Column(name = "is_open") @Column(name = "is_open")
Boolean open; Boolean open;
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @OneToOne(cascade = CascadeType.ALL, mappedBy = "group")
@OnDelete(action = OnDeleteAction.CASCADE) @OnDelete(action = OnDeleteAction.CASCADE)
@JsonIgnoreProperties("groupId") @JsonIgnoreProperties("groupId")
private ShoppingList shoppingList; private ShoppingList shoppingList;
...@@ -71,8 +71,7 @@ public class Group { ...@@ -71,8 +71,7 @@ public class Group {
this.user.add(userGroupTable); this.user.add(userGroupTable);
} }
@OneToOne @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "group")
@JoinColumn(name = "group_id")
@JsonIgnoreProperties("group") @JsonIgnoreProperties("group")
@OnDelete(action = OnDeleteAction.CASCADE) @OnDelete(action = OnDeleteAction.CASCADE)
private Fridge fridge; private Fridge fridge;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment