Package org.hibernate.test.annotations

Examples of org.hibernate.test.annotations.Company


    tx = s.beginTransaction();
    Flight firstOne = new Flight();
    firstOne.setId( new Long( 1 ) );
    firstOne.setName( "AF0101" );
    firstOne.setDuration( new Long( 1000 ) );
    Company frenchOne = new Company();
    frenchOne.setName( "Air France" );
    firstOne.setCompany( frenchOne );
    s.persist( firstOne );
    tx.commit();
    s.close();
    assertNotNull( "identity id should work", frenchOne.getId() );

    s = openSession();
    tx = s.beginTransaction();
    firstOne = (Flight) s.get( Flight.class, new Long( 1 ) );
    assertNotNull( firstOne.getCompany() );
    assertEquals( frenchOne.getName(), firstOne.getCompany().getName() );
    tx.commit();
    s.close();
  }
View Full Code Here


    tx = s.beginTransaction();
    Flight firstOne = new Flight();
    firstOne.setId( new Long( 1 ) );
    firstOne.setName( "AF0101" );
    firstOne.setDuration( new Long( 1000 ) );
    Company frenchOne = new Company();
    frenchOne.setName( "Air France" );
    firstOne.setCompany( frenchOne );
    s.persist( firstOne );
    tx.commit();
    s.close();
    assertNotNull( "identity id should work", frenchOne.getId() );

    s = openSession();
    tx = s.beginTransaction();
    firstOne = (Flight) s.get( Flight.class, new Long( 1 ) );
    assertNotNull( firstOne.getCompany() );
    assertEquals( frenchOne.getName(), firstOne.getCompany().getName() );
    tx.commit();
    s.close();
  }
View Full Code Here

    tx = s.beginTransaction();
    Flight firstOne = new Flight();
    firstOne.setId( new Long( 1 ) );
    firstOne.setName( "AF0101" );
    firstOne.setDuration( new Long( 1000 ) );
    Company frenchOne = new Company();
    frenchOne.setName( "Air France" );
    firstOne.setCompany( frenchOne );
    s.persist( firstOne );
    tx.commit();
    s.close();
    assertNotNull( "identity id should work", frenchOne.getId() );

    s = openSession();
    tx = s.beginTransaction();
    firstOne = (Flight) s.get( Flight.class, new Long( 1 ) );
    assertNotNull( firstOne.getCompany() );
    assertEquals( frenchOne.getName(), firstOne.getCompany().getName() );
    tx.commit();
    s.close();
  }
View Full Code Here

    tx = s.beginTransaction();
    Flight firstOne = new Flight();
    firstOne.setId( new Long( 1 ) );
    firstOne.setName( "AF0101" );
    firstOne.setDuration( new Long( 1000 ) );
    Company frenchOne = new Company();
    frenchOne.setName( "Air France" );
    firstOne.setCompany( frenchOne );
    s.persist( firstOne );
    tx.commit();
    s.close();
    assertNotNull( "identity id should work", frenchOne.getId() );

    s = openSession();
    tx = s.beginTransaction();
    firstOne = (Flight) s.get( Flight.class, new Long( 1 ) );
    assertNotNull( firstOne.getCompany() );
    assertEquals( frenchOne.getName(), firstOne.getCompany().getName() );
    tx.commit();
    s.close();
  }
View Full Code Here

    tx = s.beginTransaction();
    Flight firstOne = new Flight();
    firstOne.setId( new Long( 1 ) );
    firstOne.setName( "AF0101" );
    firstOne.setDuration( new Long( 1000 ) );
    Company frenchOne = new Company();
    frenchOne.setName( "Air France" );
    firstOne.setCompany( frenchOne );
    s.persist( firstOne );
    tx.commit();
    s.close();
    assertNotNull( "identity id should work", frenchOne.getId() );

    s = openSession();
    tx = s.beginTransaction();
    firstOne = (Flight) s.get( Flight.class, new Long( 1 ) );
    assertNotNull( firstOne.getCompany() );
    assertEquals( frenchOne.getName(), firstOne.getCompany().getName() );
    tx.commit();
    s.close();
  }
View Full Code Here

    tx = s.beginTransaction();
    Flight firstOne = new Flight();
    firstOne.setId( new Long( 1 ) );
    firstOne.setName( "AF0101" );
    firstOne.setDuration( new Long( 1000 ) );
    Company frenchOne = new Company();
    frenchOne.setName( "Air France" );
    firstOne.setCompany( frenchOne );
    s.persist( firstOne );
    tx.commit();
    s.close();
    assertNotNull( "identity id should work", frenchOne.getId() );

    s = openSession();
    tx = s.beginTransaction();
    firstOne = (Flight) s.get( Flight.class, new Long( 1 ) );
    assertNotNull( firstOne.getCompany() );
    assertEquals( frenchOne.getName(), firstOne.getCompany().getName() );
    tx.commit();
    s.close();
  }
View Full Code Here

    tx = s.beginTransaction();
    Flight firstOne = new Flight();
    firstOne.setId( new Long( 1 ) );
    firstOne.setName( "AF0101" );
    firstOne.setDuration( new Long( 1000 ) );
    Company frenchOne = new Company();
    frenchOne.setName( "Air France" );
    firstOne.setCompany( frenchOne );
    s.persist( firstOne );
    tx.commit();
    s.close();
    assertNotNull( "identity id should work", frenchOne.getId() );

    s = openSession();
    tx = s.beginTransaction();
    firstOne = (Flight) s.get( Flight.class, new Long( 1 ) );
    assertNotNull( firstOne.getCompany() );
    assertEquals( frenchOne.getName(), firstOne.getCompany().getName() );
    tx.commit();
    s.close();
  }
View Full Code Here

    tx = s.beginTransaction();
    Flight firstOne = new Flight();
    firstOne.setId( new Long( 1 ) );
    firstOne.setName( "AF0101" );
    firstOne.setDuration( new Long( 1000 ) );
    Company frenchOne = new Company();
    frenchOne.setName( "Air France" );
    firstOne.setCompany( frenchOne );
    s.persist( firstOne );
    tx.commit();
    s.close();
    assertNotNull( "identity id should work", frenchOne.getId() );

    s = openSession();
    tx = s.beginTransaction();
    firstOne = (Flight) s.get( Flight.class, new Long( 1 ) );
    assertNotNull( firstOne.getCompany() );
    assertEquals( frenchOne.getName(), firstOne.getCompany().getName() );
    tx.commit();
    s.close();
  }
View Full Code Here

TOP

Related Classes of org.hibernate.test.annotations.Company

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.