From a91a1426858c64fcd5b9b6fe4566e6ce11954245 Mon Sep 17 00:00:00 2001 From: Rohan Sircar Date: Mon, 18 Nov 2019 12:24:43 +0530 Subject: [PATCH] changed usersession fetchtype to lazy --- chatto/src/main/java/org/ros/chatto/model/UserSession.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chatto/src/main/java/org/ros/chatto/model/UserSession.java b/chatto/src/main/java/org/ros/chatto/model/UserSession.java index 286fb3a..6263d90 100644 --- a/chatto/src/main/java/org/ros/chatto/model/UserSession.java +++ b/chatto/src/main/java/org/ros/chatto/model/UserSession.java @@ -2,7 +2,9 @@ package org.ros.chatto.model; import java.time.Instant; +import javax.persistence.CascadeType; import javax.persistence.Entity; +import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @@ -10,8 +12,6 @@ import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; -import org.ros.chatto.model.ChatUser; - import lombok.Data; @Data @@ -22,7 +22,7 @@ public class UserSession { @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; // private String sessionId; - @OneToOne + @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JoinColumn(name = "user_id") private ChatUser user;