All,
This has got to be a simple matter but for some reason I'm not getting it.
Is there a way in hibernate to set the schema dynamically at runtime?
I have multiple users say 2000. Over time new users are added and others are deleted. Each user uses the same table set. I would like to do something like userA.table1, userA.table2, etc. This is all easy enough in a straight SQL world, but not so apparent with Hibernate. I want to automatically generate a schema for a user when they register, then have them accessing only that schema when they login.
I don't know who the user is until they log on so an annotation like this @Table(schema="username") doesn't work.
Do I need to dispense with annotations and go back to configuration files and some how try to manipulate these?
|