Use case:
Convert Java-Object into Struct-Object and save it into Oracle Database.
For this I annotated the Geometry-Property in the bean with @Convert and wrote the needed Converter-Class.
It works perfectly with not-null-Values. Reading and writing.
Problem:
It does NOT work with null-Values.
The error message, the Oracle Database gives is
Quote:
ORA-17004 Invalid column type
But the Type-Id is the correct for this Database-Column. And it worked with not-null-Values, right?
With a bit of debugging I think, I found the Problem. Probably it lies in the class org.hibernate.type.descriptor.sql.BasicBinder in Line 61, where the Database-Call is
Code:
st.setNull( index, sqlDescriptor.getSqlType() );
This is always called from Hibernate, when the value is null. But according to Oracle Documentation the right call for this should be
Code:
st.setNull(index, sqlDescriptor.getSqlType(), sql_type_name) );
At least, if you save Values of type REF, ARRAY, or STRUCT.
Question:
Is there a workarround for this problem? Or is there a fix for the BasicBinder-Class? Or am I missing something here?