I want a SessionFactory limits it's creation to only classes mapped to a particular schema name. For example, if I have a class mapped to table "sun:account", "sun" is the schema name and "account" is the table within the schema.
Now, from spring, I want to configure a bean such SchemaSessionFactoryBean that has it's schema property set to "sun". During initialization, the bean would allow mappings created for classes mapped to the "sun" schema while removing mappings to another schema such as "microsoft:sales".
I'm currently going down the path of trying to remove invalid schemas in the postProcessConfiguration(config) method from spring's LocalSessionFactoryBean. Anyone have a better approach or know of an existing solution?
The answer to "why" is longer than I'd like to write. ;^)
|