-->
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: FKs and schemas : aargh!
PostPosted: Sun Oct 24, 2004 5:44 pm 
Newbie

Joined: Wed Sep 15, 2004 12:31 am
Posts: 3
Hibernate version: 2.1.6
DBMS: PostgreSQL (or any DBMS with schemas (i.e., namespaces))

Has anyone run into this situation before and solved the problem?

Basically, I want to have N schemas that each contain the same tables (and dynamically choose one schema at runtime to use via "unqualified names", e.g., select * from foobar ... will resolve to A.foobar, B.foobar, ...). So far, so good.

Now, let's say that I have 3 schemas, X, A and B.

A contains table foobar
B contains table foobar
X contains table baz, that contains a FK to foobar.

The FK early-binds at definition time to one and only one particular schema, which obviously must be the case, but which yields "every schema is an island" (choosing schema dynamically, as above, will lead to db integrity violation)... not terribly useful. (I want to partition companies' data in A and B, but said data needs to relate to common data in schema X.)

I think that Hibernate joined-subclass could be used to effect a "root" (in the OODBMS sense) in schemas A and B. This leaves me feeling underwhelmed though.

Any thoughts on this problem?

-------------------------------------
Hibernate joined-subclass comment: why do my subclasses have to have different classnames, even when they reside in different packages; the fact that Hibernate won't let me name them identically is an extra inconvenience.


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.