Examples of AssertionFailure


Examples of org.hibernate.annotations.common.AssertionFailure

    Annotation idAnnotation = getIdAnnotation( member, context );
    if ( idAnnotation != null ) {
      String attributeName = getIdAttributeName( member, idAnnotation );
      if ( isRoot ) {
        if ( idKeywordName != null && explicitDocumentId ) {
          throw new AssertionFailure( "Two document id assigned: "
              + idKeywordName + " and " + attributeName );
        }
        idKeywordName = prefix + attributeName;
        FieldBridge fieldBridge = BridgeFactory.guessType( null, member, reflectionManager );
        if ( fieldBridge instanceof TwoWayFieldBridge ) {
          idBridge = (TwoWayFieldBridge) fieldBridge;
        }
        else {
          throw new SearchException(
              "Bridge for document id does not implement TwoWayFieldBridge: " + member.getName() );
        }
        idBoost = getBoost( member, null );
        setAccessible( member );
        idGetter = member;
      }
      else {
        //component should index their document id
        setAccessible( member );
        propertiesMetadata.fieldGetters.add( member );
        String fieldName = prefix + attributeName;
        propertiesMetadata.fieldNames.add( fieldName );
        propertiesMetadata.fieldStore.add( getStore( Store.YES ) );
        propertiesMetadata.fieldIndex.add( getIndex( Index.UN_TOKENIZED ) );
        propertiesMetadata.fieldTermVectors.add( getTermVector( TermVector.NO ) );
        propertiesMetadata.fieldBridges.add( BridgeFactory.guessType( null, member, reflectionManager ) );
        propertiesMetadata.fieldBoosts.add( getBoost( member, null ) );
        // property > entity analyzer (no field analyzer)
        Analyzer analyzer = getAnalyzer( member, context );
        if ( analyzer == null ) analyzer = propertiesMetadata.analyzer;
        if ( analyzer == null ) throw new AssertionFailure( "Analizer should not be undefined" );
        this.analyzer.addScopedAnalyzer( fieldName, analyzer );
      }
    }
  }
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

    propertiesMetadata.classBridges.add( BridgeFactory.extractType( ann ) );
    propertiesMetadata.classBoosts.add( ann.boost().value() );

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

Examples of org.hibernate.annotations.common.AssertionFailure

      case YES:
        return Field.Store.YES;
      case COMPRESS:
        return Field.Store.COMPRESS;
      default:
        throw new AssertionFailure( "Unexpected Store: " + store );
    }
  }
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

      case WITH_POSITIONS:
        return Field.TermVector.WITH_POSITIONS;
      case WITH_POSITION_OFFSETS:
        return Field.TermVector.WITH_POSITIONS_OFFSETS;
      default:
        throw new AssertionFailure( "Unexpected TermVector: " + vector );
    }
  }
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

      case TOKENIZED:
        return Field.Index.ANALYZED;
      case UN_TOKENIZED:
        return Field.Index.NOT_ANALYZED;
      default:
        throw new AssertionFailure( "Unexpected Index: " + index );
    }
  }
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

 
  @Override
  public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
    int size = chainedFilters.size();
    if ( size == 0 ) {
      throw new AssertionFailure( "Chainedfilter has no filters to chain for" );
    }
    else if ( size == 1 ) {
      return chainedFilters.get(0).getDocIdSet(reader);
    }
    else {
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

        Document doc = getDocument( entity, id );
        queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
        queue.add( new AddLuceneWork( id, idInString, entityClass, doc, true ) );
      }
      else {
        throw new AssertionFailure( "Unknown WorkType: " + workType );
      }
    }

    /**
     * When references are changed, either null or another one, we expect dirty checking to be triggered (both sides
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

          break;
        case OBJECT:
          buildDocumentFields( value, doc, embeddedMetadata );
          break;
        default:
          throw new AssertionFailure( "Unknown embedded container: "
              + propertiesMetadata.embeddedContainers.get( i ) );
      }
    }
  }
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

    return new Term( idKeywordName, idBridge.objectToString( id ) );
  }

  public DirectoryProvider[] getDirectoryProviders() {
    if ( entityState != EntityState.INDEXED ) {
      throw new AssertionFailure( "Contained in only entity: getDirectoryProvider should not have been called." );
    }
    return directoryProviders;
  }
View Full Code Here

Examples of org.hibernate.annotations.common.AssertionFailure

    return directoryProviders;
  }

  public IndexShardingStrategy getDirectoryProviderSelectionStrategy() {
    if ( entityState != EntityState.INDEXED ) {
      throw new AssertionFailure( "Contained in only entity: getDirectoryProviderSelectionStrategy should not have been called." );
    }
    return shardingStrategy;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.