Package org.hibernate.search.exception

Examples of org.hibernate.search.exception.AssertionFailure


    }
    else if ( retrievalMethod == DatabaseRetrievalMethod.QUERY ) {
      initializer = CriteriaObjectsInitializer.INSTANCE;
    }
    else {
      throw new AssertionFailure( "Unknown " + DatabaseRetrievalMethod.class.getSimpleName() + "." + retrievalMethod );
    }
    if ( lookupMethod == ObjectLookupMethod.SKIP ) {
      return initializer;
    }
    else if ( lookupMethod == ObjectLookupMethod.PERSISTENCE_CONTEXT ) {
      return new PersistenceContextObjectsInitializer( initializer );
    }
    else if ( lookupMethod == ObjectLookupMethod.SECOND_LEVEL_CACHE ) {
      //we want to check the PC first, that's cheaper
      return new PersistenceContextObjectsInitializer( new SecondLevelCacheObjectsInitializer( initializer ) );
    }
    else {
      throw new AssertionFailure( "Unknown " + ObjectLookupMethod.class.getSimpleName() + "." + lookupMethod );
    }
    //unreachable statement
  }
View Full Code Here


          found = true;
          break; //we stop looping for the right bucket
        }
      }
      if ( !found ) {
        throw new AssertionFailure( "Could not find root entity for " + clazz );
      }
    }

    //initialize objects by bucket
    for ( Map.Entry<RootEntityMetadata, List<EntityInfo>> entry : entityinfoBuckets.entrySet() ) {
View Full Code Here

    RootEntityMetadata(Class<?> rootEntity, SearchFactoryImplementor searchFactoryImplementor) {
      this.rootEntity = rootEntity;
      EntityIndexBinding provider = searchFactoryImplementor.getIndexBinding( rootEntity );
      if ( provider == null ) {
        throw new AssertionFailure("Provider not found for class: " + rootEntity);
      }
      this.mappedSubclasses = provider.getDocumentBuilder().getMappedSubclasses();
      this.criteria = null; //default
    }
View Full Code Here

    }
  }

  @Override
  public Object loadWithoutTiming(EntityInfo entityInfo) {
    throw new AssertionFailure( "This method is not meant to be used on ProjectionLoader" );
  }
View Full Code Here

    }
    else if ( retrievalMethod == DatabaseRetrievalMethod.QUERY ) {
      initializer = CriteriaObjectsInitializer.INSTANCE;
    }
    else {
      throw new AssertionFailure( "Unknown " + DatabaseRetrievalMethod.class.getSimpleName() + "." + retrievalMethod );
    }
    if ( lookupMethod == ObjectLookupMethod.SKIP ) {
      return initializer;
    }
    else if ( lookupMethod == ObjectLookupMethod.PERSISTENCE_CONTEXT ) {
      return new PersistenceContextObjectsInitializer( initializer );
    }
    else if ( lookupMethod == ObjectLookupMethod.SECOND_LEVEL_CACHE ) {
      //we want to check the PC first, that's cheaper
      return new PersistenceContextObjectsInitializer( new SecondLevelCacheObjectsInitializer( initializer ) );
    }
    else {
      throw new AssertionFailure( "Unknown " + ObjectLookupMethod.class.getSimpleName() + "." + lookupMethod );
    }
    //unreachable statement
  }
View Full Code Here

  public final List executeLoad(EntityInfo... entityInfos) {
    if ( entityInfos.length == 0 ) {
      return Collections.EMPTY_LIST;
    }
    if ( entityType == null ) {
      throw new AssertionFailure( "EntityType not defined" );
    }

    objectsInitializer.initializeObjects(
        entityInfos,
        criteria,
View Full Code Here

    try {
      tikaBridgeClass = ClassLoaderHelper.classForName( TIKA_BRIDGE_NAME, BridgeFactory.class.getClassLoader() );
      tikaBridge = ClassLoaderHelper.instanceFromClass( FieldBridge.class, tikaBridgeClass, "Tika bridge" );
    }
    catch (ClassNotFoundException e) {
      throw new AssertionFailure( "Unable to find Tika bridge class: " + TIKA_BRIDGE_NAME );
    }

    Class<?> tikaMetadataProcessorClass = annotation.metadataProcessor();
    if ( tikaMetadataProcessorClass != void.class ) {
      configureTikaBridgeParameters(
View Full Code Here

  @Override
  public void initialize(Properties properties, IndexManager[] indexManagers) {
    this.directoryProvider = indexManagers;
    if ( directoryProvider.length > 1 ) {
      throw new AssertionFailure("Using SingleDirectoryProviderSelectionStrategy with multiple DirectryProviders");
    }
  }
View Full Code Here

        );
        if ( analyzer == null ) {
          analyzer = typeMetadataBuilder.getAnalyzer();
        }
        if ( analyzer == null ) {
          throw new AssertionFailure( "Analyzer should not be undefined" );
        }
        typeMetadataBuilder.addToScopedAnalyzer( fieldName, analyzer, index );
      }
    }
  }
View Full Code Here

    typeMetadataBuilder.addClassBridgeField( fieldMetadata );

    Analyzer analyzer = typeMetadataBuilder.getAnalyzer();
    if ( analyzer == null ) {
      throw new AssertionFailure( "Analyzer should not be undefined" );
    }
  }
View Full Code Here

TOP

Related Classes of org.hibernate.search.exception.AssertionFailure

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.