14

How to map an SQL Server XML Type using Hibernate

 3 years ago
source link: https://marco.dev/2012/10/16/how-to-map-an-sql-server-xml-type-using-hibernate/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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:

mapping.png?resize=488%2C65

and in your Java class:

class.png?resize=339%2C353

Author

Marco Molteni

Marco Molteni Blog


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK