Package org.hibernate

Examples of org.hibernate.ScrollableResults.scroll()


    results.beforeFirst();
    results.next();
    Object[] result = results.get();
    assertEquals( "incorrect entityInfo returned", 1002, result[0] );

    results.scroll( 2 );
    result = results.get();
    assertEquals( "incorrect entityInfo returned", 1004, result[0] );

    results.next();
    result = results.get();
View Full Code Here


    results.next();
    result = results.get();
    assertNull( result );

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

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

    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

    result = hibQuery.scroll();
    assertEquals( 0, result.getRowNumber() );
    result.beforeFirst();
    assertEquals( true, result.next() );
    assertTrue( result.isFirst() );
    assertTrue( result.scroll( 1 ) );
    assertTrue( result.isLast() );
    assertFalse( result.scroll( 1 ) );
    result.beforeFirst();
    while ( result.next() ) {
      s.delete( result.get()[0] );
View Full Code Here

    result.beforeFirst();
    assertEquals( true, result.next() );
    assertTrue( result.isFirst() );
    assertTrue( result.scroll( 1 ) );
    assertTrue( result.isLast() );
    assertFalse( result.scroll( 1 ) );
    result.beforeFirst();
    while ( result.next() ) {
      s.delete( result.get()[0] );
    }
    for (Object element : s.createQuery( "from java.lang.Object" ).list()) s.delete( element );
View Full Code Here

                  info.setPagingPage(pageNumber);
               }
            }
            if (pageNumber > 1)
            {
               isResult = results.scroll((pageNumber - 1) * numberPerPage - lastRowNumber);
            }
            else
            {
               isResult = results.first();
            }
View Full Code Here

    ScrollableResults results = hibQuery.scroll();
    results.beforeFirst();
    results.next();
    Object[] result = results.get();
    assertEquals( "incorrect entityInfo returned", 1000, result[0] );
    results.scroll( 2 );
    result = results.get();
    assertEquals( "incorrect entityInfo returned", 1003, result[0] );
    // check cache addition
    results.next();
    result = results.get();
View Full Code Here

    // check cache addition
    results.next();
    result = results.get();
    assertEquals( "incorrect entityInfo returned", 1004, result[0] );

    results.scroll( -2 );
    result = results.get();
    assertEquals( "incorrect entityInfo returned", 1002, result[0] );

    //cleanup
    for (Object element : s.createQuery( "from " + Employee.class.getName() ).list()) s.delete( element );
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.