-->
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: Accessing columns of parent table in child object
PostPosted: Mon Mar 08, 2004 11:09 pm 
Newbie

Joined: Thu Mar 04, 2004 5:41 am
Posts: 10
I am newbie to Hibernate trying to find a weird solution. I am not sure I am right or is it possible in hibernate

Here is the scenario
Dept
Dept_ID
DeptName
Description
DeptAlias
DeptLocation


Employee
Employee_id
EmpName
Dept_ID
....


I successfully implemented the relation where I can get the Dept object for each employee.

My reqt is to get only the deptname for each employee, Not the entire Dept object ..


Is is possible that I can able to retrieve the dept selected columns in Employee object.

Employee.
------
Employee_id
empName
deptname
deptlocation


Please let me know if it possible.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 09, 2004 5:50 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can trick something with the "formula" attribute of a property probably, or just do a get method which does return parent.getName() if you don't care about loading the parent.


Top
 Profile  
 
 Post subject: Accessing Parent data in child object
PostPosted: Tue Mar 09, 2004 9:20 am 
Newbie

Joined: Thu Mar 04, 2004 5:41 am
Posts: 10
Thanks

Can you please send me the chunk of code for e.g.

thanks


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.