thomask wrote:
Looking at the IInterceptor it seems that here I only have access to a "before-hibernate-load".
The IInterceptor will work for you. I have used this type of approach in the past. Not for the exact reason you state, but we did use it to populate parts of an object from another source besides the main NHibernate query/load process.
The method you are looking for is the OnLoad method. It should look something like this:
Code:
public bool OnLoad(object entity, object id, object[] state, string[] propertyNames, NHibernate.Type.IType[] types)
Basically you have the entity being loaded (which would be your user object). You also have the id used to load the entity (probably what you need), you also have the state array which contains the property values being loaded from the database. For any property you need. Look in the propertyNames array, find the property you want and then use the index of that property on the state array to load the value you are looking for. If you need to know the NHibernate type that is also using the same index.
From that you should have all of the information you need to load things from Active Directory. This should work fine.[/code]