hi, the method obejct session.connection() is deprecated is replace with wich functionality or other methodology? thank you for the answer
under the method where used:
public void saveFindingAction(FindingAction action) { if (action.getId() == null) { Long sequenceNumber = (Long) getSession().createQuery("select count(*) from FindingAction f where f.finding = :finding").setParameter("finding", action.getFinding()).setFlushMode(FlushMode.COMMIT).uniqueResult(); action.setSequenceNumber(sequenceNumber.intValue() + 1); }
Session hibernateSession = getHibernateTemplate().getSessionFactory().getCurrentSession(); hibernateSession.setFlushMode(FlushMode.ALWAYS); hibernateSession.saveOrUpdate(action); hibernateSession.flush();
if (action.getDescription() != null) { try { ClobSolver.insertClobString("AUD_FINDING_ACTIONS", "DESCRIPTION", "FINDING_ACTION_ID", action.getId(), action.getDescription(), hibernateSession.connection()); } catch (Exception e) { log.error("Comments CLOB not saved for Description '" + action.getDescription() + "'(" + action.getId() + ") " + "\nException : " + e.getClass().getName() + " Message(s): " + e.getMessage() + " " + e.getLocalizedMessage()); e.printStackTrace(); } } }
/** * deleteFindingAction * * @param action FindingAction */
|