Tuesday, July 11, 2006

Hibernate Delete Sample

In Hibernate, you can make use of session.delete(COMMAND, values, types) like this.

String COMMAND="from com.any.BookItem item "
+ "where item.bookpk.code=? "
+ "and item.bookpk.title=?";
Object[] values = { new Integer(2), "JSP banza" };
Type[] types = { Hibernate.INTEGER, Hibernate.STRING };

session.delete(COMMAND, values, types);

No comments: