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;
}
catch (RecognitionException e) {
throw new HibernateException( "Invalid query syntax", e );
}