-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to work with foreign key field directly?
PostPosted: Fri Dec 05, 2003 6:40 am 
Regular
Regular

Joined: Fri Nov 21, 2003 10:23 am
Posts: 81
I have entity A that contains foreign key A.bpk to entity B that have primary key B.bpk. When I define in hibernate for class A many-to-one association to class B (using A.getB() ), I am not able to work with A.bpk, because I have only class reference to B.

But I need in some cases to work directly with A.bpk (load from db and persist to db without loading all B class and setting B class)

Is it posible with hibernate?
It is very important for me.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 6:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
calling a.getB().getId() does not initialize the proxy for the B.


Top
 Profile  
 
 Post subject: it is not what I need (if I understand good)
PostPosted: Fri Dec 05, 2003 6:57 am 
Regular
Regular

Joined: Fri Nov 21, 2003 10:23 am
Posts: 81
f.e. from client a would like to send updated object A (where foreign key was changed) to server (session bean - via webservices). I receive in session bean object A with new value A.bpk (as well other fields with new values). How can I persist this A object via hibernate to db?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.