-->
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: Problem using formula ....
PostPosted: Tue May 17, 2005 10:21 am 
Newbie

Joined: Mon May 09, 2005 1:32 am
Posts: 7
Location: Bangalore
Hi,
I am having problem using formula...
I have somthing like this....
<property name="deptName" formula="(select dept.deptName from DepartmentDTO dept where dept.empId=empId)"/>
where deptName is a field which belongs to EmployeeDTO and i have to get the deptName from the DepartmentDTO based on the empId...i am getting a problem like java.lang.ClassCastException :org.hibernate.mapping.Formula....why is it so?my deptName in EmployeeDTO and DepartmentDTO both are String type........actually the Employee table has a primary key which is composite id (combination of empId and deptId)..can anyone help me out why am i getting this....i think this should work fine........is the problem coz of the composite id..?i am usinh hibernate3..
Thanking u in advance....


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 17, 2005 11:20 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
have you noticed that formula is pure SQL?

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 17, 2005 11:28 am 
Newbie

Joined: Mon May 09, 2005 1:32 am
Posts: 7
Location: Bangalore
Thanks,
Actually even when i used pure sql select statements it didnt work...i think sice the property i am using is in a composite-element i think formula doesnt work within the composite element or component?am i right..?


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.