Package org.hibernate.search.exception

Examples of org.hibernate.search.exception.AssertionFailure


                objectInitializer,
                documentBoost
            );
            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

      catch (IllegalStateException e) {
        id = null;
      }
    }
    else {
      throw new AssertionFailure( "We don't support no string and reader for MoreLikeThis" );
    }
    if ( id == null ) {
      return null;
    }
    findById = new TermQuery( new Term( documentBuilder.getIdKeywordName(), id ) );
View Full Code Here

  private Query createQuery(List<PriorityQueue<Object[]>> q) {
    //In the original algorithm, the number of terms is limited to maxQueryTerms
    //In the current implementation, we do nbrOfFields * maxQueryTerms
    int length = fieldsContext.size();
    if ( length == 0 ) {
      throw new AssertionFailure( "Querying MoreLikeThis on 0 field." );
    }
    else if ( length == 1 ) {
      return createQuery( q.get( 0 ), fieldsContext.getFirst() );
    }
    else {
View Full Code Here

    if ( max == null && min == null ) {
      throw new IllegalArgumentException( "At least one end of the range has to be specified" );
    }

    if ( documentBuilder == null ) {
      throw new AssertionFailure(
          "null is not a valid document builder"
      );
    }

    this.min = min;
View Full Code Here

          stringMin,
          stringMax
      );
    }
    else {
      throw new AssertionFailure( "Unexpected value type: " + value.getClass().getName() );
    }
  }
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

    }
    if ( indexReader == null ) {
      writeLock.lock();
      try {
        if ( shutdown ) {
          throw new AssertionFailure( "IndexReader requested after ReaderProvider is shutdown" );
        }
        indexReader = currentReader.get();
        if ( indexReader == null ) {
          indexReader = writerHolder.openDirectoryIndexReader();
          currentReader.set( indexReader );
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

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.