Code example for Session

Methods: get

0
        return du;
    } 
 
    public DeploymentUnitDAO getDeploymentUnit(String name) {
        try { 
            DeploymentUnitDaoImpl du = (DeploymentUnitDaoImpl) _session.get(DeploymentUnitDaoImpl.class,name);
            return du;
        } catch (HibernateException e) {
            __log.error("DbError", e);
            throw e;
        } 
    } 
 
    public long getNextVersion() { 
        VersionTrackerDAOImpl vt = (VersionTrackerDAOImpl)
                _session.createQuery("from VersionTrackerDAOImpl v ").uniqueResult();
        if (vt == null) return 1;
        else return vt.getVersion() + 1;
    }