nhibernate/nhibernate-core — pull request #69 by ramonsmits (2012-01-30 14:07:14+00:00)
Title: NH-2982: SimpleExpression.ToString() can result in unwanted loading of lazy objects including test

SimpleExpression.ToString() can result in unwanted loading of lazy objects. This is because it called value.ToString() to get a string representation of an entity. The entity ToString() can access lazy loaded properties thus in unwanted loading of entities.

Code changed so that the string value is retrieved via ObjectUtils. The implementation of ObjectUtils now checks if the supplied instance implements INHibernateProxy and used that to return an identification without calling .ToString().