Package org.hibernate.test.annotations.id.sequences.entities

Examples of org.hibernate.test.annotations.id.sequences.entities.Home


  public void testDefaultSequence() throws Exception {
    Session s;
    Transaction tx;
    s = openSession();
    tx = s.beginTransaction();
    Home h = new Home();
    s.persist( h );
    tx.commit();
    s.close();
    assertNotNull( h.getId() );

    s = openSession();
    tx = s.beginTransaction();
    Home reloadedHome = ( Home ) s.get( Home.class, h.getId() );
    assertEquals( h.getId(), reloadedHome.getId() );
    s.delete( reloadedHome );
    tx.commit();
    s.close();
  }
View Full Code Here


  public void testParameterizedAuto() throws Exception {
    Session s;
    Transaction tx;
    s = openSession();
    tx = s.beginTransaction();
    Home h = new Home();
    s.persist( h );
    tx.commit();
    s.close();
    assertNotNull( h.getId() );

    s = openSession();
    tx = s.beginTransaction();
    Home reloadedHome = ( Home ) s.get( Home.class, h.getId() );
    assertEquals( h.getId(), reloadedHome.getId() );
    s.delete( reloadedHome );
    tx.commit();
    s.close();
  }
View Full Code Here

  public void testDefaultSequence() throws Exception {
    Session s;
    Transaction tx;
    s = openSession();
    tx = s.beginTransaction();
    Home h = new Home();
    s.persist(h);
    tx.commit();
    s.close();
    assertNotNull(h.getId());

    s = openSession();
    tx = s.beginTransaction();
    Home reloadedHome = (Home) s.get(Home.class, h.getId());
    assertEquals(h.getId(), reloadedHome.getId());
    s.delete(reloadedHome);
    tx.commit();
    s.close();
  }
View Full Code Here

  public void testParameterizedAuto() throws Exception {
    Session s;
    Transaction tx;
    s = openSession();
    tx = s.beginTransaction();
    Home h = new Home();
    s.persist(h);
    tx.commit();
    s.close();
    assertNotNull(h.getId());

    s = openSession();
    tx = s.beginTransaction();
    Home reloadedHome = (Home) s.get(Home.class, h.getId());
    assertEquals(h.getId(), reloadedHome.getId());
    s.delete(reloadedHome);
    tx.commit();
    s.close();
  }
View Full Code Here

  public void testDefaultSequence() throws Exception {
    Session s;
    Transaction tx;
    s = openSession();
    tx = s.beginTransaction();
    Home h = new Home();
    s.persist(h);
    tx.commit();
    s.close();
    assertNotNull(h.getId());

    s = openSession();
    tx = s.beginTransaction();
    Home reloadedHome = (Home) s.get(Home.class, h.getId());
    assertEquals(h.getId(), reloadedHome.getId());
    s.delete(reloadedHome);
    tx.commit();
    s.close();
  }
View Full Code Here

  public void testParameterizedAuto() throws Exception {
    Session s;
    Transaction tx;
    s = openSession();
    tx = s.beginTransaction();
    Home h = new Home();
    s.persist(h);
    tx.commit();
    s.close();
    assertNotNull(h.getId());

    s = openSession();
    tx = s.beginTransaction();
    Home reloadedHome = (Home) s.get(Home.class, h.getId());
    assertEquals(h.getId(), reloadedHome.getId());
    s.delete(reloadedHome);
    tx.commit();
    s.close();
  }
View Full Code Here

TOP

Related Classes of org.hibernate.test.annotations.id.sequences.entities.Home

Copyright © 2018 www.massapicom. 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.