This may be my favorite Hibernate query of all time.  That is the only reason that I am creating a Gist around it.