Why does Hibernate skip binding values to user defined function (i.g. mgdecrypt(?)? As a matter of fact, it binds values to col1, col2 and ID(sequence) but seems to skip completely at col3. As a result, it gave me an error saying :
Many thanks for your help.
====LOG======
- binding ' ' to parameter: 1 - binding 'This is a test' to parameter: 2 - binding '171' to parameter: 3 - SQL Error: 17041, SQLState: null - Missing IN or OUT parameter at index:: 4 - Could not synchronize database state with session org.hibernate.exception.GenericJDBCException: could not insert: . . . root cause
java.sql.SQLException: Missing IN or OUT parameter at index:: 4 oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145) oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:190) =============================================
Below is my Hibernate mapping file:
===========================
<hibernate-mapping> <class name="com.mylocal.test.domain.MyTest" table="MYTEST" schema="tmt" lazy="false"> <id name="id" column="ID" type="int"> <generator class="sequence"> <param name="sequence">SEQID</param> </generator> </id>
<property name="col1" column="COL1"/> <property name="col2" column="COL2" /> <property name="col3" column="COL3" formula="mgdecrypt(col3)" />
<sql-insert> insert into MyTest ( col1, col2, ID, col3) values (?, ?, ?, mgencrypt(?) ) </sql-insert> </hibernate-mapping>
|