Skip to content

Commit 8ecc4c1

Browse files
committed
(TP-123) feat: reservation and properties relations to User
1 parent 1f3fd2f commit 8ecc4c1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • rentplace/src/main/java/kattsyn/dev/rentplace/entities

rentplace/src/main/java/kattsyn/dev/rentplace/entities/User.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,9 @@ public class User {
5050
inverseJoinColumns = @JoinColumn(name = "property_id"))
5151
private Set<Property> favourites = new HashSet<>();
5252

53+
@OneToMany(mappedBy = "renter", cascade = CascadeType.ALL, orphanRemoval = true)
54+
private Set<Reservation> reservations = new HashSet<>();
55+
56+
@OneToMany(mappedBy = "owner", cascade = CascadeType.ALL, orphanRemoval = true)
57+
private Set<Property> properties = new HashSet<>();
5358
}

0 commit comments

Comments
 (0)