-->
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.  [ 6 posts ] 
Author Message
 Post subject: Could not load type System.Int32
PostPosted: Fri Apr 28, 2006 3:26 am 
Senior
Senior

Joined: Sat Sep 03, 2005 12:54 am
Posts: 139
Hi,

I am getting the following exception when one of my collections is being lazy loaded and I can't for the life of me see where the mapping error is in my XML:

Code:
Could not load type 'System.Int32, NHibernate, Version=1.0.2.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc', check that type and assembly names are correct


The mapping in the Parent object looks like this:

Code:
<bag name="Children" table="Child" inverse="true" lazy="true" cascade="all-delete-orphan">
  <cache usage="nonstrict-read-write"/>
  <key column="ParentID"/>
  <one-to-many class="MyDomain.Child, MyDomain"/>
</bag>


Would appreciate any pointers to help fix this one.

Thanks,

Jason


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 28, 2006 3:50 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
The error is most certainly not in this part of mappings. Look for type="System.Int32" and change it to type="Int32" or "System.Int32, mscorlib".


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 28, 2006 3:57 am 
Senior
Senior

Joined: Sat Sep 03, 2005 12:54 am
Posts: 139
Hi Sergey,

I just did a search in my entire project and I do not specify System.Int32 anywhere...I only specify Int32 in all cases.

Any other ideas?

Cheers,

Jason


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 29, 2006 7:52 am 
Senior
Senior

Joined: Sat Sep 03, 2005 12:54 am
Posts: 139
OK...finally tracked this one down. I had a property in on of my classes of type "System.Type" that was being loaded from the database. But, in the database I had only entered "System.Int32" instead of "System.Int32, mscorlib".

Nothing to do with mapping at all in the end!

Cheers,

Jason


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 29, 2006 8:49 pm 
Regular
Regular

Joined: Fri Jul 29, 2005 9:46 am
Posts: 101
Hi!
I am just curious... you wrote:

Quote:
in the database I had only entered "System.Int32" instead of "System.Int32, mscorlib



in the database I don't understand... what database do you use that allows you to choose the types of the columns using .NET types?...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 29, 2006 9:14 pm 
Senior
Senior

Joined: Sat Sep 03, 2005 12:54 am
Posts: 139
Hi,

It is a generic mechanism to allow the users to enter a value whose type is controlled dynamically, e.g. System.Int32 or System.Decimal or System.Boolean, etc. The users response is converted into a string for storage in the database and then converted back to the correct type as required.

It does feel a little clunky so I would be open to better suggestions!

Cheers,

Jason


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