Roo 1.1.1.RELEASE (included with STS 2.5.2.RELEASE)
Oracle 10g
ojdbc14.jar (10.2.0.5)
Hibernate 3.6.0.Final
I'm having trouble saving Clobs to an Oracle database. I used DBRE and this is what it generated:
Side note: I initially got a "can not convert clob to string" message when displaying the field, but I solved this by adding a Clob -> String converter to ApplicationConversionServiceFactoryBean.Code:@Column(name = "NOTES", columnDefinition = "CLOB") @Lob private Clob notes;
When trying to create/update the record, the following error is displayed on the form next to the notes field:
There is no message in the console.Code:Failed to convert property value of type java.lang.String to required type java.sql.Clob for property notes; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [java.sql.Clob] for property notes: no matching editors or conversion strategy found
So I created a converter in ApplicationConversionServiceFactoryBean:
Returning null from there gets rid of the error message, but of course the notes data is not saved.Code:Converter<String, Clob> getStringToClobConverter() { return new Converter<String, Clob>() { public Clob convert(String source) { // Now what? } }; }
I'm not sure what to do at this point. It seems like this conversion should be "magically" handled internally, so I feel like I'm going down the wrong path trying to do this conversion myself. Any suggestions?
Thanks.
- Luke


Reply With Quote