nhibernate/nhibernate-core — pull request #91 by IronsUK (2012-03-15 13:03:47+00:00)
Title: NH-3087 pre-work

https://nhibernate.jira.com/browse/NH-3087

Some pre-work refactoring to support multi tenancy feature, to be implemented later.

- Refactored EntityKey and CacheKey creation to be centralized to ISessionImplementor (implemented in AbstractSessionImpl)
- Key creation takes tenantIdentifier into account
- Added MultiTenancyStrategy enum for SessionFactory configuration and integrated into Settings
- Changed SessionFactoryImpl.EvictEntity(string entityName, object id) and EvictCollection(string roleName, object id) to throw an exception when the multi-tenancy strategy is not NONE and there is no session context

No change to the public API and no new features added. Tests passed ok after refactoring. I would have added a test for the SessionFactory cache eviction change but it looks like those methods are untested currently.