title: Delete multiple records by list of id's with HQL statement
body: <p>I want to delete multiple records of a certain entity where the id of the entity is in the list of ids I have. I am trying to perform this action in C# with NHibernate.</p>
  
  <p>What I have is a list of Ids.</p>
  
  <p>I want to do something similar to this : </p>
  
  <pre><code>var idList = new List&lt;Guid&gt;() { Guid.NewGuid(),Guid.NewGuid()};
  
  _session.CreateQuery("DELETE FROM MapsItem o WHERE o.Id = IN :idList")
      .SetParameterList("idList", idList)
      .ExecuteUpdate();
  </code></pre>
  
  <p>This results into the following error :</p>
  
  <pre><code>Exception of type 'Antlr.Runtime.NoViableAltException' was thrown. near line 1, column 33 [DELETE FROM Album o WHERE o.Id = IN  :idList]
  </code></pre>
  
  <p>The query is a HQL statement.</p>
  
  <p>What is wrong in the HQL query.</p>
  
  <p>Both of the provided answers to the above question give a correct solution. However, when I execute the HQL,the error is like this: </p>
  
  <pre><code>could not insert/select ids for bulk delete[SQL: insert into #MapsItem SELECT mapsitem0_.Id as Id FROM MapsItem mapsitem0_ inner join BaseEntity mapsitem0_1_ on mapsitem0_.Id=mapsitem0_1_.Id WHERE Id in (? , ? , ? , ? , ? , ?)]
  </code></pre>
  
  <p>The entity MapsItem derives from the entity BaseEntity. Both have a property Id in the database. The SQL query cannot be executed, because the column Id in the WHERE clause is ambigious. </p>
  
  <p>How can I solve this problem ?</p>