Package com.foreach.across.test.modules.hibernate1

Examples of com.foreach.across.test.modules.hibernate1.Hibernate1Module


      return acrossContext;
    }

    @Bean
    public Hibernate1Module hibernate1Module() {
      return new Hibernate1Module();
    }
View Full Code Here


  @Test
  public void singleModuleTransactional() {
    assertNull( productRepository.getProductWithId( 1 ) );

    Product product = new Product( 1, "product 1" );
    productRepository.save( product );

    closeSession();
    openSession();

    Product other = productRepository.getProductWithId( 1 );
    assertNotNull( other );
    assertEquals( product, other );
  }
View Full Code Here

    assertEquals( user, other );
  }

  @Test
  public void combinedSave() {
    Product product = new Product( 2, "product 2" );
    User user = new User( 2, "user 2" );

    userRepository.save( user, product );

    closeSession();
    openSession();

    User otherUser = userRepository.getUserWithId( 2 );
    assertNotNull( otherUser );
    assertEquals( user, otherUser );

    Product otherProduct = productRepository.getProductWithId( 2 );
    assertNotNull( otherProduct );
    assertEquals( product, otherProduct );
  }
View Full Code Here

    assertEquals( product, otherProduct );
  }

  @Test
  public void combinedRollback() {
    Product product = new Product( 3, "product 3" );

    boolean failed = false;

    try {
      userRepository.save( null, product );
    }
    catch ( Exception e ) {
      failed = true;
    }

    assertTrue( failed );

    closeSession();
    openSession();

    Product otherProduct = productRepository.getProductWithId( 3 );
    assertNull( otherProduct );
  }
View Full Code Here

TOP

Related Classes of com.foreach.across.test.modules.hibernate1.Hibernate1Module

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.