Skip navigation links

MySQL Forums :: Cluster :: Errors saving to BLOB via ClusterJ


Advanced Search

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
Errors saving to BLOB via ClusterJ 1283 Jacek Furmankiewicz 03/09/2012 09:23AM
Re: Errors saving to BLOB via ClusterJ 676 Jacek Furmankiewicz 03/09/2012 09:51AM
Re: Errors saving to BLOB via ClusterJ 781 Craig Russell 03/09/2012 03:19PM
Re: Errors saving to BLOB via ClusterJ 690 Jacek Furmankiewicz 03/16/2012 01:41PM
Re: Errors saving to BLOB via ClusterJ 675 Craig Russell 03/21/2012 09:18AM


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.