Is there Interceptor, EventListener or anything in NHibernate that is executed after retrieving entity from the database and before inserting it to the 2nd level cache?
I have a class with a property which might contain something like
Lorem ipsum <c:link type="tag" id="123" /> dolor sit amet
and I need to run plugins that transform it to
Lorem ipsum <a class="tag-link" href="/tags/tag-name/" title="Description of the tag">Tag name</a> dolor sit amet
And if cache is enabled I want to do that only once: before that entity is inserted to the cache.
I found a possible solution: UserTypes.
Entity
Mapping
UserType (part of it)
Fluent NHibernate Convention for mapping the custom type
Creating SessionFactory