-->
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.  [ 2 posts ] 
Author Message
 Post subject: can I change @table & @schema at runtime?
PostPosted: Tue Feb 10, 2009 4:55 pm 
Newbie

Joined: Fri Jan 30, 2009 6:31 am
Posts: 13
Location: Bucharest/Romania
Hi All,

I'm using JPA to persist data to a Postgres database. Being a web application I want that for each user which I register (is a private application) a separate schema is created in the database. The EJB layer was designed for a specific schema so is it possible to choose which schema to be used by EJB layer at login time?

To keep it short:

user one (in application) -> schema one (in Postgres)
user two -> schema two

setup at runtime during login.

Is this the right approach to get this functionality? Maybe this can be set from JBoss?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 10, 2009 5:11 pm 
Newbie

Joined: Fri Jan 30, 2009 5:08 pm
Posts: 17
Location: Florida
I am not super strong with hibernate, but reading about Filters in Annotations API, it seems as though you Filter the table based on a variable. I haven't tested any of this but it is a theory. If the filter works you could change schema and table using the filter and setting table name schema.table.


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

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.