MySQL Forums
Forum List  »  NDB clusters

Re: Errors saving to BLOB via ClusterJ
Posted by: Craig Russell
Date: March 09, 2012 03:19PM

Hi Jacek,

Not a bug but a feature request.

The way to tell clusterj to use BLOB or TEXT methods is to annotate the field with the @Lob annotation. You can see an example of this in the test class BlobTypes:

import com.mysql.clusterj.annotation.Lob;

@PersistenceCapable(table="blobtypes")
@PrimaryKey(column="id")
public interface BlobTypes extends IdBase {

int getId();
void setId(int id);

@Lob
byte[] getBlobbytes();
void setBlobbytes(byte[] value);
}

Try adding the annotation to either the byte[] or String field and see if that helps.

I've also implemented the automatic detection of Lob if you map to a BLOB or TEXT column, and this change will allow you to omit the @Lob annotation. Look for it in an upcoming release.

Thanks for the suggestion,

Craig

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Errors saving to BLOB via ClusterJ
1321
March 09, 2012 03:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.