-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Schema Selection at Runtime
PostPosted: Wed Jan 12, 2011 1:50 am 
Newbie

Joined: Thu Jul 12, 2007 1:43 pm
Posts: 1
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.