-->
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: Mapping primatives to non-default types.e.g Strings->Numb
PostPosted: Fri Dec 17, 2004 5:43 pm 
Newbie

Joined: Fri Dec 17, 2004 5:23 pm
Posts: 6
Hibernate version: 2.1.7

I'm new to hibernate.

I am currently trying to implement hibernate on some existing tables and classes to test the speed versus what is already in place.

The table have (oracle) 'NUMBER' fields, but the java object store this info in a String. Ideally I would just change the object/db field to store corresponding types, but since I am trying to compare the existing code to hibernate, I would rather leave everything as is.

I looked into net.sf.hibernate.UserType briefly, but that looked like it wasn't designed for primatives, but may work for String to NUMBER.

So ultimately my question is:

How should I go about configuring Hibernate to map a java.lang.Strng to an Oracle NUMBER field?

Is the best way to use the net.sf.hibernate.UserType interface?


Thanks in advance,
Curt Stanton


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 17, 2004 10:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
use a custom UserType


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.