Package org.hibernate

Examples of org.hibernate.ScrollableResults.beforeFirst()


    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

            if (LOGGER.isDebugEnabled())
            {
               LOGGER.debug("Start to focusing adapterName '" + name + "', ValueListInfo info = " + info + "'");
            }
            ScrollableResults results = getScrollableResults(getQueryForFocus(info, session), info);
            results.beforeFirst();
            doFocusFor(info, results);

            if (LOGGER.isDebugEnabled())
            {
               LOGGER.debug("Focusing finished for adapterName '" + name + "', ValueListInfo info '" + info + "'");
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

    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

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

    //cleanup
    for (Object element : s.createQuery( "from " + Employee.class.getName() ).list()) s.delete( element );
View Full Code Here

    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 = s.createFullTextQuery( query, Employee.class );

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

    hibQuery = s.createFullTextQuery( query, Employee.class ).setFirstResult( 10 ).setMaxResults( 20 );
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.