nhibernate - HBM mapping image/binary -


i having trouble mapping our byte[] field. i've been looking several solutions none work far. exception:

the length of byte[] value exceeds length configured in mapping/parameter. 

below i've got far in hbm.xml

<property name="data" type="binaryblob">     <column name="attachmentdata" sql-type="varbinary(max)"/> </property> 

am doing not right here?

update - solution:

it turned out have done incorrectly. inserting byte[] via stored procedure property mapping has nothing it. instead, need tell nhibernate type of sprocs parameter so:

query.setparameter(param.key, param.value, nhibernateutil.binaryblob); 

nhibernate doesn't understand varbinary(max) , use default of 8000 bytes.

therefore need supply number. i.e.

varbinary(2147483647)

i think used work regression bug.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -