Package org.hibernate.search.exception

Examples of org.hibernate.search.exception.AssertionFailure


    }
    else if ( rangeContext.getTo() != null ) {
      rangeContext.setExcludeTo( true );
    }
    else {
      throw new AssertionFailure( "Both from and to clause of a range query are null" );
    }
    return this;
  }
View Full Code Here


        throw new SearchException( error.delete( length - 1, length ).toString() );
      }
      return termsFromText.size() == 0 ? null : termsFromText.get( 0 );
    }
    catch (IOException e) {
      throw new AssertionFailure("IO exception while reading String stream??", e);
    }
  }
View Full Code Here

  static DocumentBuilderIndexedEntity getDocumentBuilder(QueryBuildingContext queryContext) {
    final SearchFactoryImplementor factory = queryContext.getFactory();
    final Class<?> type = queryContext.getEntityType();
    EntityIndexBinding indexBinding = factory.getIndexBinding( type );
    if ( indexBinding == null ) {
      throw new AssertionFailure( "Class is not indexed: " + type );
    }
    return indexBinding.getDocumentBuilder();
  }
View Full Code Here

  }

  public Query createQuery() {
    Query finalQuery = wrappedQuery;
    if ( wrappedQuery == null ) {
      throw new AssertionFailure( "wrapped query not set" );
    }
    finalQuery.setBoost( boost * finalQuery.getBoost() );
    if ( filter != null ) {
      finalQuery = new FilteredQuery(finalQuery, filter);
    }
View Full Code Here

    }
  }

  private void checkType(final LuceneWork work) {
    if ( work.getEntityClass() != managedType ) {
      throw new AssertionFailure( "Unexpected type: " + work.getEntityClass() + " This workspace expects: " + managedType );
    }
  }
View Full Code Here

          isMultiPhrase = true;
        }
      }
    }
    catch (IOException e) {
      throw new AssertionFailure( "IOException while reading a string. Doh!", e);
    }
    finally {
      if ( stream != null ) {
        try {
          stream.end();
          stream.close();
        }
        catch (IOException e) {
          throw new AssertionFailure( "IOException while reading a string. Doh!", e);
        }
      }
    }

    /*
 
View Full Code Here

          range.isMinIncluded(),
          range.isMaxIncluded()
      );
    }
    else {
      throw new AssertionFailure( "Unsupported range type" );
    }
  }
View Full Code Here

          range.isMinIncluded(),
          range.isMaxIncluded()
      );
    }
    else {
      throw new AssertionFailure( "Unsupported range type" );
    }
    return query;
  }
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

    int loop = 0;
    int sleep = 1000;
    while ( ! condition.evaluate() ) {
      Thread.sleep( sleep );
      if ( ++ loop > maxLoops ) {
        throw new AssertionFailure( "Condition not met because of a timeout" );
      }
    }
  }
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.