-->
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.  [ 7 posts ] 
Author Message
 Post subject: Column 'x1_0_' not found
PostPosted: Thu Oct 21, 2004 2:33 am 
Newbie

Joined: Wed Jul 21, 2004 1:08 am
Posts: 8
Hibernate version: 2.1.3
Database: mysql-4.1.3
The generated SQL (show_sql=true):
Code:
SQL: select sum(purchasing0_.QUANTITY*purchasing0_.UNIT_PRICE) as x0_0_ from PURCHASE_ORDER_ITEM purchasing0_

Debug level Hibernate log excerpt:
Code:
56375 [AWT-EventQueue-0] DEBUG net.sf.hibernate.impl.BatcherImpl  - preparing statement
56437 [AWT-EventQueue-0] DEBUG net.sf.hibernate.loader.Loader  - processing result set
56437 [AWT-EventQueue-0] DEBUG net.sf.hibernate.loader.Loader  - result row:
56453 [AWT-EventQueue-0] DEBUG net.sf.hibernate.type.DoubleType  - returning '950.66' as column: x0_0_
56453 [AWT-EventQueue-0] DEBUG net.sf.hibernate.util.JDBCExceptionReporter  - SQL Exception
java.sql.SQLException: Column 'x1_0_' not found.


I get the same result in both hibern8ide and in my code

If I don't multiply those columns, that is if I specify only one column in the sum() it works just fine.

Could anyone give me a hint, please?

Thanks,
Ovi


Top
 Profile  
 
 Post subject: please help
PostPosted: Thu Oct 21, 2004 10:14 am 
Newbie

Joined: Wed Jul 21, 2004 1:08 am
Posts: 8
Could anyone help me with this, please? I'm really stuck.
Is it something fundamental I'm missing here?
Should I post more information in order to get an answer?

Ovi


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 10:51 am 
Beginner
Beginner

Joined: Sun Jun 13, 2004 9:49 pm
Posts: 38
What dialect are you using?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 11:30 am 
Newbie

Joined: Wed Jul 21, 2004 1:08 am
Posts: 8
Code:
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 3:34 pm 
Newbie

Joined: Wed Oct 27, 2004 3:32 pm
Posts: 3
I don't believe this feature is supported.

See http://forum.hibernate.org/viewtopic.ph ... aggregrate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 3:51 pm 
Newbie

Joined: Wed Jul 21, 2004 1:08 am
Posts: 8
Thanks tingbo. Indeed it looks like the feature is not supported yet. One suggested alternative was to use a view but views are supported only from ver 5 which is in alpha... Do you guys have any other idea how should I approach this?

Thanks,
Ovi


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 4:38 pm 
Newbie

Joined: Wed Oct 27, 2004 3:32 pm
Posts: 3
Perhaps you can use native sql from hibernate.


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