ORMLite(binary)
To save image, sound, other binary data in database, we handle these data as binary(byte[]) in Java.
Same as general Java, we need to them as byte[] type.
Add @DatabaseField(dataType=DataType.BYTE_ARRAY) for it.
Example
@DatabaseTable(tableName="setting")
public class Setting
{
@DatabaseField(generatedId=true)
private Integer id;
@DatabaseField
private String uuid;
@DatabaseField(dataType=DataType.BYTE_ARRAY)
private byte[] img;
public byte[] getImg ( )
{
return img;
}
public void setImg ( byte[] img)
{
this.img= img;
}
}
Only things to do is add dataType, other is same.
You can handle as byte[] in other part.
