Hibernate doesn\'t delete my row:
public boolean deleteVote(Login user, int pid){
Session session = getSession();
try{
String hql = \"del
int deletedRows = 0;
try {
session = sessionProvider.get();
String hql = "delete from ApprovalRemark approvalRemark where approvalRemark.approvalItem.id =:approvalItemId ";
Query query = session.createQuery(hql);
query.setParameter("approvalItemId", approvalItemId);
deletedRows = query.executeUpdate();
} catch (javax.persistence.NoResultException e) {
return false;
} catch (HibernateException he) {
log.error("deleteAllApprovalRemarksForApprovalItem exception", he);
throw he;
}
log.debug("deleteAllApprovalRemarksForApprovalItem deleted " + deletedRows + " rows");
return true;