Thread:
 Creating IMAGE and using byte[] 
 arturotena   19 Sep 2008, 15:18 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: arturotena (19 Sep 2008, 15:18) Replies: 0, Views: 529
Subject: Creating IMAGE and using byte[]
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.
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]