Hi!
I am using Hibernate 3.0 with JBoss 4.0.3 and Microsoft SQLServer.
In the sql server there are 3 different databases with identical schemas. On logging in a web application, the user should be asked to select one of the three databases and from that point on he should transact only with this database. The session factory to the sql server is created by a jboss hibernate service once, on server startup.
Is it possible that i could avoid writing the hibernate mappings and the persistence classes three times (one for each database)? Is there any way to change the name of the schema that a table belongs to just before the query is executed? Is it possible that event listeners would help? Any ideas would be appreciated.
Thanks in advance.
|