Hibernate version:
version 2.14
Mapping documents:
The mappings are quite simple
QuoteRequest has a selected quote mapped as
<many-to-one name="selectedQuote" column="selected_quote_id" class="Quote"/>
Quote has only the approxCommission property mapped
The relationship is bidirectional
Code between sessionFactory.openSession() and session.close():
I am trying to execute the following query
select r.customer.id, count(r), sum(r.selectedQuote.approxCommission)
from TermQuoteRequest as r
group by r.customer.id
Full stack trace of any exception that occurs:
2004-08-27 12:23:31,213 JDBCExceptionReporter - Could not execute query
org.postgresql.util.PSQLException: ERROR: schema "r" does not exist
at org.postgresql.util.PSQLException.parseServerError(PSQLException.java:139)
at org.postgresql.core.QueryExecutor.executeV3(QueryExecutor.java:152)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:100)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:43)
at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:517)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:50)
at org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:233)
at com.p6spy.engine.logging.P6LogPreparedStatement.executeQuery(P6LogPreparedStatement.java:171)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:205)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:205)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:800)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:189)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:955)
at net.sf.hibernate.loader.Loader.list(Loader.java:946)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:846)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1543)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
Name and version of the database you are using:
postgresql 7.4
Debug level Hibernate log excerpt:
INFO
I checked the sql hibernate is generating and its leaving r.selectedQuote.approxCommission as is i.e. not expanding it
thanks
|