I wanted to create a IMAGE column in Sybase, but byte[] in my entity. I
had to change this class:
1. Implemented the hashCode method for a byte[] (read Effective Java).
2. Use st.getBytes() and st.setBytes() in nullSafeGet() and nullSafeSet().
3. Implemented checking value == nullin nullSafeSet(), as another
commenter said.
4. Changed isMutable() to false.
5. Implemented replace(Object original, Object target, Object owner)
method, always returning original.
I'm now a happy byte[] user. =)
I'm using Hibernate 3.2.6.ga with annotations, Sybase (Adaptive Server
Enterprise/12.5.3) and jConnect 5.5. |