-->
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: Can't cast Guid into any valid DbType postgres
PostPosted: Sun Jun 10, 2007 1:56 am 
Newbie

Joined: Sat Feb 25, 2006 9:56 am
Posts: 6
I am trying use a guid as a generated id with postgres and I get this error
"Can't cast Guid into any valid DbType" also I am using mono.


<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Test, test" table="arraytable">
<id name="Key" type="Guid">
<column name="id" />
<generator class="guid" />
</id>
<property name="PropertyName" />
<primitive-array name="Array" table="intergrals">
<key column="id" />
<index column="index" />
<element column="value" type="Int32" />
</primitive-array>
</class>
</hibernate-mapping>

Are guids not supported with Postgres ? If so how do I add it ? It can't be hard they just need to be mapped to varchar's


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 10, 2007 12:53 pm 
Newbie

Joined: Sat Feb 25, 2006 9:56 am
Posts: 6
not a hibernate problem. the postgres driver I am using(npgsl) doesn't support Guids.

Adding this to NpgslTypesHelper.cs adds support for Guids
NativeTypeMapping.AddDbTypeAlias("varchar",DbType.Guid);
NativeTypeMapping.AddTypeAlias("varchar",typeof(Guid));


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.