|
When using the MaterializedNClobType data is saved to the database with unicode characters corrupted. (e.g. \u2018 is written to the database as ¿ )
e.g. @Column(name = "TXT") @Type(type = "org.hibernate.type.MaterializedNClobType") @Lob private String text;
I have traced it down to a couple of bugs: 1. When using STREAM_BINDING the code in NClobTypeDescriptor calls st.setCharacterStream instead of st.setNCharacterStream 2. When using NCLOB_BINDING the code in StringTypeDescriptor.unwrap will always shortcut at the Clob condition (therefore returing a Clob) and will never reach the code that creates an NClob
|