Package org.hibernate

Examples of org.hibernate.Session.refresh()


      if ( !session.contains( entity ) ) {
        throw new IllegalArgumentException( "Entity not managed" );
      }
      if ( lockModeType != null ) {
        lockOptions = getLockRequest( lockModeType, properties );
        session.refresh( entity, lockOptions );
      }
      else {
        session.refresh( entity );
      }
    }
View Full Code Here


      if ( lockModeType != null ) {
        lockOptions = getLockRequest( lockModeType, properties );
        session.refresh( entity, lockOptions );
      }
      else {
        session.refresh( entity );
      }
    }
    catch ( MappingException e ) {
      throw new IllegalArgumentException( e.getMessage(), e );
    }
View Full Code Here

      }

      logger.debug("created a new session");
      Prozess o = (Prozess) session.get(Prozess.class, Integer.valueOf(processID));
      logger.debug("loaded process");
      session.refresh(o);
      logger.debug("refreshed process");
      session.close();
      logger.debug("closed session");
    } catch (Throwable e) {
      logger.error("cannot refresh process with id " + processID);
View Full Code Here

        HibernateUtilOld.rebuildSessionFactory();
        session = HibernateUtilOld.getSessionFactory().openSession();
      }
      Prozess o = (Prozess) session.get(Prozess.class, processID);
      logger.debug("loaded process");
      session.refresh(o);
      logger.debug("refreshed process");
      // session.close();
      // logger.debug("closed session");
    } catch (Throwable e) {
      logger.error("cannot refresh process with id " + processID);
View Full Code Here

  public static void refreshStep(int stepID) {
    try {

      Session session = HibernateUtilOld.getSessionFactory().openSession();
      Schritt o = (Schritt) session.get(Schritt.class, stepID);
      session.refresh(o);
      session.close();
    } catch (Exception e) {
      logger.error("cannot refresh step with id " + stepID);
    }
View Full Code Here

  protected void refresh(Object o) {
    Session session = Helper.getHibernateSession();
    if (session == null) {
      session = HibernateUtil.getSessionFactory().openSession();
      session.refresh(o);
      session.close();
    }
    session.refresh(o);
  }
View Full Code Here

    if (session == null) {
      session = HibernateUtil.getSessionFactory().openSession();
      session.refresh(o);
      session.close();
    }
    session.refresh(o);
  }

  @SuppressWarnings("rawtypes")
  protected Object loadObj(Class c, Integer id) throws DAOException {
    try {
View Full Code Here

      log.debug("Getting account " + id + " with refresh");
      tm.begin();
      try {
          Session session = sessionFactory.getCurrentSession();
          Account acct  = (Account) session.get(acctClass, id);
          session.refresh(acct);
          acct = (Account) session.get(acctClass, id);
          tm.commit();
          return acct;
      }
      catch (Exception e) {
View Full Code Here

    final Session session = this.hibernateTemplate.getSessionFactory()
        .openSession();
    final Transaction transaction = session.getTransaction();
    try {
      transaction.begin();
      session.refresh(t);
      transaction.commit();
    } catch (final HibernateException e) {
      LOGGER.error(e);
    }
View Full Code Here

    customer.setName( "other" );
    session.flush();
    assertFalse( "should-be-proxy was initialized", Hibernate.isInitialized( customer.getCompany() ) );

    session.refresh( customer );
    assertEquals( "name not updated", "other", customer.getName() );
    assertEquals( "company association not correct", "acme", customer.getCompany().getName() );

    session.getTransaction().commit();
    session.close();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.