title: Why does this HQL delete fail, when an HQL select with same terms works?
body: <p>Why does the following HQL query fail?</p>
  
  <pre><code>string hql = @"delete MyLog log
                 where
                      log.UtcTimestamp &lt; :threshold and
                      log.Configuration.Application = :application";
  
  session.CreateQuery(hql)
         .SetDateTime("threshold", threshold)
         .SetEnum("application", this.application)
         .ExecuteUpdate();
  </code></pre>
  
  <p>The same form of query works when used in a select:</p>
  
  <pre><code>string hql = @"from MyLog log
                 where
                      log.UtcTimestamp &lt; :threshold and
                      log.Configuration.Application = :application";
  IList&lt;MyLog&gt; log = session.CreateQuery(hql)
      .SetDateTime("threshold", threshold)
      .SetEnum("application", this.application)
      .List&lt;MyLog&gt;();
  </code></pre>
  
  <p>The mapping for MyLog contains:</p>
  
  <pre><code>References(x =&gt; x.Configuration)
       .Columns("CONFIGURATION_ID")
       .ReadOnly();      
  </code></pre>
  
  <p>The mapping for Configuration contains:</p>
  
  <pre><code>Map(x =&gt; x.Application, "APPLICATION_ID");
  </code></pre>
  
  <p>The error I get is:</p>
  
  <blockquote>
    <p>delete from MYLOG, CONFIGURATION
    countercon1_ where UTC_TIMESTAMP&lt;:p0
    and APPLICATION_ID=:p1; :p0 =
    04/10/2010 17:15:52, :p1 = 7</p>
    
    <p>NHibernate.Exceptions.GenericADOException:
    could not execute update query [SQL:</p>
    
    <p>delete from MYLOG, CONFIGURATION
    countercon1_ where UTC_TIMESTAMP&lt; ? and
    APPLICATION_ID= ?</p>
    
    <p>] --->
    Oracle.DataAccess.Client.OracleException:
    ORA-00933: SQL command not properly
    ended</p>
  </blockquote>