-->
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: QuerySyntaxException
PostPosted: Fri May 11, 2007 2:01 am 
Newbie

Joined: Wed Apr 25, 2007 11:54 pm
Posts: 1
I'm currently upgrading to hibernate3

this is the error (used to work):

t.purchases is not mapped [SELECT DISTINCT t from sep.ecommerce.Transaction t, t.purchases p WHERE t.status = '1' AND p.product.productGroup.market.id = '2' ORDER BY t.date ASC]

There isn't any typos (i think), Any ideas what is wrong with the syntax?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 11, 2007 4:45 am 
Senior
Senior

Joined: Sat Apr 21, 2007 11:01 pm
Posts: 144
instead of:
Code:
select distinct
  t
from
  sep.ecommerce.Transaction t,
  t.purchases p
where
    t.status = '1'
    and p.product.productGroup.market.id = '2'
order by
    t.date asc


can't you just do:
Code:
select distinct
  t
from
  Transaction t
where
    t.status = '1'
    and t.purchases.product.productGroup.market.id = '2'
order by
    t.date asc


Have a look at '11.5. Aggregate functions' here: http://www.hibernate.org/hib_docs/refer ... ryhql.html

_________________
Everytime you get an answer to your question without giving credit; god kills a kitten. :(


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.