What is the recommended way to truncate a table using hibernate/hql?
I\'ve tried this:
Query query = session.createQuery(\"truncate table MyTable\"); qu
I guess an horrible way of doing it would be deleting all.
public int hqlTruncate(String myTable){ String hql = String.format("delete from %s",myTable); Query query = session.createQuery(hql); return query.executeUpdate(); }