Package org.hibernate

Examples of org.hibernate.ScrollableResults.scroll()


    results.scroll( -8 );
    result = results.get();
    assertNull( result );

    // And test a bad forward scroll.
    results.scroll( 10 );
    result = results.get();
    assertNull( result );

    //cleanup
    for (Object element : s.createQuery( "from " + Employee.class.getName() ).list()) s.delete( element );
View Full Code Here


    results.afterLast();
    results.previous();
    assertTrue("afterLast() pointer incorrect", results.isLast());

    // Let's see if a bad reverse scroll screws things up
    results.scroll( -8 );
    results.next();
    assertTrue("large negative scroll() pointer incorrect", results.isFirst());

    // And test a bad forward scroll.
    results.scroll( 10 );
View Full Code Here

    results.scroll( -8 );
    results.next();
    assertTrue("large negative scroll() pointer incorrect", results.isFirst());

    // And test a bad forward scroll.
    results.scroll( 10 );
    results.previous();
    assertTrue("large positive scroll() pointer incorrect", results.isLast());

    // Finally, let's test a REAL screwup.
    hibQuery.setFirstResult( 3 );
View Full Code Here

    projections.first();
    projection = projections.get();
    checkProjectionFirst( projection, s );

    projections.scroll( 2 );
    projection = projections.get();
    checkProjection2( projection, s );

    projections.scroll( -5 );
    projection = projections.get();
View Full Code Here

    projections.scroll( 2 );
    projection = projections.get();
    checkProjection2( projection, s );

    projections.scroll( -5 );
    projection = projections.get();
    assertNull( projection );

    //cleanup
    for ( Object element : s.createQuery( "from " + Employee.class.getName() ).list() ) {
View Full Code Here

    for ( int i=1; i<3; i++ ) {
      assertTrue( results.setRowNumber( 1 ) );
      assertTrue( results.isFirst() );
      assertTrue( results.isLast() );

      assertFalse( results.scroll( i ) );
      assertFalse( results.isFirst() );
      assertFalse( results.isLast() );

      assertTrue( results.setRowNumber( 1 ) );
      assertTrue( results.isFirst() );
View Full Code Here

      assertTrue( results.setRowNumber( 1 ) );
      assertTrue( results.isFirst() );
      assertTrue( results.isLast() );

      assertFalse( results.scroll( - i ) );
      assertFalse( results.isFirst() );
      assertFalse( results.isLast() );

      if ( i != 1 ) {
        assertFalse( results.setRowNumber( i ) );
View Full Code Here

    results.first();
    Animal animal = ( Animal ) results.get( 0 );
    assertEquals( "first() did not return expected row", data.root1Id, animal.getId() );

    results.scroll( 1 );
    animal = ( Animal ) results.get( 0 );
    assertEquals( "scroll(1) did not return expected row", data.root2Id, animal.getId() );

    results.scroll( -1 );
    animal = ( Animal ) results.get( 0 );
View Full Code Here

    results.scroll( 1 );
    animal = ( Animal ) results.get( 0 );
    assertEquals( "scroll(1) did not return expected row", data.root2Id, animal.getId() );

    results.scroll( -1 );
    animal = ( Animal ) results.get( 0 );
    assertEquals( "scroll(-1) did not return expected row", data.root1Id, animal.getId() );

    results.setRowNumber( 1 );
    animal = ( Animal ) results.get( 0 );
View Full Code Here

      ScrollableResults iter = query.scroll();
      assertTrue( iter.next() );
      assertTrue( iter.scroll(1) );
      FooProxy f2 = (FooProxy) iter.get()[0];
      assertTrue( f2!=null );
      assertTrue( iter.scroll(-1) );
      Object f1 = iter.get(0);
      iter.next();
      assertTrue( f1!=null && iter.get(0)==f2 );
      iter.getInteger(1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.