why not. IMO a better trick would be to use hibernate custom value types for the foreign keys. Then it will be easy to check these types in the template. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069349#4069349 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069349