Sid,
As you didn't say anything else about your situation/why you are replacing
the values, etc, it's hard to really tell what you are trying to accomplish
and so hard to give you a good solution...

However, maybe a Custom Type is what you want for that field, to convert a
field to something else on the way in from the database-this can be used,
for instance, to map a string db field to an int in your object, 3 fields
together into another field, or probably weird things like having some int
field in your object have 100+(database value for that field). ( see this
as well for dirty issues with custom types
http://weblogs.asp.net/ricardoperes/archive/2012/08/29/nhibernate-pitfalls-custom-types-and-detecting-changes.aspx)
 This will probably do what you want, without a weird NHibernate hack.

Alternatively, maybe you just want to mark that field as readonly to
NHibernate if you're not actually changing it in your app, which you can
also do-then, NH will retrieve the field for you, but won't watch it for
changes AT ALL, so won't mark your entity dirty on changes of that field...
but will for changes on other fields.


On Wed, Nov 13, 2013 at 12:40 PM, Sid Shetye <[email protected]>wrote:

> How do I mark an entity as "clean" immediately after modifying any of it's
> properties inside on the handlers (eg: PostLoadEvent handler)?
>
> In the application code we modify DateTime properties for legacy reasons
> (inside the Post Load Event handler) but don't want this modification to
> the entity to trigger a write back in OnFlushEntity(). FYI, We do want to
> track the entity after this instant (modify + reset as clean) to track any
> changes from that point on.
>
> PS: I did see someone asking a similar question but that question had no
> responses; therefore this question.
>
> --
> 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.
>

-- 
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.

Reply via email to