Package org.hibernate.search

Examples of org.hibernate.search.FullTextQuery.initializeObjectsWith()


    FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery( parsingResult.getQuery(), parsingResult.getTargetEntity() );
    fullTextQuery.setProjection( parsingResult.getProjections().toArray( new String[parsingResult.getProjections().size()] ) );

    // 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;
  }

  private LuceneProcessingChain createProcessingChain(Session session, Map<String, Object> namedParameters, FullTextSession fullTextSession) {
    EntityNamesResolver entityNamesResolver = getDefinedEntityNames( session.getSessionFactory() );
View Full Code Here


    FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery( parsingResult.getQuery(), parsingResult.getTargetEntity() );
    fullTextQuery.setProjection( parsingResult.getProjections().toArray( new String[parsingResult.getProjections().size()] ) );

    // 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;
  }

  private LuceneProcessingChain createProcessingChain(Session session, Map<String, Object> namedParameters, FullTextSession fullTextSession) {
    EntityNamesResolver entityNamesResolver = getDefinedEntityNames( session.getSessionFactory() );
View Full Code Here

    page.setCount(fullTextQuery.getResultSize());
    fullTextQuery.setFirstResult(page.getFirstResult());
    fullTextQuery.setMaxResults(page.getMaxResults());

    // 先从持久化上下文中查找对象,如果没有再从二级缓存中查找
        fullTextQuery.initializeObjectsWith(ObjectLookupMethod.SECOND_LEVEL_CACHE, DatabaseRetrievalMethod.QUERY);
       
    // 返回结果
    page.setList(fullTextQuery.list());
       
    return page;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.