A self hosted chat application with end-to-end encrypted messaging.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
685 B

  1. package org.ros.chatto.model;
  2. import java.time.Instant;
  3. import javax.persistence.Entity;
  4. import javax.persistence.FetchType;
  5. import javax.persistence.GeneratedValue;
  6. import javax.persistence.GenerationType;
  7. import javax.persistence.Id;
  8. import javax.persistence.JoinColumn;
  9. import javax.persistence.OneToOne;
  10. import javax.persistence.Table;
  11. import lombok.Data;
  12. @Data
  13. @Entity
  14. @Table(name = "user_sessions")
  15. public class UserSession {
  16. @Id
  17. @GeneratedValue(strategy = GenerationType.IDENTITY)
  18. private int id;
  19. @OneToOne(fetch = FetchType.LAZY)
  20. @JoinColumn(name = "user_id")
  21. private ChatUser user;
  22. private boolean online;
  23. private int numSessions;
  24. private Instant timeStamp;
  25. }