For each table, you may add two more attributes named "entity" and "schema". entity is defined to prevent collision between entities with the same name in different schemas, and schema is your real database namespace. Then you use the entity name in your HQL. We have tested this method with MySQL. On saturday, when I am back at work, I will be able to send you hbm.xml files if you need more details, but I think searching those two attributes will guide you to the answer.