-->
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: Newb getting owned by an external read-only view!
PostPosted: Tue Feb 21, 2006 7:30 pm 
Newbie

Joined: Mon Feb 20, 2006 8:05 pm
Posts: 8
Hibernate version: 3.1
Name and version of the database you are using: Oracle 9i

I'm sure I'll end up looking like an idiot, but I've been spinning on this long enough that I don't care.

I'm trying to get Hibernate in the door for use by our time by trying it out on a very small application. A standard for our team is for user profile information to be published to each app we write from HR at the database level through a read-only view. App data is then associated with users using the employee ID we get from this HR employee profile view. I have no problems creating an object that (only) encapsulates direct access to this view. Unfortunately, a common task within all of our apps is to store information about people that always needs to be "joined" (at least that's what I do in the non-hibernate world) with the HR profile view using the employee ID. I can't for the life of me get this to work the way I'd expect with Hibernate.

For example, I'd like to create a domain object for employees associated with the project that displays information held in the HR profile view, where saving new instances of the object will create a new row in the AssociatedEmployee table (that probably only would have a single column for the employee ID). How would some of you hibernate veterans suggest I get started with this situation?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2006 5:40 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Create an immutable class for the read-only view table (<class name="EmployeeHRRecord" mutable="false" ...>). Put an instance of this class into your AssociatedEmployed class (which isn't immutable).


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.