Solved

hibernate userType

Posted on 2011-09-10
2
296 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:gudii9
  • 2
2 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 500 total points
ID: 36518138

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:
http://blog.xebia.com/2009/11/understanding-and-writing-hibernate-user-types/

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:

http://javamug.org/mainpages/presentations/Hibernate-1x2.pdf
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
type="classname"
3.Alternatively can create alias for classname with
<typedef>

0
 
LVL 47

Expert Comment

by:for_yan
ID: 36518146
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now