Why does this HQL delete fail, when an HQL select with same terms works?
问题 Why does the following HQL query fail? string hql = @"delete MyLog log where log.UtcTimestamp < :threshold and log.Configuration.Application = :application"; session.CreateQuery(hql) .SetDateTime("threshold", threshold) .SetEnum("application", this.application) .ExecuteUpdate(); The same form of query works when used in a select: string hql = @"from MyLog log where log.UtcTimestamp < :threshold and log.Configuration.Application = :application"; IList<MyLog> log = session.CreateQuery(hql)