Hibernate version: TRUNK
It says that OnSave is fired PRIOR to saving the object. However, this doesn't appear to be the case when using identity based IDs. My question is if this is a bug or if I'm misreading when OnSave is really fired?
SessionImpl.cs (starting at line 908)
Code:
// NH-962: This was originally done before many-to-one cascades.
// Execute all delayed inserts (including those for entities saved due to cascading above)
if (useIdentityColumn)
{
ExecuteInserts();
}
object[] values = persister.GetPropertyValues(theObj);
IType[] types = persister.PropertyTypes;
bool substitute = false;
if (!replicate)
{
substitute = interceptor.OnSave(theObj, id, values, persister.PropertyNames, types);
// Keep the existing version number in the case of replicate!
if (persister.IsVersioned)
{
// IsUnsavedVersion bit below is NHibernate-specific
substitute = Versioning.SeedVersion(
values, persister.VersionProperty, persister.VersionType, persister.IsUnsavedVersion(values), this
) || substitute;
}
}