Package org.hibernate

Examples of org.hibernate.ScrollableResults.beforeFirst()


      .setFetchSize( 10 )
      .setSort( sort )
      .scroll();
    scrollableResults.last();
    assertEquals( 132, scrollableResults.getRowNumber() );
    scrollableResults.beforeFirst();
    assertEquals( -1, scrollableResults.getRowNumber() );
    int position = scrollableResults.getRowNumber();
    while ( scrollableResults.next() ) {
      position++;
      Object[] objs = scrollableResults.get();
View Full Code Here


    query = parser.parse( "summary:Festina Or brand:Seiko" );
    hibQuery = fullTextSession.createFullTextQuery( query, Clock.class, Book.class );
    result = hibQuery.scroll();
    assertEquals( -1, 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

    Query query = parser.parse( "dept:ITech" );
    org.hibernate.search.FullTextQuery hibQuery = fullTextSession.createFullTextQuery( query, Employee.class );
    hibQuery.setProjection( "id", "lastname", "dept" );

    ScrollableResults projections = hibQuery.scroll();
    projections.beforeFirst();
    Object[] projection = projections.get();
    assertNull( projection );

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

    org.hibernate.search.FullTextQuery hibQuery = fullTextSession.createFullTextQuery( query, Employee.class );
    hibQuery.setProjection( "id", "lastname", "dept" );
    hibQuery.setFetchSize( 6 );

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

    tx.commit();
View Full Code Here

    hibQuery.setSort( new Sort( new SortField( "id", SortField.Type.STRING ) ) );
    hibQuery.setProjection( "id", "lastname", "dept" );
    hibQuery.setFetchSize( 3 );

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

    hibQuery.setFirstResult( 1 );
    hibQuery.setMaxResults( 3 );
    hibQuery.setSort( new Sort( new SortField( "id", SortField.Type.STRING ) ) );

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

    results.scroll( 2 );
View Full Code Here

    hibQuery.setFetchSize( 3 );
    hibQuery.setFirstResult( 1 );
    hibQuery.setMaxResults( 3 );

    ScrollableResults results = hibQuery.scroll();
    results.beforeFirst();
    Object[] result = results.get();
    assertNull( "non-null entity infos returned", result );

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

    org.hibernate.search.FullTextQuery hibQuery = fullTextSession.createFullTextQuery( query, Employee.class );
    hibQuery.setProjection( "id", "lastname", "dept" );


    ScrollableResults results = hibQuery.scroll();
    results.beforeFirst();
    results.next();
    assertTrue( "beforeFirst() pointer incorrect", results.isFirst() );

    results.afterLast();
    results.previous();
View Full Code Here

    Query query = parser.parse( "dept:XXX" );
    org.hibernate.search.FullTextQuery hibQuery = fullTextSession.createFullTextQuery( query, Employee.class );

    ScrollableResults projections = hibQuery.scroll();
    projections.beforeFirst();
    projections.next();
    Object[] projection = projections.get();
    assertNull( projection );

    hibQuery = fullTextSession.createFullTextQuery( query, Employee.class ).setFirstResult( 10 ).setMaxResults( 20 );
View Full Code Here

    assertNull( projection );

    hibQuery = fullTextSession.createFullTextQuery( query, Employee.class ).setFirstResult( 10 ).setMaxResults( 20 );

    projections = hibQuery.scroll();
    projections.beforeFirst();
    projections.next();
    projection = projections.get();
    assertNull( projection );

    tx.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.