Hello!
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:
Code:
customer_uk
customer_de
customer_fr
and so on. I would like to use the same class to map their content:
Code:
from Customer c where c.id =: customerId
rather than
Code:
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).