Hi,
I'm using NHibernate 3.3.2.4000 I have this model:
public class PageItem {
// ...
public virtual *EntityAttributeCollection Attributes *{ get; set; }
}
where the *EntityAttributeCollection *is defined as a collection:
public class *EntityAttributeCollection *: IEnumerable<KeyValuePair<string,
string>>
{
}
*EntityAttributeCollection *is a custom user type.
The *Attributes *collection will be saved in one column as json.
I have a customized conformist mapping for this custom property:
Property(c => c.Attributes, m => {
*m.Type<EntityAttributeCollectionUserType>();*
});
*I assumed this manual property mapping will override the Bag mapping
mapped by ConventionModelMapper.*
But it didn't. When I run the app, it raised exception: *Can't determine
collection element relation (property Attributes in PageItem)*
After some debugging, it seems that, by convention, the Attributes property
is mapped as Bag.
*Event though I manually map Attributes as "Property", it won't override
the convention Bag mapping.*
I can use "Property" mapping to override conventional "Property" mapping.
I also can use "Bag" mapping to override conventional "Bag" mapping.
But I'm not able use "Property" mapping to override conventional "Bag"
mapping.
How can I override the conventional Bag mapping to make it a "Property"
mapping? Thanks
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/groups/opt_out.