I'm using HQL named queries (which are defined in XML files) to query my database using Hibernate. Some of the queries are quite complex and I find myself copy-pasting substantial parts of one query to another, similar one.
I was wondering if it's possible at all to define common parts in a "named query fragment" and reuse that fragment across all my queries?
I don't want to use the criteria API, btw, because I feel more comfortable formulating the queries in XML. Some of them are quite a monster already and implementing them with an API would make them even more unreadable.