Package org.hibernate

Examples of org.hibernate.ScrollableResults.previous()


    assertTrue( results.previous() );
    assertTrue( results.isFirst() );
    assertTrue( results.isLast() );

    assertFalse( results.previous() );
    assertFalse( results.isFirst() );
    assertFalse( results.isLast() );

    assertTrue( results.next() );
    assertTrue( results.isFirst() );
View Full Code Here


    assertTrue( results.isLast() );

    results.beforeFirst();
    assertFalse( results.isFirst() );
    assertFalse( results.isLast() );
    assertFalse( results.previous() );

    assertTrue( results.first() );
    assertTrue( results.isFirst() );
    assertTrue( results.isLast() );
    assertFalse( results.next() );
View Full Code Here

    results.beforeFirst();
    results.next();
    assertTrue("beforeFirst() pointer incorrect", results.isFirst());

    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();
View Full Code Here

    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 );
    hibQuery.setMaxResults( 1 );
View Full Code Here

    assertTrue( !iter.next() );
    assertTrue( iter.first() );
    assertTrue( iter.get(0)==f1 );
    assertTrue( iter.last() );
    assertTrue( iter.get(0)==f4 );
    assertTrue( iter.previous() );
    txn.commit();
    s.close();

    s = openSession();
    txn = s.beginTransaction();
View Full Code Here

    assertTrue( !iter.next() );
    assertTrue( iter.first() );
    assertTrue( iter.get(0)==f1 );
    assertTrue( iter.last() );
    assertTrue( iter.get(0)==f4 );
    assertTrue( iter.previous() );
    assertTrue( s.delete("from Foo")==4 );
    s.flush();
    assertTrue( s.find("from java.lang.Object").size()==0 );
    txn.commit();
    s.close();
View Full Code Here

    projections.next();
    projection = projections.get();
    assertNull( projection );

    projections.previous();
    projection = projections.get();
    checkProjectionLast( projection, s );

    projections.first();
    projection = projections.get();
View Full Code Here

    results.beforeFirst();
    results.next();
    assertTrue("beforeFirst() pointer incorrect", results.isFirst());

    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();
View Full Code Here

    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 );
    hibQuery.setMaxResults( 1 );
View Full Code Here

    results.beforeFirst();
    results.next();
    assertTrue("beforeFirst() pointer incorrect", results.isFirst());

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