Satyadas is right, you need to free yourself from the chains of query languages, and start looking at your problems from an object oriented standpoint, and that's what the Criteria API will do.
Look at how this simple, object oriented Java code finds all the users who have not verified their status:
Code:
User user = new User();
user.setVerified(false);
Example example = Example.create(user);
Session session = HibernateUtil.beginTransaction();
Criteria criteria = session.createCriteria(User.class);
criteria.add(example);
List results = criteria.list();
HibernateUtil.commitTransaction();
for (int i = 0; i<results.size(); i++) {
System.out.println(results.get(i).toString());
}
You could do something very, very similar with your Person class, and sidestep the whole need to figure out a query in the first place.
Here's a little tutorial on how to use the Criteria API from which that code snippet originates:
http://www.hiberbook.com/HiberBookWeb/learn.jsp?tutorial=09howtousethecriteriaapi
My signature links have some tutorials on creating DAOs that can help you create reusable components that can use the Criteria API effectively.
Good luck!