Package org.hibernate

Examples of org.hibernate.Session.evict()


      // pobranie seta
      result = session.createCriteria(Stanowisko.class).list();
      for (Stanowisko stanowisko : result) {
        Hibernate.initialize(stanowisko.getPracowniks());
        session.evict(stanowisko);
      }
    } catch (HibernateException e) {
      handleException(e);
    } finally {
      closeSession();
View Full Code Here


      // pobranie seta
      result = session.createCriteria(Stanowisko.class).list();
      for (Stanowisko stanowisko : result) {
        Hibernate.initialize(stanowisko.getPracowniks());
        session.evict(stanowisko);
      }
    } catch (HibernateException e) {
      handleException(e);
    }
    return result;
View Full Code Here

   */
  protected void removeObj(Object obj) throws DAOException {
    try {
      Session session = Helper.getHibernateSession();
      synchronized (obj) {
        session.evict(obj);
        session.delete(obj);
        session.flush();
        session.beginTransaction().commit();
      }
    } catch (Exception e) {
View Full Code Here

    return "BenutzerAlle";
  }

  public String Speichern() {
    Session session = Helper.getHibernateSession();
    session.evict(this.myClass);
    String bla = this.myClass.getLogin();

    if (!LoginValide(bla)) {
      return "";
    }
View Full Code Here

      item.setDescription( "steve's item" );
      s.persist( item );
      s.flush();
      // item is cached on insert.
      assertNotNull( slcs.getEntries().get( item.getId() ) );
      s.evict( item );
      assertEquals( slcs.getHitCount(), 0 );
      item = (Item) s.get( Item.class, item.getId() );
      assertNotNull( item );
      assertEquals( slcs.getHitCount(), 1 );
      assertNotNull( slcs.getEntries().get( item.getId() ) );
View Full Code Here

    // persist the record, then evict it, then make changes to it ("within" the session)
    PurchaseRecord record = new PurchaseRecord();
    record.setTimestamp(timestamp1);
    s.persist(record);
    s.flush();
    s.evict(record);
   
    record.setTimestamp(timestamp2);
   
    t.commit();
    s.close();
View Full Code Here

    assertEquals( "original", dp.getDescription() );
    assertFalse( s.isReadOnly( dp ) );
    s.setReadOnly( dp, true );
    dp.setDescription( "changed" );
    assertEquals( "changed", dp.getDescription() );
    s.evict( dp );
    s.refresh( dp );
    assertEquals( "original", dp.getDescription() );
    assertFalse( s.isReadOnly( dp ) );
    t.commit();
View Full Code Here

    s.clear();

    list = s.createQuery( "from ProductLine" ).list();
    ProductLine pl = ( ProductLine ) list.get( 0 );
    ProductLine pl2 = ( ProductLine ) list.get( 1 );
    s.evict( pl2 );
    pl.getModels().size(); //fetch just one collection! (how can we write an assertion for that??)

    t.commit();
    s.close();
View Full Code Here

    s.refresh( dp );
    assertEquals( "original", dp.getDescription() );
    assertFalse( s.isReadOnly( dp ) );
    dp.setDescription( "changed" );
    assertEquals( "changed", dp.getDescription() );
    s.evict( dp );
    s.refresh( dp );
    assertEquals( "original", dp.getDescription() );
    assertFalse( s.isReadOnly( dp ) );
    dp.setDescription( "changed" );
    assertEquals( "changed", dp.getDescription() );
View Full Code Here

    assertEquals( "original", dp.getDescription() );
    assertFalse( s.isReadOnly( dp ) );
    dp.setDescription( "changed" );
    assertEquals( "changed", dp.getDescription() );
    s.setDefaultReadOnly( true );
    s.evict( dp );
    s.refresh( dp );
    assertEquals( "original", dp.getDescription() );
    assertTrue( s.isReadOnly( dp ) );
    dp.setDescription( "changed" );
    t.commit();
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.