Created
August 27, 2021 11:22
-
-
Save saqibmehmoodgit/8a5dcfaca268d2acf8a5d80848bb3ed7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version 1 version 2 version 3 | |
@Entity public class UserPost public class UserInstitute | |
public class User { { | |
{ String name; String name; | |
String name; List<Post> post ; List<Insitiute> insitute; | |
List<Post> post ; } } | |
List<Insitiute> insitute; | |
} | |
"select from User u fetch join u.post where id = 1" | |
it will result in inner join query so correct but | |
when i return User from Rest controller than it put | |
another query for institute whihc is unnecessary .so i make | |
Dto and use map struct to solve my problem (version 2). | |
Than i need User and Institute and i make another DTO (version 3). | |
My question is that if i need just User than make another DTO? and | |
If need User , Post , Institue togather than make another DTO ? | |
Please help to solve problem . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment