Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

hibernate userType

Posted on 2011-09-10
2
Medium Priority
?
322 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

609 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