Hibernate version: 2.1.6
Mapping documents: <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping > <class name="com.gudrun.gdp3000.centralfile.domain.Usage" table="USAGE" proxy="com.gudrun.gdp3000.centralfile.domain.Usage" dynamic-update="false" dynamic-insert="false" select-before-update="false" >
<id name="id" column="id" type="java.lang.Integer" > <generator class="native"> <!-- To add non XDoclet generator parameters, create a file named hibernate-generator-params-Usage.xml containing the additional parameters and place it in your merge dir. --> </generator> </id>
<property name="date" type="java.util.Date" update="true" insert="true" access="property" column="DATE" />
<property name="type" type="java.lang.String" update="true" insert="true" access="property" column="TYPE" />
<many-to-one name="centralFile" class="com.gudrun.gdp3000.centralfile.domain.CentralFile" cascade="none" outer-join="auto" update="true" insert="true" access="property" column="CENTRAL_FILE_ID" />
<property name="lastModificationDate" type="java.sql.Timestamp" update="true" insert="true" access="property" column="LAST_MODIFICATION_DATE" />
<property name="lastModificationUser" type="java.lang.String" update="true" insert="true" access="property" column="LAST_MODIFICATION_USER" />
<property name="amount" type="com.gudrun.gdp3000.utils.MoneyValueCompositeUserType"> <column name="AMOUNT"/> <column name="CURRENCY"/> </property>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close(): Iterator i = session.createQuery( "select usage.type,sum(usage.amount) from Usage usage group by usage.type") .list() .iterator();
Full stack trace of any exception that occurs: org.springframework.orm.hibernate.HibernateQueryException: path expression ends in a composite value: usage0_.amount [select usage.type,sum(usage.amount) from com.gudrun.gdp3000.centralfile.domain.Usage usage group by usage.type]; nested exception is net.sf.hibernate.QueryException: path expression ends in a composite value: usage0_.amount [select usage.type,sum(usage.amount) from com.gudrun.gdp3000.centralfile.domain.Usage usage group by usage.type] net.sf.hibernate.QueryException: path expression ends in a composite value: usage0_.amount [select usage.type,sum(usage.amount) from com.gudrun.gdp3000.centralfile.domain.Usage usage group by usage.type] at net.sf.hibernate.hql.PathExpressionParser.getWhereColumn(PathExpressionParser.java:375) at net.sf.hibernate.hql.SelectParser.token(SelectParser.java:160) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.ClauseParser.end(ClauseParser.java:114) at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:143) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:294) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1562) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1533) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39) at com.gudrun.gdp3000.centralfile.dao.hibernate.UsageDAOImpl.getUsedTypesForPeriod(UsageDAOImpl.java:101) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.framework.AopProxyUtils.invokeJoinpointUsingReflection(AopProxyUtils.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:149) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:116) at org.springframework.orm.hibernate.HibernateInterceptor.invoke(HibernateInterceptor.java:163) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:152) at $Proxy16.getUsedTypesForPeriod(Unknown Source) at com.gudrun.gdp3000.centralfile.dao.hibernate.UsageTest.testGetUsedTypesForPeriod(UsageTest.java:84) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|