Have you considered an IUserType? Or performing the correct conversion
to the string format in PropertyA's setter (as opposed to a dummy
value)? It seems to me that if you have PropertyB, you entity class is
already polluted, if it doesn't actually use PropertyB in any way.
Would making the class contain or call the conversion logic really be
that much worse?

/Oskar



2010/10/18 Alex McMahon <[email protected]>:
> I am using a PreUpdate event listener to convert an unmapped property
> (PropertyA, typed as object) on an entity to a required string format
> to put on another property (PropertyB) so that it will satisfy a
> legacy database.
>
> The problem I have is that if you set PropertyA NHibernate does not
> seem to mark the entity as dirty because PropertyA is not mapped to a
> column. Therefore the PreUpdateEvent listener is never fired so I
> can't update PropertyB.
>
> Is there a way to specify a mapping for a property so that changes to
> it are tracked by NHibernate but without having a corresponding
> column? (I had "property mapping has wrong number of columns" when I
> tried this, because PropertyA is of type "object").
>
> Is there some other way to mark an entity as dirty?
>
> The workaround I have so far is that in the setter for PropertyA I set
> PropertyB to a dummy value to trigger it being "dirty", but I don't
> like this solution as it pollutes my business entities a bit and the
> temporary value is a bit misleading.
>
> Any good ideas?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/nhusers?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to