-->
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.  [ 9 posts ] 
Author Message
 Post subject: Nullable DateTime Problem
PostPosted: Tue Mar 21, 2006 2:41 am 
Beginner
Beginner

Joined: Mon Oct 17, 2005 1:58 am
Posts: 27
I am trying to use the Nullable DateTime field from Nhibernate contrib in my DAL.For that i have added reference of Nullables.dll to my DAL assembly
But when i run a test application using the DAL i get the following exception

Additional information: could not interpret type: Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate

The following is the mapping info i have added in the hbm file

<property name="RemovalDate" column="REMOVAL_DATE" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" />


Can any body tell me why?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 21, 2006 4:53 am 
Regular
Regular

Joined: Mon Jul 18, 2005 4:10 am
Posts: 92
Location: Poland
You need also Nullables.NHibernate.dll assembly in the same directory where executing assembly. Reference to this assembly is not required.

_________________
michal


Top
 Profile  
 
 Post subject: Problem persists
PostPosted: Tue Mar 21, 2006 5:14 am 
Beginner
Beginner

Joined: Mon Oct 17, 2005 1:58 am
Posts: 27
Now After adding Nullables.NHibernate.dll in the Executing Assembly folder I am getting the following exception

An unhandled exception of type 'System.IO.FileLoadException' occurred in dal.dll

Additional information: The located assembly's manifest definition with name 'NHibernate' does not match the assembly reference.

What do you think could be the reason?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 21, 2006 5:21 am 
Regular
Regular

Joined: Mon Jul 18, 2005 4:10 am
Posts: 92
Location: Poland
Probably Nullables.Nhibernate.dll -> Nullables.dll or NHibernate.dll version mismatch.
The only I can suggest - try using ildasm.exe tool from framework sdk on your Nullables.Nhibernate.dll to see what version of Nullables.dll and NHibernate.dll it references (lt is is stored in MANIFEST) and compare it with versions you are using (e.g. using windows explorer).

_________________
michal


Top
 Profile  
 
 Post subject: Prob Persists
PostPosted: Tue Mar 21, 2006 5:43 am 
Beginner
Beginner

Joined: Mon Oct 17, 2005 1:58 am
Posts: 27
You were right.There was a version mismatch.So i corrected it.But now the first error has again crept in.The exception is

Additional information: could not interpret type: Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 21, 2006 5:53 am 
Regular
Regular

Joined: Mon Jul 18, 2005 4:10 am
Posts: 92
Location: Poland
Sorry I have no futher ideas. Maybe you can look at these posts, they both describe simmilar problem:

http://forum.hibernate.org/viewtopic.php?t=951870
http://forum.hibernate.org/viewtopic.php?t=951619

_________________
michal


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 21, 2006 8:19 am 
Senior
Senior

Joined: Fri Jan 13, 2006 2:50 pm
Posts: 123
Location: Blumenau / SC / Brasil
Why don't you just use the Nullable of the .NET Framework?

I'm using... you should use DateTime? instead of DateTime, but just in you classes. Your hbm.xml still the same (DateTime).

If you know portuguese, I've written an article about it: http://www.linhadecodigo.com.br/artigos ... =949&pag=1


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 21, 2006 10:39 pm 
Beginner
Beginner

Joined: Mon Oct 17, 2005 1:58 am
Posts: 27
Are u suggesting that i use NullableDateTime data type of .NET Framework 2.0?

_________________
Sandipan Deb


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 22, 2006 7:58 am 
Senior
Senior

Joined: Fri Jan 13, 2006 2:50 pm
Posts: 123
Location: Blumenau / SC / Brasil
sandipandeb wrote:
Are u suggesting that i use NullableDateTime data type of .NET Framework 2.0?


Yes.


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