Package org.hibernate

Examples of org.hibernate.ScrollableResults.beforeFirst()


    assertFieldSelectorDisabled(); //because of DOCUMENT being projected

    // There are a lot of methods to check in ScrollableResultsImpl
    // so, we'll use methods to check each projection as needed.

    projections.beforeFirst();
    projections.next();
    Object[] projection = projections.get();
    checkProjectionFirst( projection, s );
    assertTrue( projections.isFirst() );
View Full Code Here


    hibQuery.setProjection( FullTextQuery.THIS, FullTextQuery.DOCUMENT );

    ScrollableResults projections = hibQuery.scroll();
    assertNotNull( projections );

    projections.beforeFirst();
    projections.next();
    Object[] projection = projections.get();

    assertTrue( "DOCUMENT incorrect", projection[0] instanceof Departments );
    assertEquals( "id incorrect", 1, ((Departments)projection[0]).getId() );
View Full Code Here

    query = parser.parse( "summary:Festina Or brand:Seiko" );
    hibQuery = s.createFullTextQuery( query, Clock.class, Book.class );
    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 ) );
View Full Code Here

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

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

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

    assertFalse( results.first() );
View Full Code Here

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

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

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