Hibernate Tutorials/
« Previous | 1 | 2 | 3 | Next »
The DELETE clause can be used to delete one or more objects. Following is the simple syntax of using DELETE clause:

String hql ="DELETE FROM Employee "+
"WHERE id = :employee_id";
Query query =session.createQuery(hql);
query.setParameter("employee_id",10);
int result = query.executeUpdate();
System.out.println("Rows affected: "+ result);
« Previous | 1 | 2 | 3 | Next »


copyright © 2014 - all rights riserved by javatechnologycenter.com