Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- @Table(name = "users_rooms")
- public class UserRoom {
- @EmbeddedId
- private UserRoomId id;
- @NotNull
- @ManyToOne(fetch = FetchType.LAZY)
- @JoinColumn(name = "user_id")
- private User user;
- public User getUser() { return user; }
- public void setUser(User user) { this.user = user; }
- @NotNull
- @ManyToOne(fetch = FetchType.LAZY)
- @JoinColumn(name = "room_id")
- private Room room;
- public Room getRoom() { return room; }
- public void setRoom(Room room) { this.room = room; }
- @Column(name = "notifications_muted")
- private boolean notificationsMuted;
- public boolean getNotificationsMuted() { return notificationsMuted; }
- public void setNotificationsMuted(boolean notificationsMuted) { this.notificationsMuted = notificationsMuted; }
- public UserRoom() {}
- public UserRoom(User user, Room room){
- this.user = user; this.room = room;
- }
- }
- @Embeddable
- class UserRoomId implements Serializable{
- private Long user;
- private Long room;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement