title: Join tables in NHIbernate
body: <p>I asked question in this thread, but nobody answered</p>
  
  <p><a href="https://stackoverflow.com/questions/881865/nhibernate-map-many-to-many-join-table">NHibernate Map many-to-many join table</a></p>
  
  <p>how you can select all Persons with phone number contains 777. I do somthing like this, but it does not work</p>
  
  <pre><code>var tags = session.CreateCriteria(typeof(Person))
                  .CreateAlias("Phone", "p", JoinType.InnerJoin)
                  .CreateAlias("PersonPhone", "pp", JoinType.InnerJoin)
                  .Add(Restrictions.Like("p.Name", "777"))
                  .List();
  </code></pre>