Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fluent NHibernate and XML columns

I'm building a new site from scratch and am considering using Fluent NHibernate for my ORM. I think it'll handle everything easily except, possibly, my XML columns. I've never built a site with NHibernate at all (though I've used Hibernate for Java) so consider me a n00b.

Ideally I'd like the XML to be treated as an XElement as Linq-to-SQL does.

Can I do this with (fluent) NHibernate? What if I want to use auto mapping?

like image 805
roufamatic Avatar asked Feb 27 '23 05:02

roufamatic


1 Answers

You can use the IUserType defined here: https://nhibernate.jira.com/secure/attachment/12905/XmlType.cs

It uses XmlDocument, but you can easily modify it to work with XElement instead.

Update: This has been included in NHibernate 3. Both XmlDocument and XDocument are available.

like image 118
Diego Mijelshon Avatar answered Mar 07 '23 01:03

Diego Mijelshon