changed usersession fetchtype to lazy

This commit is contained in:
Rohan Sircar 2019-11-18 12:24:43 +05:30
parent 84c2c7c245
commit a91a142685

View File

@ -2,7 +2,9 @@ package org.ros.chatto.model;
import java.time.Instant; import java.time.Instant;
import javax.persistence.CascadeType;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
@ -10,8 +12,6 @@ import javax.persistence.JoinColumn;
import javax.persistence.OneToOne; import javax.persistence.OneToOne;
import javax.persistence.Table; import javax.persistence.Table;
import org.ros.chatto.model.ChatUser;
import lombok.Data; import lombok.Data;
@Data @Data
@ -22,7 +22,7 @@ public class UserSession {
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private int id; private int id;
// private String sessionId; // private String sessionId;
@OneToOne @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "user_id") @JoinColumn(name = "user_id")
private ChatUser user; private ChatUser user;