I need to map a byte[] to a database column. This byte[] could contain zeros, so I use a BLOB.
Code:
<property name="myData"
type="binary"
update="true"
insert="true"
access="property">
<column name="myData"
sql-type="blob"/>
</property>
This allows me to save byte arrays such as 0,1,2,3,0,1 to a MySQL database. I can view the data in the MySQL browser exactly as entered.
However:
If I use the Hypersonic Database it complains that it cannot understand the BLOB type.
If I use the VARBINARY type then MySQL complains.
If I remove the SQL-TYPE statement, then a VARCHAR is created in the MySQL database and the data above is viewed as empty (the first 0 works like a null).
Does anyone know how I can use binary data with both MySQL and Hypersonic?