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