String hql = "select c from PrivateMessageFolder c " +
"where c.privateMessageFolderId = :privateMessageFolderId ";
Object idf = PersistenceSessionUtil.createSession();
EntityManager session = PersistenceSessionUtil.getSession();
EntityTransaction tx = session.getTransaction();
tx.begin();
Query query = session.createQuery(hql);
query.setParameter("privateMessageFolderId", privateMessageFolderId);
PrivateMessageFolder privateMessageFolder = null;
try {
privateMessageFolder = (PrivateMessageFolder) query.getSingleResult();
} catch (NoResultException ex) {
}
tx.commit();
PersistenceSessionUtil.closeSession(idf);
return privateMessageFolder;
} catch (Exception e) {
log.error("[getPrivateMessageFolderById]",e);