(no subject) [message #687431] |
Thu, 09 June 2011 22:42 |
Eclipse User |
|
|
|
Originally posted by: <forums-noreply
Got a newbie HQL/SQL question for you all.
I have the following HQL statement
select count(ID) from Asset as asset where asset.StateInfo.MobileProvider.Name='Vodafone'
The Asset->StateInfo reference is one-to-many and the rest are one-to-one. This query generates a QueryException:
org.hibernate.QueryException: illegal attempt to dereference collection [asset0_.`id`.StateInfo] with element property reference [MobileProvider] [select count(ID) from Asset as asset where asset.StateInfo.MobileProvider.Name='Vodafone']
I'm sure this is because I'm doing the asset.StateInfo reference in the query all wrong. Would some kind soul please set me on the right path?
Cheers,
mike
|
|
|
|
Powered by
FUDForum. Page generated in 0.03007 seconds