Hi. I have 2 models
Code:
public class User extends BaseObject{
private Long id;
private String name;
private String location;
private String sex;
private String birthdate;
private List friends;
.......
public class Friend extends BaseObject{
private Long id;
private User fk;
private String friend;
.......
if I show 1 User and all of his friends, a query will be such:
Code:
hql = "From User u " +
"left outer join fetch u.friends f where u.id = ?";
Result:
Code:
John / m / London / Bill
Bob
Ann
And I need to show out all of friends, and friends of this User select in multiple-selection. Example:
Code:
John / m/ London / <Bill>
<Bob>
<Ann>
Andy
David
How correct to write a query?