-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Need help with custom UserType
PostPosted: Sun May 05, 2013 11:12 am 
Newbie

Joined: Sun May 05, 2013 11:05 am
Posts: 2
Hi. I'm a Hibernate newbie and have never used Hibernate 3.x or earlier versions. I downloaded Hiberrnate 4.1 and got it working with my PostgreSQL database. Now I need to implement a custom type to map to a column in my database that holds an array of integers.

I've found many example online, but none of them seem to work with Hibernate 4.1. That includes the examples here: http://docs.jboss.org/hibernate/orm/4.1/manual/en-US/html/ch06.html#types-custom -- they have compilation errors, so I'm stuck. Can anyone help?


Top
 Profile  
 
 Post subject: Re: Need help with custom UserType
PostPosted: Sun May 05, 2013 3:24 pm 
Newbie

Joined: Sun May 05, 2013 11:05 am
Posts: 2
Actually, I think I got this working, thanks to this post: http://alenovarini.wikidot.com/mapping-a-custom-type-in-hibernate

The main problem was that UserType.nullSafeGet() and UserType.nullSafeGet() now each require an additional parameter, SessionImplementor session.

A secondary problem was that method calls in the example I was following, such as BigDecimalType.INSTANCE.get(), now require two additional parameters, but I worked around that by not making such calls.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.