nhibernate/nhibernate-core — pull request #37 by ramonsmits (2011-12-19 14:07:00+00:00)
Title: 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().