<div class="gmail_quote">Dear Experts,<br><br>I have an issue with the Hibernate custom sql commands. I have the mapping file:<br><br><i><?xml version="1.0"?><br><!DOCTYPE hibernate-mapping PUBLIC<br> "-//Hibernate/Hibernate Mapping DTD 3.0//EN"<br>
"<a href="http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" target="_blank">http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd</a>"><br><br><hibernate-mapping><br> <class name="com.gsk.europepharma.clinfit.model.entities.InputFile" table="INPUT_FILE" schema="CLINFIT"><br>
<id name="id"><br> <column name="ID" sql-type="number" length="10" precision="0" not-null="true"/><br> <generator class="sequence"><br>
<param name="sequence">S_INPUT_FILE</param><br> </generator><br> </id><br> <property name="fileType"><br> <column name="FILE_TYPE" sql-type="varchar2" length="20" precision="0" not-null="true"/><br>
</property><br> <property name="forDate"><br> <column name="FOR_DATE" sql-type="date" length="7" precision="0" not-null="true"/><br>
</property><br> <property name="statusCode"><br> <column name="STATUS_CODE" sql-type="varchar2" length="20" precision="0" not-null="true"/><br>
</property><br> <property name="datetimeLastProcessed"><br> <column name="DATETIME_LAST_PROCESSED" sql-type="date" length="7" precision="0" not-null="false"/><br>
</property><br> <property name="datetimeStatusLastChanged"><br> <column name="DATETIME_STATUS_LAST_CHANGED" sql-type="date" length="7" precision="0" not-null="true"/><br>
</property><br> <property name="invalidDataMessage"><br> <column name="INVALID_DATA_MESSAGE" sql-type="varchar2" length="1000" precision="0" not-null="false"/><br>
</property><br> <many-to-one name="country" class="com.gsk.europepharma.clinfit.model.entities.CCountry"><br> <column name="COUNTRY_ID" not-null="true"/><br>
</many-to-one><br> <!-- TODO: comment it --><br> <sql-update callable="true">{ ? = call BUSINESS_LOGIC_PKG.CHANGE_INPUT_FILE_STATUS (?, ?, ?, ?, ?, ?, ?, ?)}</sql-update><br>
</class><br></hibernate-mapping></i><br><br>When my objects at runtime are updated I am getting the following Exception:<br><i>Caused by: java.sql.SQLException: Missing IN or OUT parameter at index:: 9<br>
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)<br> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)<br> at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1729)<br>
at oracle.jdbc.driver.OraclePreparedStatement.addBatch(OraclePreparedStatement.java:10547)<br> at oracle.jdbc.driver.OracleCallableStatement.addBatch(OracleCallableStatement.java:2009)<br> at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:31)<br>
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2408)<br> ... 25 more<br><br></i>The update function - <i>BUSINESS_LOGIC_PKG.CHANGE_INPUT_FILE_STATUS </i>is implemented in Oracle 10g R2. Before this I checked the order of parameters with debuging the static queries. I went through the code and I could not find any where registerOutputParameter invocation to the callable statement, so the result can be consumed back to Hibernate. <br>
<br>Can anybody help me!<br><br>Thanks in advance!<br><br>Best regards,<br>Anatoli<br clear="all"><br>-- <br>Anatoli Atanasov<br>mobile: (+359) 888 32 06 49
<br></div><br><br clear="all"><br>-- <br>Anatoli Atanasov<br>mobile: (+359) 888 32 06 49