How to map an SQL Server XML Type using Hibernate

Updated: 2012-10-16

The solution to map an SQL Server XML Type using Hibernate is quite easy:

if you have the MESSAGE field in your SQL SERVER with the format XML

you can map it using a simple Hibernate String type in your .hbm.xml:

 

and in your Java class:

 


WebApp built by Marco using Java 21 - Hosted in Switzerland