hibernate userType

I would like to know about hibernate userType. Why, how, where we use it. Advantages, disadvantages of using it. I am not clear on this concept. Thanks in advance
Who is Participating?
for_yanConnect With a Mentor Commented:

UserType provides the ability to persist properties which
are not of simple type (like String, int) in the most convenient way of your chioosing

In the beginning of this article they explain how to provide
the prsistnce of StringBuilder in the form of the String rather than serialization of the object:

It is a rather lengthy article, but if your goal is to understand what is a UserType interface
rather than to understand the details of what to do with StringBuilder, it is enough to read
more or less the first page.

This is also a useful summary of the UserType usage in this
set of slides about Hibernate:

6. UserType
¿ Can provide your own serialization and
deserialization mechanisms for properties
1.Implement the UserType interface
2.Specify the property type in the mapping using
3.Alternatively can create alias for classname with

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.