Package org.hibernate.search.impl

Examples of org.hibernate.search.impl.SearchFactoryImpl


    WeakHashMap<Configuration, SearchFactoryImpl> contextMap = contexts.get();
    if ( contextMap == null ) {
      contextMap = new WeakHashMap<Configuration, SearchFactoryImpl>( 2 );
      contexts.set( contextMap );
    }
    SearchFactoryImpl searchFactory = contextMap.get( cfg );
    if ( searchFactory == null ) {
      searchFactory = new SearchFactoryImpl( new SearchConfigurationFromHibernateCore( cfg ) );
      contextMap.put( cfg, searchFactory );
    }
    return searchFactory;
  }
View Full Code Here


   * @throws Exception in case the test fails.
   */
  @SuppressWarnings( "unchecked" )
  public void testAddWorkGetReplacedByDeleteWork() throws Exception {
    FullTextSession fullTextSession = org.hibernate.search.Search.getFullTextSession( openSession() );
    SearchFactoryImpl searchFactory = ( SearchFactoryImpl ) fullTextSession.getSearchFactory();
    DocumentBuilderIndexedEntity builder = searchFactory.getDocumentBuilderIndexedEntity( SpecialPerson.class );

    // create test entity
    SpecialPerson person = new SpecialPerson();
    person.setName( "Joe Smith" );

View Full Code Here

      // step 1: create hibernate search searchFactory
      SearchConfiguration cfg = new SearchableCacheConfiguration(classes, properties);
      // set classes in the cfg

      SearchFactoryImplementor searchFactory = new SearchFactoryImpl(cfg);
//       boolean isPojoCache = c instanceof PojoCache; keep this for later usage

      // Step 2: Add cache listener to listen for events happening in the cache.
      //SearchableListener listener = isPojoCache ? new SearchablePojoListener(searchFactory) : new SearchableCoreListener(searchFactory);
View Full Code Here

   * @throws Exception in case the test fails.
   */
  @SuppressWarnings( "unchecked" )
  public void testAddWorkGetReplacedByDeleteWork() throws Exception {
    FullTextSession fullTextSession = org.hibernate.search.Search.getFullTextSession( openSession() );
    SearchFactoryImpl searchFactory = ( SearchFactoryImpl ) fullTextSession.getSearchFactory();
    DocumentBuilderIndexedEntity builder = searchFactory.getDocumentBuilderIndexedEntity( SpecialPerson.class );

    // create test entity
    SpecialPerson person = new SpecialPerson();
    person.setName( "Joe Smith" );

View Full Code Here

      this.classes = classes;

      // Set up the search factory for hibernate search first.

      SearchConfiguration cfg = new SearchableCacheConfiguration(classes, properties);
      searchFactory = new SearchFactoryImpl(cfg);

      applyProperties(cache.getConfiguration());
   }
View Full Code Here

      this.classes = classes;

      // Set up the search factory for hibernate search first.

      SearchConfiguration cfg = new SearchableCacheConfiguration(classes, properties);
      searchFactory = new SearchFactoryImpl(cfg);

      applyProperties();
   }
View Full Code Here

    WeakHashMap<Configuration, SearchFactoryImpl> contextMap = contexts.get();
    if ( contextMap == null ) {
      contextMap = new WeakHashMap<Configuration, SearchFactoryImpl>( 2 );
      contexts.set( contextMap );
    }
    SearchFactoryImpl searchFactory = contextMap.get( cfg );
    if ( searchFactory == null ) {
      searchFactory = new SearchFactoryImpl( new SearchConfigurationFromHibernateCore( cfg ) );
      contextMap.put( cfg, searchFactory );
    }
    return searchFactory;
  }
View Full Code Here

    WeakHashMap<Configuration, SearchFactoryImpl> contextMap = contexts.get();
    if ( contextMap == null ) {
      contextMap = new WeakHashMap<Configuration, SearchFactoryImpl>( 2 );
      contexts.set( contextMap );
    }
    SearchFactoryImpl searchFactory = contextMap.get( cfg );
    if ( searchFactory == null ) {
      searchFactory = new SearchFactoryImpl( new SearchConfigurationFromHibernateCore( cfg ) );
      contextMap.put( cfg, searchFactory );
    }
    return searchFactory;
  }
View Full Code Here

      log.debug( "Storing SearchFactory in ThreadLocal" );
      searchFactoryImplementor = ContextHolder.getOrBuildSearchFactory( cfg );
    }
    else {
      if ( searchFactoryImplementor == null ) {
        searchFactoryImplementor = new SearchFactoryImpl( new SearchConfigurationFromHibernateCore( cfg ) );
      }
    }
    String indexingStrategy = searchFactoryImplementor.getIndexingStrategy();
    if ( "event".equals( indexingStrategy ) ) {
      used = searchFactoryImplementor.getDocumentBuildersIndexedEntities().size() != 0;
View Full Code Here

      // step 1: create hibernate search searchFactory
      SearchConfiguration cfg = new SearchableCacheCfgImpl(classes, properties);
      // set classes in the cfg

      SearchFactoryImplementor searchFactory = new SearchFactoryImpl(cfg);
//       boolean isPojoCache = c instanceof PojoCache; keep this for later usage

      // Step 2: Add cache listener to listen for events happening in the cache.
      //SearchableListener listener = isPojoCache ? new SearchablePojoListener(searchFactory) : new SearchableCoreListener(searchFactory);
View Full Code Here

TOP

Related Classes of org.hibernate.search.impl.SearchFactoryImpl

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.