using NHibernate; using NHibernate.Criterion; ICriteria criteria = session.CreateCriteria(typeof(Person)); criteria.Add(Restrictions.Gt("Age", 18)); criteria.CreateAlias("Address", "addr"); criteria.Add(Restrictions.Eq("addr.City", "New York City")); string addressAlias = criteria.GetSQLAlias("Address"); // returns "addr"In this example, we create an ICriteria object based on the Person class, add two Restrictions to filter by age and city, create an alias for the Address property (to allow us to filter by its fields), and retrieve the SQL alias for the Address table (which is "addr"). Overall, ICriteriaQuery is a powerful and flexible tool that allows developers to build complex queries against NHibernate-mapped databases, including joining tables, filtering by multiple properties, and sorting by any field.