Package org.hibernate

Examples of org.hibernate.ScrollableResults.first()


            {
               isResult = results.scroll((pageNumber - 1) * numberPerPage - lastRowNumber);
            }
            else
            {
               isResult = results.first();
            }

            for (int i = 0; i < numberPerPage && isResult; i++)
            {
               list.add(results.get(0));
View Full Code Here


    // Finally, let's test a REAL screwup.
    hibQuery.setFirstResult( 3 );
    hibQuery.setMaxResults( 1 );

    results = hibQuery.scroll();
    results.first();
    Object[] result = results.get();
    assertEquals(1004, result[0]);

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

    assertFalse( it.hasNext() );

    query = parser.parse( "summary:Festina" );
    hibQuery = s.createFullTextQuery( query, Clock.class, Book.class );
    ScrollableResults sr = hibQuery.scroll();
    assertTrue( sr.first() );
    assertNotNull( sr.get() );
    assertFalse( sr.next() );
    sr.close();

    query = parser.parse( "summary:Festina OR brand:seiko" );
View Full Code Here

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

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

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

    // Finally, let's test a REAL screwup.
    hibQuery.setFirstResult( 3 );
    hibQuery.setMaxResults( 1 );

    results = hibQuery.scroll();
    results.first();
    Object[] result = results.get();
    assertEquals( 1004, result[0] );

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

    assertFalse( it.hasNext() );

    query = parser.parse( "summary:Festina" );
    hibQuery = fullTextSession.createFullTextQuery( query, Clock.class, Book.class );
    ScrollableResults sr = hibQuery.scroll();
    assertTrue( sr.first() );
    assertNotNull( sr.get() );
    assertFalse( sr.next() );
    sr.close();

    query = parser.parse( "summary:Festina OR brand:seiko" );
View Full Code Here

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

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

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

    assertFalse( it.hasNext() );

    query = parser.parse( "summary:Festina" );
    hibQuery = s.createFullTextQuery( query, Clock.class, Book.class );
    ScrollableResults sr = hibQuery.scroll();
    assertTrue( sr.first() );
    assertNotNull( sr.get() );
    assertFalse( sr.next() );
    sr.close();

    query = parser.parse( "summary:Festina OR brand:seiko" );
View Full Code Here

    iter.next();
    assertTrue( f1!=null && iter.get(0)==f2 );
    iter.getInteger(1);

    assertTrue( !iter.scroll(100) );
    assertTrue( iter.first() );
    assertTrue( iter.scroll(3) );
    Object f4 = iter.get(0);
    assertTrue( f4!=null );
    assertTrue( !iter.next() );
    assertTrue( iter.first() );
View Full Code Here

    assertTrue( iter.first() );
    assertTrue( iter.scroll(3) );
    Object f4 = iter.get(0);
    assertTrue( f4!=null );
    assertTrue( !iter.next() );
    assertTrue( iter.first() );
    assertTrue( iter.get(0)==f1 );
    assertTrue( iter.last() );
    assertTrue( iter.get(0)==f4 );
    assertTrue( iter.previous() );
    txn.commit();
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.