-->
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: Select real from postgresql with custom dialect
PostPosted: Mon Jul 23, 2007 4:34 am 
Newbie

Joined: Mon Jul 23, 2007 4:20 am
Posts: 5
Location: Romania
Hi all, I'm new to hibernate and I've crossed a problem. I try executing an select which returns real from postgresql, but it throws an exception: "org.hibernate.MappingException: No Dialect mapping for JDBC type: 7".
If I remove the real field from my select, it works fine, but I need it in order to develop my application. Now, I've read a forum in which it said tu custom my dialect for suporting decimals. This is my custom class:

package myPackage;

import java.sql.Types;

import org.hibernate.Hibernate;
import org.hibernate.dialect.PostgreSQLDialect;

public class CustomPostgreSQLDialect extends PostgreSQLDialect{
public CustomPostgreSQLDialect(){
super();
registerHibernateType(Types.DECIMAL, Hibernate.DOUBLE.getName() );
}
}


and I load it like this in hibernate.cfg.xml:

<property name="dialect">myPackage.CustomPostgreSQLDialect</property>

do you have any idea how to resolv my error and to be able to perform decimals selects?
I'm using hibernate 3.2


Top
 Profile  
 
 Post subject: I've resolved it!
PostPosted: Mon Jul 23, 2007 4:39 am 
Newbie

Joined: Mon Jul 23, 2007 4:20 am
Posts: 5
Location: Romania
Sorry, I've allready resolved it. It was enough to replace my fields in the custom dialect DECIMAL with real and DOUBLE with float. See you on the next error.


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.