No, It is Immpossible. The only thing you can do if you have only one case where an association should not be selected is to use DTO instead of your entity and use predictions to get only what you want:
String hql = "select firstName, lastName from User u where ...";
List<Object[]> rows = session.createQuery(hql).list();
List<UserDTO> users = new ArrayList<UserDTO>(rows.size());
for (Object[] row : rows) {
users.add(new User((String) row[0], (String) row[1]));
}
return users;
source
share