Package org.hibernate

Examples of org.hibernate.ScrollableResults.beforeFirst()


    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

          channelUpdate.executeUpdate();
          HhStartDate groupFinish = groupStart;
          HhStartDate estStart = null;
          HhStartDate estFinish = null;

          hhData.beforeFirst();
          while (hhData.next()) {
            HhStartDate hhStartDate = (HhStartDate) hhData.get(0);
            if (groupFinish.getNext().before(hhStartDate)) {
              targetChannel.deleteSnag(ChannelSnag.SNAG_MISSING,
                  groupStart, groupFinish);
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( -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

    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

    Query query = parser.parse( "dept:ITech" );
    org.hibernate.search.FullTextQuery hibQuery = s.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 = s.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] );

    //cleanup
View Full Code Here

    org.hibernate.search.FullTextQuery hibQuery = s.createFullTextQuery( query, Employee.class );
    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.setFetchSize( 3 );
    hibQuery.setFirstResult( 1 );
    hibQuery.setMaxResults( 3 );

    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

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.