-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Why Hibernate Skips binding values to user defined function
PostPosted: Fri May 06, 2011 2:39 pm 
Newbie

Joined: Fri May 06, 2011 10:58 am
Posts: 3
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>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.