Package org.hibernate.sql.ast.origin.hql.resolve

Examples of org.hibernate.sql.ast.origin.hql.resolve.LuceneJPQLWalker


      treeStream.setTokenStream( tokens );
      EntityNamesResolver entityNamesResolver = getDefinedEntityNames( session.getSessionFactory() );
      FullTextSession fullTextSession = Search.getFullTextSession( session );
      SearchFactoryImplementor searchFactory = (SearchFactoryImplementor) fullTextSession.getSearchFactory();
      // Finally create the treewalker:
      LuceneJPQLWalker walker = new LuceneJPQLWalker( treeStream, searchFactory, entityNamesResolver, namedParameters );
      walker.statement();
      org.apache.lucene.search.Query luceneQuery = walker.getLuceneQuery();
      Class targetEntity = walker.getTargetEntity();
      FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery( luceneQuery, targetEntity );
      //Following options are mandatory to load matching entities without using a query
      //(chicken and egg problem)
      fullTextQuery.initializeObjectsWith( ObjectLookupMethod.SKIP, DatabaseRetrievalMethod.FIND_BY_ID );
      return fullTextQuery;
View Full Code Here

TOP

Related Classes of org.hibernate.sql.ast.origin.hql.resolve.LuceneJPQLWalker

Copyright © 2018 www.massapicom. 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.