-->
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.  [ 2 posts ] 
Author Message
 Post subject: Missing IN or OUT Parameter at index 'x'
PostPosted: Thu Nov 04, 2004 12:44 pm 
Regular
Regular

Joined: Fri Sep 03, 2004 2:01 pm
Posts: 51
Hibernate version:2.1.6

Name and version of the database you are using:Oracle 9



Im trying to import data from an old DB schema into my new Hibernate backed DB schema.

When I come to save the objects, Im getting a whoole series of "Missing IN or OUT parameter at index '4').

This particular value is nullable, yet Hibernate is issuing a full insert statement, with 11 parameters and 11 question marks, and according to the Hibernate log info just prior to the attempted SQL insert, it only binds parameters to all the non-null fields (param index 1,2,3,8,9,10,11).

However, Oracle seems to be requiring that we set something for all the nullable fields, or at least tell the prepared statement that we have null fields. (Fields 4,5,6,7 are all mapped as nullable in the mapping docs)

Is this a known issue, and if so, how do I get Hibernate to shut Oracle up?

Im using <id> generator type = assigned (which Im going to switch out to sequence after the legacy import).


Nick


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 04, 2004 12:50 pm 
Regular
Regular

Joined: Fri Sep 03, 2004 2:01 pm
Posts: 51
Ok, I figured it out.

I had a custom data type in use, and I wasnt actually setting a parameter in the case when the object had a null property

my custom user type had:

if( value != null )
{
Hibernate.DATE.nullSafeSet( ... )
}


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

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.