 <p>Something like this may do the trick</p> <pre><code>NHSession.QueryOver&lt;Customer&gt;() .Where( Restrictions.Eq( Projections.SqlFunction("length", NHibernateUtil.String, Projections.Property&lt;Customer&gt;(x =&gt; x.RegistryCode)), 8 ) ) </code></pre>