[hibernate-commits] Hibernate SVN: r11577 - in trunk/HibernateExt/search/src: java/org/hibernate/search/query and 2 other directories.
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Sun May 27 22:38:03 EDT 2007
Author: epbernard
Date: 2007-05-27 22:38:03 -0400 (Sun, 27 May 2007)
New Revision: 11577
Modified:
trunk/HibernateExt/search/src/java/org/hibernate/search/FullTextQuery.java
trunk/HibernateExt/search/src/java/org/hibernate/search/query/FullTextQueryImpl.java
trunk/HibernateExt/search/src/test/org/hibernate/search/test/query/LuceneQueryTest.java
trunk/HibernateExt/search/src/test/org/hibernate/search/test/reader/ReaderPerfTestCase.java
Log:
HSEARCH-63 rename query.getResultSize() method
Modified: trunk/HibernateExt/search/src/java/org/hibernate/search/FullTextQuery.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/FullTextQuery.java 2007-05-28 02:31:11 UTC (rev 11576)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/FullTextQuery.java 2007-05-28 02:38:03 UTC (rev 11577)
@@ -35,7 +35,7 @@
* <code>list().size()</code> because list() if the index is
* not in sync with the database at the time of query.
*/
- int resultSize();
+ int getResultSize();
/**
* Defines the Database Query used to load the Lucene results.
Modified: trunk/HibernateExt/search/src/java/org/hibernate/search/query/FullTextQueryImpl.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/query/FullTextQueryImpl.java 2007-05-28 02:31:11 UTC (rev 11576)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/query/FullTextQueryImpl.java 2007-05-28 02:38:03 UTC (rev 11577)
@@ -338,7 +338,7 @@
}
- public int resultSize() {
+ public int getResultSize() {
if (resultSize == null) {
//get result size without object initialization
SearchFactory searchFactory = ContextHelper.getSearchFactoryBySFI( session );
Modified: trunk/HibernateExt/search/src/test/org/hibernate/search/test/query/LuceneQueryTest.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/query/LuceneQueryTest.java 2007-05-28 02:31:11 UTC (rev 11576)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/query/LuceneQueryTest.java 2007-05-28 02:38:03 UTC (rev 11577)
@@ -100,7 +100,7 @@
boolean enabled = stats.isStatisticsEnabled();
if (!enabled) stats.setStatisticsEnabled( true );
FullTextQuery hibQuery = s.createFullTextQuery( query, Clock.class, Book.class );
- assertEquals( "Exection of resultSize without actual results", 2, hibQuery.resultSize() );
+ assertEquals( "Exection of getResultSize without actual results", 2, hibQuery.getResultSize() );
assertEquals( "No entity should be loaded", 0, stats.getEntityLoadCount() );
query = parser.parse( "summary:Festina Or brand:Seiko" );
Modified: trunk/HibernateExt/search/src/test/org/hibernate/search/test/reader/ReaderPerfTestCase.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/reader/ReaderPerfTestCase.java 2007-05-28 02:31:11 UTC (rev 11576)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/reader/ReaderPerfTestCase.java 2007-05-28 02:38:03 UTC (rev 11577)
@@ -8,15 +8,11 @@
import java.util.List;
import org.hibernate.search.test.SearchTestCase;
-import org.hibernate.search.test.worker.Employee;
-import org.hibernate.search.test.worker.Employer;
-import org.hibernate.search.FullTextSession;
import org.hibernate.search.Environment;
import org.hibernate.search.Search;
import org.hibernate.search.FullTextQuery;
import org.hibernate.search.event.FullTextIndexEventListener;
import org.hibernate.search.store.FSDirectoryProvider;
-import org.hibernate.search.impl.FullTextSessionImpl;
import org.hibernate.SessionFactory;
import org.hibernate.Session;
import org.hibernate.Transaction;
@@ -138,11 +134,11 @@
new String[] {"name", "physicalDescription", "suspectCharge"},
new StandardAnalyzer() );
FullTextQuery query = getQuery( "John Doe", parser, s );
- assertTrue( query.resultSize() != 0 );
+ assertTrue( query.getResultSize() != 0 );
query = getQuery( "green", parser, s );
- random.nextInt( query.resultSize() - 15 );
- query.setFirstResult( random.nextInt( query.resultSize() - 15 ) );
+ random.nextInt( query.getResultSize() - 15 );
+ query.setFirstResult( random.nextInt( query.getResultSize() - 15 ) );
query.setMaxResults( 10 );
query.list();
tx.commit();
@@ -152,10 +148,10 @@
tx = s.beginTransaction();
query = getQuery( "John Doe", parser, s );
- assertTrue( query.resultSize() != 0 );
+ assertTrue( query.getResultSize() != 0 );
query = getQuery( "thief", parser, s );
- int firstResult = random.nextInt( query.resultSize() - 15 );
+ int firstResult = random.nextInt( query.getResultSize() - 15 );
query.setFirstResult( firstResult );
query.setMaxResults( 10 );
List result = query.list();
@@ -200,11 +196,11 @@
new String[] {"name", "physicalDescription", "suspectCharge"},
new StandardAnalyzer() );
FullTextQuery query = getQuery( "John Doe", parser, s );
- assertTrue( query.resultSize() != 0 );
+ assertTrue( query.getResultSize() != 0 );
query = getQuery( "london", parser, s );
- random.nextInt( query.resultSize() - 15 );
- query.setFirstResult( random.nextInt( query.resultSize() - 15 ) );
+ random.nextInt( query.getResultSize() - 15 );
+ query.setFirstResult( random.nextInt( query.getResultSize() - 15 ) );
query.setMaxResults( 10 );
query.list();
tx.commit();
@@ -214,11 +210,11 @@
tx = s.beginTransaction();
getQuery( "John Doe", parser, s );
- assertTrue( query.resultSize() != 0 );
+ assertTrue( query.getResultSize() != 0 );
query = getQuery( "green", parser, s );
- random.nextInt( query.resultSize() - 15 );
- query.setFirstResult( random.nextInt( query.resultSize() - 15 ) );
+ random.nextInt( query.getResultSize() - 15 );
+ query.setFirstResult( random.nextInt( query.getResultSize() - 15 ) );
query.setMaxResults( 10 );
query.list();
tx.commit();
More information about the hibernate-commits
mailing list