Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.2.6
Mapping documents:
Code between sessionFactory.openSession() and session.close():
criteria.setProjection(Projections.projectionList().add(Projections.sum("firstPass"),"firstPass")
.add(Projections.sum("total"),"total")
.add(Projections.sum("finalPass"),"finalPass")
.add(Projections.groupProperty("product"), "product")
.add(Projections.groupProperty("startTime"), "startTime")
.add(Projections.groupProperty("seq"), "seq"));
criteria.add(Restrictions.between("startTime", startDate, endDate));
criteria.addOrder(Order.desc("startTime"));
Full stack trace of any exception that occurs:
Caused by: java.sql.SQLException: ORA-00904: "Y4_": invalid identifier
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:503)
at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:965)
at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:535)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1051)
at oracle.jdbc.driver.OracleStatement.doScrollExecuteCommon(OracleStatement.java:3807)
at oracle.jdbc.driver.OraclePreparedStatement.doScrollPstmtExecuteUpdate(OraclePreparedStatement.java:9209)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2982)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3026)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
at org.hibernate.loader.Loader.scroll(Loader.java:2286)
... 30 more
Name and version of the database you are using: Oracle 11g
The generated SQL (show_sql=true):
select
sum(this_.first_pass) as y0_,
sum(this_.total) as y1_,
sum(this_.final_pass) as y2_,
this_.product_id as y3_,
this_.start_time as y4_,
this_.seq as y5_
from
app_yield_report this_
where
y4_ between ? and ?
group by
this_.product_id,
this_.start_time,
this_.seq
order by
y4_ desc
Debug level Hibernate log excerpt:
The problem in here is Oracle doesn't know the y4_. I believe this is a bug
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html