Is it possible to to select the table used to map a specified class at runtime? Consider this example:
A legacy database contains a number of tables for customer of different countries. The columns in the tables are identical, only the table name differs:
and so on. I would like to use the same class to map their content:
from Customer c where c.id =: customerId
from CustomerUk c where c.id =: customerId
is this possible?
I've tried to use a combination of multiple SessionFactories and NamingStrategies to accomplish this, but it fails. (Seems like only the first instance created loads the mapping).