Sounds like a good use of the Restrictions class. Here's an example of its use using a greaterthan. Just do the query on the central object, get the objects back, and you can just call the getters to get the associated objectsl
Code:
Session session = HibernateUtil.beginTransaction();
Criteria criteria =
session.createCriteria(User.class);
criteria.add(Restrictions.gt("id", 5));
List results = criteria.list();
HibernateUtil.commitTransaction();
for (int i = 0; i<results.size(); i++) {
System.out.println(results.get(i).toString());
}
Here's a tutorial on using the Hibernate Criteria API:
http://www.hiberbook.com/HiberBookWeb/l ... riteriaapi