@OneToOne(fetch=FetchType.EAGER) //LAZY @JoinColumn(name="user_profile_id") private Profile getUserProfile() { return userProfile; } FetchType.LAZY = Doesn’t load the relationships unless explicitly “asked for” via getter FetchType.EAGER = Loads ALL relationships
ref:
https://m.oschina.net/blog/327056
https://howtoprogramwithjava.com/hibernate-eager-vs-lazy-fetch-type/