title: Fluent Nhibernate inner join
body: <p>I have 3 tables (Master, Imagen, Linea) were:</p>
  
  <pre><code>Master
  public virtual int Id { get; private set; }
  public virtual Imagen imagen { get; set; }
  
  Imagen
  public virtual int Id { get; private set; }
  public virtual Linea linea { get; set; }
  
  Linea
  public virtual int Id { get; private set; }
  public virtual String Nombre { get; set; }
  </code></pre>
  
  <p>I need a query like this: </p>
  
  <pre><code>SELECT * FROM dbo.Master 
  INNER JOIN dbo.Imagen ON dbo.Master.imagen_id = dbo.Imagen.Id 
  INNER JOIN dbo.Linea ON dbo.Imagen.linea_id = dbo.Linea.Id 
  WHERE dbo.Linea_Id = 5
  </code></pre>
  
  <p>But I dont know how to tell Fluent Nhibernate to create this query using the automapper.
  So far I've tried this:</p>
  
  <pre><code>ICriteria c = session.CreateCriteria(typeof(Master))
    .CreateAlias("dbo.Imagen", "img", JoinType.InnerJoin)
    .Add(Restrictions.Eq("img.linea_id", id_linea));
  
  return c.List&lt;Master&gt;();
  </code></pre>
  
  <p>But I get this error: 
  could not resolve property: dbo of: ImageManager.Model.Entity.Master</p>
  
  <p>Any ideas on how to do a Inner Join? 
  Thanks in advance</p>