I have implemented the following example in this blog https://www.tutorialandexample.com/hibernate-n-1-select-problem/ but I am not happy with the output that I am getting. I am displaying the output which shows Department details and Employee details printed as twice . I want to get the Department details and Employee details to be displayed only once . Any Suggestions ?
The size of depart List object is 4 but actually it must be 2 .
output :
Department details::::: 20 IT Employees details:::::: 21 jyotika 22 shubham Department details::::: 20 IT Employees details:::::: 21 jyotika 22 shubham Department details::::: 23 Accounts Employees details:::::: 24 nihal 25 neha Department details::::: 23 Accounts Employees details:::::: 24 nihal 25 neha