Package org.hibernate.annotations.common

Examples of org.hibernate.annotations.common.AssertionFailure


   */
  public AbstractDocumentBuilder(XClass xClass, ConfigContext context, Similarity similarity,
      ReflectionManager reflectionManager, Set<XClass> optimizationBlackList, InstanceInitializer instanceInitializer) {

    if ( xClass == null ) {
      throw new AssertionFailure( "Unable to build a DocumentBuilderContainedEntity with a null class" );
    }
    final Version luceneVersion = context.getLuceneMatchVersion();

    this.passThroughAnalyzer = new PassThroughAnalyzer( luceneVersion );
    this.instanceInitializer = instanceInitializer;
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

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

    propertiesMetadata.classBridges.add( spatialBridge );
    propertiesMetadata.classBoosts.add( ann.boost().value() );

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

        //fall through:
      case PREFER_INDEXWRITER :
        workOnWriter.add( work );
        break;
      default :
        throw new AssertionFailure( "Uncovered switch case for type " + type );
    }
  }
View Full Code Here

      }
      else {
        useWriterOnly();
      }
      if ( ! (workOnWriter.isEmpty() || workOnReader.isEmpty() ) ) {
        throw new AssertionFailure(
          "During non-batch mode performWorks tries to use both IndexWriter and IndexReader." );
      }
    }
    // apply changes to index:
    log.trace( "Locking Workspace (or waiting to...)" );
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

  private final Logger log = LoggerFactory.make();

  DeleteExtWorkDelegate(Workspace workspace) {
    super( workspace );
    if ( workspace.getEntitiesInDirectory().size() != 1 ) {
      throw new AssertionFailure( "Can't use this delegate on shared indexes" );
    }
    managedType = workspace.getEntitiesInDirectory().iterator().next();
    builder = workspace.getDocumentBuilder( managedType );
  }
View Full Code Here

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

        Analyzer analyzer = getAnalyzer( member, context );
        if ( analyzer == null ) {
          analyzer = propertiesMetadata.analyzer;
        }
        if ( analyzer == null ) {
          throw new AssertionFailure( "Analyzer should not be undefined" );
        }
        addToScopedAnalyzer( fieldName, analyzer, Index.UN_TOKENIZED );
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.hibernate.annotations.common.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.