-->
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: Suggestion for NullabeTypes
PostPosted: Wed Aug 10, 2005 5:40 am 
I've just abandoned my own implementation of a Persistence Framework and jumped on the NHibernate bandwagon, and one thing I had there were also Nullable Types. What I miss in these Nullables is the Parse feature. For instance, my decimal implementation for DecimalDB was:

Public Shared Function Parse(ByVal s As String) As DecimalDB
Parse = New DecimalDB

If s Is Nothing Then
Parse.SetValue(System.DBNull.Value)
Else
If Trim(s) = "" Then
Parse.SetValue(System.DBNull.Value)
Else
Try
Parse.SetValue(Decimal.Parse(s))
Catch ex As System.Exception
Throw New FormatException(ex.Message)
End Try
End If
End If
End Function

So, Nothing or empty string would parse as a null value, anything else would be the result of Decimal.Parse. Would anyone consider adding this or will I have to subclass? (probably will anyway for timing reasons :wink: )


Top
  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 9:06 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
Can you create a Jira issue for this improvement? (here: http://jira.nhibernate.org/)

I'm sure that one of us will find the time to do it before the 1.0 release.

Anyway, you can do it and post the patchs (don't forget the tests ;) )

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 10:54 am 
Beginner
Beginner

Joined: Tue Aug 09, 2005 9:43 am
Posts: 30
Location: Lisbon, Portugal
Ok, I've created the issue. I'll give it a shot, also.

Thanks!


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.