-->
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.  [ 10 posts ] 
Author Message
 Post subject: could not interpret type: NullableDateTimeType
PostPosted: Tue Jun 14, 2005 11:13 pm 
Newbie

Joined: Tue Jun 14, 2005 11:10 pm
Posts: 4
Location: Dallas Texas
I am trying to get an object to load with optional dates.

I'm getting the following error:

An unhandled exception of type 'NHibernate.MappingException' occurred in nhibernate.dll

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

I followed the demo exactly as described at:http://wiki.nhibernate.org/display/NHC/Nullables

Any suggestions would be greatly appreciated!!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 15, 2005 3:21 am 
Expert
Expert

Joined: Fri May 13, 2005 5:56 pm
Posts: 308
Location: Santa Barbara, California, USA
1) did you reference Nullables.dll in your project?

2) did you add "using Nullables;" to your class file?

3) did you declare the member variable as "private NullableDateTime myDateField;"

4) does your class file look like this?

<property name="MyDateField" column="MyDateColumn" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" />


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 15, 2005 10:09 am 
Newbie

Joined: Tue Jun 14, 2005 11:10 pm
Posts: 4
Location: Dallas Texas
Here is a sample. A table script isn't needed because it won't get past line 16 in TestDateFixture.

*******************************************************
using System;
using Nullables;

namespace Tcc.Crm.Conversion.BusinessObjects
{
[Serializable]
public class TestDate
{
private int id;
private NullableDateTime startDate;
public TestDate()
{}
public Nullables.NullableDateTime StartDate
{
get { return this.startDate; }
set { this.startDate = value; }
}
public int Id
{
get { return this.id; }
set { this.id = value; }
}
}
}
*******************************************************

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Tcc.Crm.Conversion.BusinessObjects.TestDate, Tcc.Crm.Conversion.BusinessObjects" table="TEST_DATE">
<id name="Id" column="TEST_DATE_ID" type="Int32" unsaved-value="0">
<generator class="identity"/>
</id>
<property name="StartDate" column= "START_DATE" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate"/>
</class>
</hibernate-mapping>

*******************************************************

using NHibernate;
using NHibernate.Cfg;
using NUnit.Framework;
using Tcc.Crm.Conversion.BusinessObjects;
namespace Tcc.Crm.Conversion.BusinessObjectsTestFixture
{
[TestFixture]
public class TestDateFixture
{
BusinessObjects.TestDate testDate;
[Test]
public void Create()
{
testDate=new TestDate();
Configuration cfg = new Configuration();
cfg.AddAssembly("Tcc.Crm.Conversion.BusinessObjects");
ISessionFactory factory = cfg.BuildSessionFactory();
ISession session = factory.OpenSession();
ITransaction transaction = session.BeginTransaction();
session.Save(testDate);
transaction.Commit();
session.Close();
}
}
}

*******************************************************



TestCase 'Tcc.Crm.Conversion.BusinessObjectsTestFixture.TestDateFixture.Create' failed: NHibernate.MappingException : could not interpret type: Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate
at NHibernate.Cfg.Binder.GetTypeFromXML(XmlNode node)
at NHibernate.Cfg.Binder.BindSimpleValue(XmlNode node, SimpleValue model, Boolean isNullable, String path, Mappings mappings)
at NHibernate.Cfg.Binder.PropertiesFromXML(XmlNode node, PersistentClass model, Mappings mappings)
at NHibernate.Cfg.Binder.BindRootClass(XmlNode node, RootClass model, Mappings mappings)
at NHibernate.Cfg.Binder.BindRoot(XmlDocument doc, Mappings model)
at NHibernate.Cfg.Configuration.Add(XmlDocument doc)
at NHibernate.Cfg.Configuration.AddXmlReader(XmlReader hbmReader)
at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream)
at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly, Boolean skipOrdering)
at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly)
at NHibernate.Cfg.Configuration.AddAssembly(String assemblyName)
c:\dotnet\tcc\crm\businessobjectstestfixture\testdatefixture.cs(16,0): at Tcc.Crm.Conversion.BusinessObjectsTestFixture.TestDateFixture.Create()


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 15, 2005 10:29 am 
Newbie

Joined: Wed Jun 15, 2005 10:09 am
Posts: 1
Location: Paris, France
I had exactly the same problem.

Try to add a reference to the Nullables.NHibernate DLL. It should work.

Fabien


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 15, 2005 10:32 am 
Newbie

Joined: Tue Jun 14, 2005 11:10 pm
Posts: 4
Location: Dallas Texas
Thanks for the quick reply.

I have references to both Nullables.dll and Nullables.NHibernate.dll

Help!! :)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 15, 2005 11:58 am 
Newbie

Joined: Tue Jun 14, 2005 11:10 pm
Posts: 4
Location: Dallas Texas
FIXED!

I deleted all of the references to all of the NHibernate and NHibernateContrib dlls, re-downloaded the NHibernateContrib zip and referenced the NHibernate related dlls and Nullables found in the NHibernateContrib package and it works.

I think I may have been using dlls from NHibernate and NHibernateContrib that weren't compatible.

Thanks to everyone that tried to help!!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 16, 2005 3:44 am 
I had the same problem. It appears that Nullable.NHibernate.dll (0.8.4) referenced NHibernate.dll (0.8.3), but only in the version before May 26. In the current download this is solved.


Top
  
 
 Post subject:
PostPosted: Thu Jun 16, 2005 10:18 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Aha, so that was the problem! 0.8.4 was the first release I did (normally Mike Doerfler does releases), so there was athis small hiccups, but since I didn't announce it yet by that time, I thought I'd just fix it under the cover, but some people were too quick and downloaded the wrong file :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 13, 2005 1:43 pm 
Newbie

Joined: Tue Dec 13, 2005 1:39 pm
Posts: 1
Yeah, I was having a similar problem that I fixed in a simlar matter... Gotta check the versioning... Apparently I had downloaded the NHibernateContrib version 1.0.0 and was using it with NHibernate 1.0.1...

You gotta make sure that all 3 dll's are the same version:

- NHibernate.dll
- Nullables.dll
- Nullables.NHibernate.dll


Top
 Profile  
 
 Post subject: Thanks, this helped so much
PostPosted: Thu May 24, 2007 9:17 am 
Newbie

Joined: Mon Apr 16, 2007 3:20 pm
Posts: 7
This post saved my day.

NHibernate.dll - 1.2.0.3001
Nullables.dll - 1.2.0.3002
Nullables.NHibernate.dll - 1.2.0.3002

I just had to change my NHibernate.dll to version 1.2.0.3002 and it worked! Many thanks.


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