I'm looking to persist an object to a single column using NHibernate. I'd like to serialize the data on the way in into a single column, and then deserialize it on the way out. This could be binary or xml. How can I go about doing this?
+2
A:
Serialization is the default, if the class is not mapped. You can (should) make it explicit:
<property name="MyProperty" type="Serializeable" />
Stefan Steinegger
2009-05-08 08:12:29
Wow, that worked! I didn't realize it was that simple! I was going this roundabout route with a String type and then thinking I had to somehow manage to get someone to serialize it into XML before handing it off to NHibernate... I severely underestimated the framework... THANKS!
noah.blumenthal
2009-05-08 12:15:02
@noah: flag it as an answer please.
Frans Bouma
2009-05-08 13:39:55