本文整理了Java中org.hibernate.ScrollableResults.isFirst()
方法的一些代码示例,展示了ScrollableResults.isFirst()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ScrollableResults.isFirst()
方法的具体详情如下:
包路径:org.hibernate.ScrollableResults
类名称:ScrollableResults
方法名:isFirst
[英]Is this the first result?
[中]这是第一个结果吗?
代码示例来源:origin: hibernate/hibernate-orm
assertFalse( results.isFirst() );
assertFalse( results.isLast() );
assertFalse( results.isFirst() );
assertFalse( results.isLast() );
assertFalse( results.isFirst() );
assertFalse( results.isLast() );
assertFalse( results.isFirst() );
assertFalse( results.isLast() );
assertFalse( results.next() );
assertFalse( results.isFirst() );
assertFalse( results.isLast() );
assertFalse( results.next() );
assertFalse( results.isFirst() );
assertFalse( results.isLast() );
assertFalse( results.next() );
assertFalse( results.isFirst() );
assertFalse( results.isLast() );
assertFalse( results.next() );
assertFalse( results.isFirst() );
assertFalse( results.isLast() );
assertFalse( results.isFirst() );
代码示例来源:origin: hibernate/hibernate-orm
assertFalse( results.isFirst() );
assertFalse( results.isLast() );
assertFalse( results.previous() );
assertTrue( results.isFirst() );
assertTrue( results.isLast() );
assertFalse( results.isFirst() );
assertFalse( results.isLast() );
assertTrue( results.isFirst() );
assertTrue( results.isLast() );
assertFalse( results.isFirst() );
assertFalse( results.isLast() );
assertTrue( results.isFirst() );
assertTrue( results.isLast() );
assertFalse( results.isFirst() );
assertFalse( results.isLast() );
assertFalse( results.previous() );
assertTrue( results.isFirst() );
assertTrue( results.isLast() );
assertFalse( results.next() );
assertFalse( results.isFirst() );
assertFalse( results.isLast() );
代码示例来源:origin: com.atlassian.hibernate/hibernate.adapter
@Override
public boolean isFirst() throws HibernateException {
try {
return results.isFirst();
} catch (final PersistenceException ex) {
throw HibernateExceptionAdapter.adapt(ex);
}
}
代码示例来源:origin: hibernate/hibernate-search
@Test
public void testDefaultFetchSize() throws Exception {
FullTextSession fullTextSession = Search.getFullTextSession( openSession() );
Transaction tx = fullTextSession.beginTransaction();
QueryParser parser = new QueryParser( "dept", TestConstants.standardAnalyzer );
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() );
tx.commit();
fullTextSession.close();
}
代码示例来源:origin: hibernate/hibernate-search
results.beforeFirst();
results.next();
assertTrue( "beforeFirst() pointer incorrect", results.isFirst() );
assertTrue( "large negative scroll() pointer incorrect", results.isFirst() );
代码示例来源:origin: hibernate/hibernate-search
@Test
public void testScrollableResultSet() throws Exception {
FullTextSession fullTextSession = Search.getFullTextSession( openSession() );
Transaction tx = fullTextSession.beginTransaction();
QueryParser parser = new QueryParser( "title", TestConstants.stopAnalyzer );
Query query = parser.parse( "summary:noword" );
org.hibernate.query.Query hibQuery = fullTextSession.createFullTextQuery( query, Clock.class, Book.class );
ScrollableResults result = hibQuery.scroll();
assertNotNull( result );
assertEquals( -1, result.getRowNumber() );
assertEquals( false, result.next() );
result.close();
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 ) );
tx.commit();
fullTextSession.close();
}
代码示例来源:origin: hibernate/hibernate-search
Object[] projection = projections.get();
checkProjectionFirst( projection, s );
assertTrue( projections.isFirst() );
内容来源于网络,如有侵权,请联系作者删除!