Hibernate version: 2.0.0.3002
Hi,
This may be a stupid question but I am just wondering if it is possible.
I would like to save certain properties in a generic way, i.e. stream them from their .Net types to and from binary in the DB.
I was hoping to do this from my real object classes rather than having a transalation object with a byte array that I'd have to stream into before saving.
The List<Guid> is just a test the real objects are much more complex.
I have the class and mapping below, I essentially want something to replace to BinaryBlob in the mapping if it is possible or any other way to do the same thing.
Thanks, Vin
Mapping file:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="TestObjects" assembly="TestObjects" >
<class name="TestObjects.Class1, TestObjects" table="TestObjectsClass1" >
<id name="I" column="I" access="field.camelcase-underscore" type="int" >
<generator class="assigned" />
</id>
<version name="Version" type="Timestamp" unsaved-value="01/01/1753 00:00:00"/>
<property name="BinaryTest" column="BinaryTest" type="BinaryBlob" />
<property name="S" column="S" type="string" />
</class>
</hibernate-mapping>
Class file: Code:
namespace TestObjects
{
[Cacheable, Serializable]
public class Class1 : BaseClass1
{
private string _s;
DateTime _version;
List<Guid> _binaryTest;
public virtual List<Guid> BinaryTest
{
get { return _binaryTest; }
set { _binaryTest = value; }
}
public virtual string S
{
get { return _s; }
set { _s = value; }
}
public virtual DateTime Version
{
get { return _version; }
set { _version = value; }
}
}
}