Package org.hibernate.search.exception

Examples of org.hibernate.search.exception.AssertionFailure


                conversionContext,
                objectInitializer
            );
            break;
          default:
            throw new AssertionFailure(
                "Unknown embedded container: "
                    + embeddedTypeMetadata.getEmbeddedContainer()
            );
        }
      }
View Full Code Here


    );
  }

  public String objectToString(String fieldName, Object value, ConversionContext conversionContext) {
    if ( fieldName == null ) {
      throw new AssertionFailure( "Field name should not be null" );
    }

    final DocumentFieldMetadata idFieldMetaData = idPropertyMetadata.getFieldMetadata( idFieldName );
    final FieldBridge bridge = fieldName.equals( idFieldMetaData.getName() ) ?
        getIdBridge() :
View Full Code Here

    throw new SearchException( "Unable to find field " + fieldName + " in " + getBeanXClass() );
  }

  public String objectToString(String fieldName, FieldBridge bridge, Object value, ConversionContext conversionContext) {
    if ( fieldName == null ) {
      throw new AssertionFailure( "Field name should not be null" );
    }
    if ( bridge == null ) {
      throw new AssertionFailure( "Field bridge should not be null" );
    }

    final Class<? extends FieldBridge> bridgeClass = bridge.getClass();

    if ( TwoWayFieldBridge.class.isAssignableFrom( bridgeClass ) ) {
View Full Code Here

      TypeMetadata typeMetadata,
      ReflectionManager reflectionManager,
      Set<XClass> optimizationBlackList,
      InstanceInitializer instanceInitializer) {
    if ( xClass == null ) {
      throw new AssertionFailure( "Unable to build a DocumentBuilderContainedEntity with a null class" );
    }

    this.instanceInitializer = instanceInitializer;
    this.entityState = EntityState.CONTAINED_IN_ONLY;
    this.beanXClass = xClass;
View Full Code Here

  public void postInitialize(Set<Class<?>> indexedClasses) {
    //we initialize only once because we no longer have a reference to the reflectionManager
    //in theory
    Class<?> plainClass = beanClass;
    if ( entityState == EntityState.NON_INDEXABLE ) {
      throw new AssertionFailure( "A non indexed entity is post processed" );
    }
    Set<Class<?>> tempMappedSubclasses = new HashSet<Class<?>>();
    //together with the caller this creates a o(2), but I think it's still faster than create the up hierarchy for each class
    for ( Class<?> currentClass : indexedClasses ) {
      if ( plainClass != currentClass && plainClass.isAssignableFrom( currentClass ) ) {
View Full Code Here

    return subQueue;
  }

  public List<LuceneWork> getSealedQueue() {
    if ( sealedQueue == null ) {
      throw new AssertionFailure( "Access a WorkQueue which has not been sealed" );
    }
    this.sealedAndUnchanged = false;
    return sealedQueue;
  }
View Full Code Here

  @Override
  public BooleanJunction not() {
    final int lastIndex = clauses.size() - 1;
    final BooleanClause last = clauses.get( lastIndex );
    if ( ! last.getOccur().equals( BooleanClause.Occur.MUST ) ) {
      throw new AssertionFailure( "Cannot negate class: " + last.getOccur() );
    }
    clauses.set( lastIndex, new BooleanClause( last.getQuery(), BooleanClause.Occur.MUST_NOT ) );
    return this;
  }
View Full Code Here

      case PURGE_ALL:
      case INDEX:
        operation = IndexingOverride.APPLY_DEFAULT;
        break;
      default:
        throw new AssertionFailure( "Unknown work type: " + work.getType() );
    }
    Work result = work;
    Class<?> entityClass = work.getEntityClass();
    switch ( operation ) {
      case APPLY_DEFAULT:
        break;
      case SKIP:
        result = null;
        log.forceSkipIndexOperationViaInterception( entityClass, work.getType() );
        break;
      case UPDATE:
        result = new Work( work.getEntity(), work.getId(), WorkType.UPDATE );
        log.forceUpdateOnIndexOperationViaInterception( entityClass, work.getType() );
        break;
      case REMOVE:
        //This works because other Work constructors are never used from WorkType ADD, UPDATE, REMOVE, COLLECTION
        //TODO should we force isIdentifierRollback to false if the operation is not a delete?
        result = new Work( work.getEntity(), work.getId(), WorkType.DELETE, work.isIdentifierWasRolledBack() );
        log.forceRemoveOnIndexOperationViaInterception( entityClass, work.getType() );
        break;
      default:
        throw new AssertionFailure( "Unknown action type: " + operation );
    }
    return result;
  }
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.