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.  [ 2 posts ] 
Author Message
 Post subject: Generic IDictionary mapping
PostPosted: Mon Oct 26, 2009 11:04 am 
Newbie

Joined: Wed May 21, 2008 9:54 am
Posts: 8
I'm using castle activerecord to map a generic IDictionary<enum, bool>

I've got it running and am able to save data but if I try to retrieve I get this exception:
{"The value \"0\" is not of type \"Project.PropertyType\" and cannot be used in this generic collection. Parameter name: key"}

PropertyType is my enum,
The mapping that AR has created is:
<class name="MyProject.Item, MyProject" table="Item">
...
<map name="Properties" access="property" table="ItemProperties" lazy="false">
<key column="ItemID" />
<index column="Idx" type="int" />
<element column="Value" type="System.Boolean, mscorlib"/>
</map>

I'm trying to figure out whats wrong here, as the examples I see seem to follow the same mapping..

Thanks


Top
 Profile  
 
 Post subject: Re: Generic IDictionary mapping
PostPosted: Tue Oct 27, 2009 10:32 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
You've been mapping the index as "int". Try the mapping without a type definition for the index. If that's not working, try the fully qualified type of the enum (MyProject.xyz.MyEnum, MyProject).

_________________
--Wolfgang


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