Not sure, but maybe it can be optimized with some custom HQL query. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108451#4108451 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108451