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

Examples of org.hibernate.test.annotations.id.entities.Ball


  public void testTableGenerator() throws Exception {
    Session s = openSession();
    Transaction tx = s.beginTransaction();

    Ball b = new Ball();
    Dog d = new Dog();
    Computer c = new Computer();
    s.persist(b);
    s.persist(d);
    s.persist(c);
    tx.commit();
    s.close();
    assertEquals("table id not generated", new Integer(1), b.getId());
    assertEquals("generator should not be shared", new Integer(1), d
        .getId());
    assertEquals("default value should work", new Long(1), c.getId());

    s = openSession();
View Full Code Here


  public void testTableGenerator() throws Exception {
    Session s = openSession();
    Transaction tx = s.beginTransaction();

    Ball b = new Ball();
    Dog d = new Dog();
    Computer c = new Computer();
    s.persist(b);
    s.persist(d);
    s.persist(c);
    tx.commit();
    s.close();
    assertEquals("table id not generated", new Integer(1), b.getId());
    assertEquals("generator should not be shared", new Integer(1), d
        .getId());
    assertEquals("default value should work", new Long(1), c.getId());

    s = openSession();
View Full Code Here

  public void testTableGenerator() throws Exception {
    Session s = openSession();
    Transaction tx = s.beginTransaction();

    Ball b = new Ball();
    Dog d = new Dog();
    Computer c = new Computer();
    s.persist(b);
    s.persist(d);
    s.persist(c);
    tx.commit();
    s.close();
    assertEquals("table id not generated", new Integer(1), b.getId());
    assertEquals("generator should not be shared", new Integer(1), d
        .getId());
    assertEquals("default value should work", new Long(1), c.getId());

    s = openSession();
View Full Code Here

TOP

Related Classes of org.hibernate.test.annotations.id.entities.Ball

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.