[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-773) Example in documentation contains compilation erros

Sanne Grinovero (JIRA) noreply at atlassian.com
Fri Aug 5 09:34:05 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43181#comment-43181 ] 

Sanne Grinovero commented on HSEARCH-773:
-----------------------------------------

Nabeel, when are you going to create a pull request for this one?
We need to push 4.0 forward, and as soon as you finish this one if you want you can take a more interesting issue :)

Let me know if you need some pointers or help to setup the project/git.

> Example in documentation contains compilation erros
> ---------------------------------------------------
>
>                 Key: HSEARCH-773
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-773
>             Project: Hibernate Search
>          Issue Type: Improvement
>            Reporter: Juraj Martinka
>            Assignee: Nabeel Ali memon
>             Fix For: 4.0.0.Alpha1
>
>
> "Example 1.9. Using JPA to create and execute a search" contains compilation errors (probably copy & paste error :) ):
> http://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single/#d0e384
> The correct version follows:
> {code}
> EntityManager em = entityManagerFactory.createEntityManager();
> FullTextEntityManager fullTextEntityManager =
>     org.hibernate.search.jpa.Search.getFullTextEntityManager(em);
> em.getTransaction().begin();
> // create native Lucene query unsing the query DSL
> // alternatively you can write the Lucene query using the Lucene query parser
> // or the Lucene programmatic API. The Hibernate Search DSL is recommended though
> QueryBuilder qb = em.getSearchFactory()
>     .buildQueryBuilder().forEntity( Book.class ).get();
> org.apache.lucene.search.Query query = qb
>   .keyword()
>   .onFields("title", "subtitle", "authors.name", "publicationDate")
>   .matching("Java rocks!")
>   .createQuery();
> // wrap Lucene query in a javax.persistence.Query
> javax.persistence.Query persistenceQuery =
>     fullTextEntityManager.createFullTextQuery(query, Book.class);
> // execute search
> List result = persistenceQuery.getResultList();
> em.getTransaction().commit();
> em.close();
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list