-->
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.  [ 4 posts ] 
Author Message
 Post subject: Help with HQL
PostPosted: Thu Nov 06, 2003 8:24 am 
Newbie

Joined: Thu Nov 06, 2003 8:15 am
Posts: 2
I have an application structured almost the same as the example of customer>order>lineItem>product

but when i am trying to query for the transactions that have a certain product involved, like in SQL:

select transactionInfo.* from transactionInfo join transactionItemInfo join productInfo where productInfo.productId = 4

i am having all kinds of difficulties in HQL.

finally, i tried just having:

"select transactionInfo from TransactionInfo as transactionInfo "+
"join transactionInfo.transItems as item join item.productInfo as product "

the above gave me an error of:

net.sf.hibernate.QueryException: collection of values in from clause

what is proper way to translate that SQL statement to HQL...??

FYI:
in the TransactionInfo.hbm.xml

<list name="transItems" table="transactionItemInfo" lazy="false">
<key column="transactionId"/>
<index column="transactionItemId"/>
<composite-element class="volante.mlm.data.TransactionItemInfo">
<property name="productQuantity"/>
<property name="version"/>
<many-to-one name="productInfo" column="productId"/>
</composite-element>
</list>

thanks a bunch.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 06, 2003 8:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
You need Hibernate 2.1.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 07, 2003 2:07 am 
Newbie

Joined: Thu Nov 06, 2003 8:15 am
Posts: 2
Do i need to make any change in my mappings (or coding) if i switch to ver 2.1..?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 07, 2003 2:13 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
No.


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