2

I have some columns in my database (MS SQL Server 2005) which use the data type XML.

Can these be mapped as XML objects in NHibernate? My app is .NET 3.5 so I have access to both XDocument and XmlDocument which I can use but I don't know whether NHibernate will support it.

If it doesn't does anyone have a good suggestion on how to support it?

1 Answer 1

3

Search google://"site:ayende.com NHibernateAndXMLColumnTypes"

-or-

For transparent XML serialization:

<class name="Foo">
  <!-- ... -->
  <property name="Bar" type="DataAccess.NHibernate.Types.XmlSerializedType`1[[DomainModel.Bar, DomainModel]], DataAccess" />
</class>
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, I knew Ayende would have done a post but xml & nhibernate in the same query tend to bring back incorrect results :P
@Slace, that code doesn't compile, is SqlXmlType another custom type?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.