tags:

views:

421

answers:

1

Is this possible? Situation is that I want to store some XML in my database, but keep it as generic as possible in case we need to deploy it to a difference backend.

I realise I could store it as a String, but I believe MSSQL/Oracle optimise and validate XML if you store it this way, and let you search on it?

+1  A: 

If you provide an implementation of org.hibernate.usertype.UserType you can provide logic for mapping an arbitrary Java type to one or more database columns.

You can view a few examples of UserTypes here:

Or just Google "hibernate usertype" and find many more. :)

cliff.meyers