-->
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: Modelling a relationship that crosses database boudaries
PostPosted: Tue Nov 16, 2004 1:59 pm 
Newbie

Joined: Thu Apr 01, 2004 3:36 pm
Posts: 13
Location: New York
It might sound strange in theory, but in the project I'm working on, we support authentication against external user tables by creating a view in the external database that conforms to our schema. Thus tables in our schema end up with a logical reference to the user table in the external database.

I am looking for a strategy to hide (from the DAO developer) the fact that loading the objects involves using two hibernate sessions. Conceptually, I would expect to take control over a proxy and load the related object using a different session. Assuming the mapping below, I would like to be able to simply write


Code:
computerSession.getAppUser()


and handle the details of using a second session in some (custom) proxy code. Is this possible?

Hibernate version: 2.1.6

Mapping documents:
<hibernate-mapping>
<class
name="com.knoa.server.data.ComputerSession"
table="COMPUTER_SESSION"
dynamic-update="false"
dynamic-insert="false"
>
...
<many-to-one
name="appUser"
class="com.knoa.server.data.AppUser"
cascade="none"
outer-join="false"
update="true"
insert="true"
access="property"
>
<column
name="APP_USER_ID"
/>
</many-to-one>
---
</class>

<class
name="com.knoa.server.data.AppUser"
table="APP_USER"
dynamic-update="false"
dynamic-insert="false"
>
...
</class>


Code between sessionFactory.openSession() and session.close(): Not relevant

Full stack trace of any exception that occurs: No exception

Name and version of the database you are using: MSSQL 2000 (Not relevant)

The generated SQL (show_sql=true): No SQL

Debug level Hibernate log excerpt: Not relevant


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.