user is one to one with address,i want to find users who's address is null ,i use the codes as follows: Session session = sessionFactory.openSession();
Criteria query = session.createCriteria(User.class);
query.add(Restrictions.isNotNull("address"));
query.setMaxResults(limit); List<User> users = query.list();
it does't work i check the sql that hibernate generates
...from user this_ left outer join address address2_ on this_.Id=address2_.userId where this_.Id is not null limit ?
it's wrong this_.id should be address2_Id,i dont know whether it's a bug
|