-->
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.  [ 5 posts ] 
Author Message
 Post subject: Problems mapping postgresql 'uuid' field to .net 'Guid' type
PostPosted: Mon Aug 24, 2009 5:30 am 
Newbie

Joined: Mon Aug 24, 2009 5:10 am
Posts: 2
Hi,

I am using Postgresql(8.3) - database.
NHibernate (2.1.0.4), npgsql 2.0.6.0 and
.net 3.5

I am trying to use guid fields as my primary key in tables. Ideally i would expect uuid field in PostGreSql database to be equivalent of Guid type in .net

IList<FeatureTimeSeries> listOfFeatureTimeSeries;

using (ISession session = ConnectionUtility.OpenSession())
{
try
{
listOfFeatureTimeSeries = session.CreateQuery("FROM FeatureTimeSeries fts WHERE fts.FeatureId = " +/* "'" + */guid/* + "'"*/).List<FeatureTimeSeries>();

session.Flush();
}
catch (Exception ex)
{
throw ex;
}
}

but when i use this mapping then i get below message, while creating session object.

_sessionFactory = configuration.BuildSessionFactory();

Dialect does not support DbType.Guid
Parameter name: typecode


Top
 Profile  
 
 Post subject: Re: Problems mapping postgresql 'uuid' field to .net 'Guid' type
PostPosted: Fri Sep 25, 2009 3:07 am 
Newbie

Joined: Wed Mar 25, 2009 3:17 am
Posts: 5
Up. The same problem.


Top
 Profile  
 
 Post subject: Re: Problems mapping postgresql 'uuid' field to .net 'Guid' type
PostPosted: Sat Sep 26, 2009 12:55 am 
Newbie

Joined: Sat Sep 26, 2009 12:51 am
Posts: 1
I had the same problem.

The fix was to change "NHibernate.Dialect.PostgreSQLDialect" to "NHibernate.Dialect.PostgreSQL82Dialect" in the config file.

I figured this out by reading this bug: http://nhjira.koah.net/browse/NH-1111


Top
 Profile  
 
 Post subject: Re: Problems mapping postgresql 'uuid' field to .net 'Guid' type
PostPosted: Mon Sep 28, 2009 2:27 am 
Newbie

Joined: Wed Mar 25, 2009 3:17 am
Posts: 5
oholmes wrote:
I had the same problem.

The fix was to change "NHibernate.Dialect.PostgreSQLDialect" to "NHibernate.Dialect.PostgreSQL82Dialect" in the config file.

I figured this out by reading this bug: http://nhjira.koah.net/browse/NH-1111

Thanks! That works.


Top
 Profile  
 
 Post subject: Re: Problems mapping postgresql 'uuid' field to .net 'Guid' type
PostPosted: Wed Jan 05, 2011 1:20 pm 
Newbie

Joined: Wed Jan 05, 2011 1:12 pm
Posts: 3
Could some one suggest how to do it in Java with Hibernate mapping file?

I Just want to auto generate a column with type guid.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.