-->
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: abt <property formula="">
PostPosted: Fri Jan 27, 2006 2:15 pm 
Beginner
Beginner

Joined: Sun Jan 22, 2006 8:47 pm
Posts: 31
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hi,
iam trying to use subselect query..Iam getting exception tht

:Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

<hibernate-mapping package="hibernate">

<class name="ResInfo" table="resinfo">

<id name="resId" column="res_id" >
<generator class="assigned"/>
</id>


<property name="firstName" column="first_name" type="string"/>

<property name="aPhys" formula="(select r.first_name from resinfo as r,pro as p where r.res_id =p.pract_id)"/>

<property name="lastName" column="last_name" type="string" />


</class>
</hibernate-mapping>


In the main method iam using a hql query like:

select res.aPhys from ResInfo res;


Iam getting the exception..Is there a rule tht subquery written in
<property formula=""/>
shuld return only one result...
How to solve this problem..Can any one pls help..
Thnx..


Top
 Profile  
 
 Post subject: Still need help?
PostPosted: Fri Jan 27, 2006 2:30 pm 
Newbie

Joined: Tue Jan 03, 2006 12:19 pm
Posts: 5
Not sure if you still need this, but the only thing I saw formula in a property for is for derived values (computations and such). If it returns more than one, use a collection (one-to-many, many-to-many, etc.) with a forumla attribute.

http://www.hibernate.org/hib_docs/v3/re ... pping.html


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.