-->
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.  [ 1 post ] 
Author Message
 Post subject: Mapping DB2 user defined data types
PostPosted: Thu Apr 26, 2007 10:15 am 
Newbie

Joined: Thu Apr 26, 2007 9:42 am
Posts: 14
Hi,
We are using Hibernate 3.1RC2 and DB2 8.2.
On the db we have defined an user defined data type named TABLEID which type is BIGINT.
Does anyone know how to map this user defined type in Hibernate ?
We have tried using a custom type and the java type for that attribute defined as that custom type.
The problem is that Hibernate issue an error, such as a cast must be done on that field.

Example:
The next select
SELECT FROM TABLE_NAME WHERE TABLEID = ?
would work if we use
SELECT FROM TABLE_NAME WHERE ID = CAST(? AS TABLEID)
(ID is of TABLEID type)
So, how to instruct Hibernate to generate such CAST or maybe another solution.


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

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.