I am trying to use named parameter in the where caluse using following
syntax:
int americaElementId = 106;
List invData = session.find("from ENT_ElementINV where element_id = :americaElementId ");
Compilation is ok, when executed I get following error:
Hibernate: select ent_elemen0_.id as id, ent_elemen0_.ELEMENT_ID as ELEMENT_ID,
ent_elemen0_.INV_DATE as INV_DATE, ent_elemen0_.INV_COUNT as INV_COUNT, ent_elem
en0_.LAST_CHANGED_USER as LAST_CHA5_, ent_elemen0_.LAST_CHANGED_DATE as LAST_CHA
6_ from Enterprise_Element_INV_History ent_elemen0_ where (element_id=? )
Jun 1, 2004 2:26:58 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 1008, SQLState: 72000
Jun 1, 2004 2:26:58 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: ORA-01008: not all variables bound
Jun 1, 2004 2:26:58 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 1008, SQLState: 72000
Jun 1, 2004 2:26:58 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: ORA-01008: not all variables bound
Jun 1, 2004 2:26:58 PM net.sf.hibernate.JDBCException <init>
SEVERE: Could not execute query
java.sql.SQLException: ORA-01008: not all variables bound
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:
643)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.jav
a:1819)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:2015)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
edStatement.java:395)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePrepare
dStatement.java:339)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:795)
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:950)
at net.sf.hibernate.loader.Loader.list(Loader.java:941)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:834)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1512)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1491)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1483)
at EnterpriseDEV.DataParser.EnterpriseParser.storeInventory(EnterprisePa
rser.java:390)
at EnterpriseDEV.DataParser.EnterpriseParser.ProcessINVLine(EnterprisePa
rser.java:168)
at EnterpriseDEV.DataParser.EnterpriseParser.main(EnterpriseParser.java:
125)
|