Package org.hibernate

Examples of org.hibernate.ScrollableResults.scroll()


    result.beforeFirst();
    assertEquals( true, result.next() );
    assertTrue( result.isFirst() );
    assertTrue( result.scroll( 1 ) );
    assertTrue( result.isLast() );
    assertFalse( result.scroll( 1 ) );

    tx.commit();
    fullTextSession.close();
  }
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] );

    tx.commit();
    fullTextSession.close();
View Full Code Here

    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 );

    tx.commit();
    fullTextSession.close();
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

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.