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.  [ 3 posts ] 
Author Message
 Post subject: NHibernate System.Guid
PostPosted: Wed Apr 02, 2008 5:11 pm 
Newbie

Joined: Wed Jan 23, 2008 10:10 am
Posts: 4
How do i mapping System.Guid type on NHibernate.

ie.
<id name="id" column="IS_TRK" length="4" access="field"
type="System.Guid>
<generator class="assigned" />
</id>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 03, 2008 10:25 am 
Beginner
Beginner

Joined: Tue Mar 27, 2007 4:54 am
Posts: 47
if you mean for pk, something like
<id name="Id" column="Id" type="guid">
<generator class="guid" />
</id>
..or more preferably if you want some sequence on them for faster inserts..

<id name="Id" column="Id" type="guid.comb">
<generator class="guid" />
</id>


/Roger


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 03, 2008 1:37 pm 
Newbie

Joined: Thu Jan 17, 2008 11:45 am
Posts: 9
Location: VA
Here's how I defined all of my GUIDs:

<id name="DeliveryId" type="System.Guid" column="DeliveryId" unsaved-value="00000000-0000-0000-0000-000000000000">
<generator class="guid" />
</id>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.