i cannot use sorting on join tables. Let me explain;
i have three tables. users, groups and user_groups. my JPA entities are User, UserGroup, UserGroupPK, Groups.
in fact the output that i want is: "SELECT * FROM user_groups ug JOIN users u ON u.ID = ug.UserID ORDER BY u.name;"
so i try to use hibernate criteria API.
CriteriaImpl criteria = (CriteriaImpl) session.createCriteria(UserGroup.class);
List userGroups = criteria.list();
The error is could not resolve property: pk.user.name of: models.UserGroup
how can i use criteria API on join tables?