How do you perform a batch delete with HQL?
I am trying to execute one and keep getting the following exception.
NHibernate.QueryException: query must begin with SELECT or FROM:
delete [delete QuestionnaireEntity]
The calling code is:
public void DeleteAll<T>()
{
using (var session = sessionManager.OpenSession())
{
var sql = "delete " + typeof (T).Name;
var query = session.CreateQuery(sql);
query.ExecuteUpdate();
}
}
I am using NHibernate 2.1.0.1000
I have tried "delete from" and get the same exception.
Thanks,
Joe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---