[hibernate-commits] Hibernate SVN: r15845 - in search/trunk: src/java/org/hibernate/search/jpa and 1 other directory.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Sun Feb 1 18:25:09 EST 2009


Author: sannegrinovero
Date: 2009-02-01 18:25:06 -0500 (Sun, 01 Feb 2009)
New Revision: 15845

Modified:
   search/trunk/doc/reference/en/modules/getting-started.xml
   search/trunk/src/java/org/hibernate/search/jpa/FullTextQuery.java
Log:
HSEARCH-332 and some other JPA/hibernate mismatch related documentation fixes

Modified: search/trunk/doc/reference/en/modules/getting-started.xml
===================================================================
--- search/trunk/doc/reference/en/modules/getting-started.xml	2009-02-01 13:27:58 UTC (rev 15844)
+++ search/trunk/doc/reference/en/modules/getting-started.xml	2009-02-01 23:25:06 UTC (rev 15845)
@@ -477,7 +477,7 @@
 // create native Lucene query
 String[] fields = new String[]{"title", "subtitle", "authors.name", "publicationDate"};
 MultiFieldQueryParser parser = new MultiFieldQueryParser(fields, new StandardAnalyzer());
-Query query = parser.parse( "Java rocks!" );
+org.apache.lucene.search.Query query = parser.parse( "Java rocks!" );
 
 // wrap Lucene query in a org.hibernate.Query
 org.hibernate.Query hibQuery = fullTextSession.createFullTextQuery(query, Book.class);
@@ -502,18 +502,17 @@
 // create native Lucene query
 String[] fields = new String[]{"title", "subtitle", "authors.name", "publicationDate"};
 MultiFieldQueryParser parser = new MultiFieldQueryParser(fields, new StandardAnalyzer());
-Query query = parser.parse( "Java rocks!" );
+org.apache.lucene.search.Query query = parser.parse( "Java rocks!" );
 
-// wrap Lucene query in a org.hibernate.Query
-org.hibernate.Query hibQuery = fullTextEntityManager.createFullTextQuery(query, Book.class);
+// wrap Lucene query in a javax.persistence.Query
+javax.persistence.Query persistenceQuery = fullTextEntityManager.createFullTextQuery(query, Book.class);
 
 // execute search
-List result = hibQuery.list();
+List result = persistenceQuery.getResultList();
 
 em.getTransaction().commit();
 em.close();
 
-
     </programlisting>
     </example>
   </section>

Modified: search/trunk/src/java/org/hibernate/search/jpa/FullTextQuery.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/jpa/FullTextQuery.java	2009-02-01 13:27:58 UTC (rev 15844)
+++ search/trunk/src/java/org/hibernate/search/jpa/FullTextQuery.java	2009-02-01 23:25:06 UTC (rev 15845)
@@ -46,8 +46,8 @@
 	 *
 	 * Caution:
 	 * The number of results might be slightly different from
-	 * <code>list().size()</code> because list() if the index is
-	 * not in sync with the database at the time of query.
+	 * <code>getResultList().size()</code> because getResultList()
+	 * may be not in sync with the database at the time of query.
 	 */
 	int getResultSize();
 




More information about the hibernate-commits mailing list