Package org.hibernate.test.annotations

Examples of org.hibernate.test.annotations.Country


  }

  public void testAttributedJoin() throws Exception {
    Session s = openSession();
    s.getTransaction().begin();
    Country country = new Country();
    country.setName( "Australia" );
    s.persist( country );

    Boy boy = new Boy();
    boy.setFirstName( "John" );
    boy.setLastName( "Doe" );
    CountryAttitude attitude = new CountryAttitude();
    // TODO: doesn't work
    attitude.setBoy( boy );
    attitude.setCountry( country );
    attitude.setLikes( true );
    boy.getCountryAttitudes().add( attitude );
    s.persist( boy );
    s.getTransaction().commit();
    s.clear();

    Transaction tx = s.beginTransaction();
    boy = (Boy) s.get( Boy.class, boy.getId() );
    assertTrue( boy.getCountryAttitudes().contains( attitude ) );
    s.delete( boy );
    s.delete( s.get( Country.class, country.getId() ) );
    tx.commit();
    s.close();

  }
View Full Code Here


  }

  public void testAttributedJoin() throws Exception {
    Session s = openSession();
    s.getTransaction().begin();
    Country country = new Country();
    country.setName( "Australia" );
    s.persist( country );

    Boy boy = new Boy();
    boy.setFirstName( "John" );
    boy.setLastName( "Doe" );
    CountryAttitude attitude = new CountryAttitude();
    // TODO: doesn't work
    attitude.setBoy( boy );
    attitude.setCountry( country );
    attitude.setLikes( true );
    boy.getCountryAttitudes().add( attitude );
    s.persist( boy );
    s.getTransaction().commit();
    s.clear();

    Transaction tx = s.beginTransaction();
    boy = (Boy) s.get( Boy.class, boy.getId() );
    assertTrue( boy.getCountryAttitudes().contains( attitude ) );
    s.delete( boy );
    s.delete( s.get( Country.class, country.getId() ) );
    tx.commit();
    s.close();

  }
View Full Code Here

  }

  public void testAttributedJoin() throws Exception {
    Session s = openSession();
    s.getTransaction().begin();
    Country country = new Country();
    country.setName( "Australia" );
    s.persist( country );

    Boy boy = new Boy();
    boy.setFirstName( "John" );
    boy.setLastName( "Doe" );
    CountryAttitude attitude = new CountryAttitude();
    // TODO: doesn't work
    attitude.setBoy( boy );
    attitude.setCountry( country );
    attitude.setLikes( true );
    boy.getCountryAttitudes().add( attitude );
    s.persist( boy );
    s.getTransaction().commit();
    s.clear();

    Transaction tx = s.beginTransaction();
    boy = (Boy) s.get( Boy.class, boy.getId() );
    assertTrue( boy.getCountryAttitudes().contains( attitude ) );
    s.delete( boy );
    s.delete( s.get( Country.class, country.getId() ) );
    tx.commit();
    s.close();

  }
View Full Code Here

  }

  public void testAttributedJoin() throws Exception {
    Session s = openSession();
    s.getTransaction().begin();
    Country country = new Country();
    country.setName( "Australia" );
    s.persist( country );

    Boy boy = new Boy();
    boy.setFirstName( "John" );
    boy.setLastName( "Doe" );
    CountryAttitude attitude = new CountryAttitude();
    // TODO: doesn't work
    attitude.setBoy( boy );
    attitude.setCountry( country );
    attitude.setLikes( true );
    boy.getCountryAttitudes().add( attitude );
    s.persist( boy );
    s.getTransaction().commit();
    s.clear();

    Transaction tx = s.beginTransaction();
    boy = (Boy) s.get( Boy.class, boy.getId() );
    assertTrue( boy.getCountryAttitudes().contains( attitude ) );
    s.delete( boy );
    s.delete( s.get( Country.class, country.getId() ) );
    tx.commit();
    s.close();

  }
View Full Code Here

  }

  public void testAttributedJoin() throws Exception {
    Session s = openSession();
    s.getTransaction().begin();
    Country country = new Country();
    country.setName( "Australia" );
    s.persist( country );

    Boy boy = new Boy();
    boy.setFirstName( "John" );
    boy.setLastName( "Doe" );
    CountryAttitude attitude = new CountryAttitude();
    // TODO: doesn't work
    attitude.setBoy( boy );
    attitude.setCountry( country );
    attitude.setLikes( true );
    boy.getCountryAttitudes().add( attitude );
    s.persist( boy );
    s.getTransaction().commit();
    s.clear();

    Transaction tx = s.beginTransaction();
    boy = (Boy) s.get( Boy.class, boy.getId() );
    assertTrue( boy.getCountryAttitudes().contains( attitude ) );
    s.delete( boy );
    s.delete( s.get( Country.class, country.getId() ) );
    tx.commit();
    s.close();

  }
View Full Code Here

TOP

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

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.