Hey Martin,
It's kind of alluded to at the start of this wiki
page<http://wiki.fluentnhibernate.org/show/AutoMappingComponents>,
but barely, components are relatively unsupported with automapping; you
either automap them completely, or not at all. So stuff like ignoring is not
supported. There's no technical reason for this, just that I haven't had the
requests to implement this behavior yet.

Your only real alternative is to not automap the components at all, and to
do it manually.

ForTypesThatDeriveFrom<MyTypeWithAComponent>(m =>
{
  m.Component(x => x.MyComponent, c =>
  {
    // map all the component fields manually
  });
});

It's not nice, but I think that's your only option currently.

Components will become first class citizens in automapping at some point,
it's just a matter of when. I've raised an
issue<http://code.google.com/p/fluent-nhibernate/issues/detail?id=156>so
this won't get forgotten about.

On Mon, Mar 23, 2009 at 12:08 PM, Martin
<martin.hornag...@marstangroup.com>wrote:

>
> James/Paul,
>
> Currently there appears to be no easy way of overriding the mapping of
> components when using auto persistence.
> I have a value object that has a public readonly property I need to
> ignore in the mappings.
> If I use IAutoMappingOverride it tries to map the value object as an
> entity and therefore fails as there is no Id.
> Do you have any plans on the radar to add an
> IAutoComponentMappingOverride<T>?
> Alternatively is there an easy way to add a convention to ignore
> readonly proeprties?
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibernate@googlegroups.com
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to