Hibernate version 2.1.
Oracle 10
Hello I am using hibernate version 2.1 (only used 3 before but client is now forcing 2).
Whenever I make a simple query I get an ORA-00936: missing expression.
The reason for this, I think, is this. When I look in the logs with debug I see this:
Code:
2009-06-26 11:11:00,914 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:1537) - find: select from NRS_EVENT
2009-06-26 11:11:00,914 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:1537) - find: select from NRS_EVENT
2009-06-26 11:11:00,976 DEBUG [WebContainer : 2] hql.QueryTranslator (QueryTranslator.java:147) - compiling query
2009-06-26 11:11:00,976 DEBUG [WebContainer : 2] hql.QueryTranslator (QueryTranslator.java:147) - compiling query
2009-06-26 11:11:01,039 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:2267) - flushing session
2009-06-26 11:11:01,039 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:2267) - flushing session
2009-06-26 11:11:01,070 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:2467) - Flushing entities and processing referenced collections
2009-06-26 11:11:01,070 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:2467) - Flushing entities and processing referenced collections
2009-06-26 11:11:01,117 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:2808) - Processing unreferenced collections
2009-06-26 11:11:01,117 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:2808) - Processing unreferenced collections
2009-06-26 11:11:01,148 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:2822) - Scheduling collection removes/(re)creates/updates
2009-06-26 11:11:01,148 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:2822) - Scheduling collection removes/(re)creates/updates
2009-06-26 11:11:01,179 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:2291) - Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
2009-06-26 11:11:01,179 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:2291) - Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
2009-06-26 11:11:01,226 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:2296) - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2009-06-26 11:11:01,226 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:2296) - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2009-06-26 11:11:01,257 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:1828) - Dont need to execute flush
2009-06-26 11:11:01,257 DEBUG [WebContainer : 2] impl.SessionImpl (SessionImpl.java:1828) - Dont need to execute flush
2009-06-26 11:11:01,304 DEBUG [WebContainer : 2] hql.QueryTranslator (QueryTranslator.java:207) - HQL: select from NRS_EVENT
2009-06-26 11:11:01,304 DEBUG [WebContainer : 2] hql.QueryTranslator (QueryTranslator.java:207) - HQL: select from NRS_EVENT
2009-06-26 11:11:01,335 DEBUG [WebContainer : 2] hql.QueryTranslator (QueryTranslator.java:208) - SQL: select from
2009-06-26 11:11:01,335 DEBUG [WebContainer : 2] hql.QueryTranslator (QueryTranslator.java:208) - SQL: select from
2009-06-26 11:11:01,382 DEBUG [WebContainer : 2] impl.BatcherImpl (BatcherImpl.java:204) - about to open: 0 open PreparedStatements, 0 open ResultSets
2009-06-26 11:11:01,382 DEBUG [WebContainer : 2] impl.BatcherImpl (BatcherImpl.java:204) - about to open: 0 open PreparedStatements, 0 open ResultSets
2009-06-26 11:11:01,414 DEBUG [WebContainer : 2] hibernate.SQL (BatcherImpl.java:230) - select from
2009-06-26 11:11:01,414 DEBUG [WebContainer : 2] hibernate.SQL (BatcherImpl.java:230) - select from
2009-06-26 11:11:01,460 DEBUG [WebContainer : 2] impl.BatcherImpl (BatcherImpl.java:253) - preparing statement
2009-06-26 11:11:01,460 DEBUG [WebContainer : 2] impl.BatcherImpl (BatcherImpl.java:253) - preparing statement
The main lines I am worried about are these:
hql.QueryTranslator (QueryTranslator.java:207) - HQL: select from NRS_EVENT
hql.QueryTranslator (QueryTranslator.java:208) - SQL: select fromNote that the from and NRS_EVENT are stripped.
I have written the code in a number of ways like this:
Code:
List f = session.find("select from NRS_EVENT");
How I do it when using Hibernate3
Code:
retEvent = (Event) session.createQuery("from NRS_EVENT where SIGNING_ID = ?")
.setString(0, uuid)
.uniqueResult();
And both ways end up with the same error.
Any hints or tips? I have been using Hibernate 3 for a number of years and I have never seen this behavour.
Thanks for reading.
cheers
Martin