be carefull, truncate and delete are totally separate sql statements :
- delete is DML and truncate is DDL, which means that delete can be rollbacked and truncate cannot be rollbacked
- delete has to find each row one bey one. truncate is instantaneous
- delete use undo logs and truncate does not
if you put it all together :
1/ if you want it to be rollbackable, you don't want to use truncate
2/ if you use delete, given the size of the table you want to empty :
- if the table is small you will see no difference
- if the table is of medium size you will experience bad perfs
- if the table is large you will run out of space in the undo tablespace, and you won't be able to empty anything
so be carefull of what statement you really want to use.
as to how truncating a table with hql, it should be forbidden to run DDL (truncate, create table, drop table, etc...) from and application. So it should be delete. But if the table is large, it won't work, either.
That's why emptying a table in an application is in general a bad idea.
If you want to do some cleaning, it is often better to run truncate inside an sql script once each night.
Notice that I don't know the specifics of your application and that it is only talking in general