tx.begin();
Query query = session.createQuery(hql);
query.setParameter("isTrash", isTrash);
query.setParameter("privateMessageFolderId", privateMessageFolderId);
query.setParameter("privateMessageIds", privateMessageIds);
int updatedEntities = query.executeUpdate();
//Refresh the Entities in the Cache as Hibernate will not do it!
for (Long privateMessageId : privateMessageIds) {
String hqlSel = "select c from PrivateMessages c " +
"where c.privateMessageId = :privateMessageId ";