Package org.hibernate.search.exception

Examples of org.hibernate.search.exception.SearchException


        typeMetadataBuilder.addProperty( propertyMetadataBuilder.build() );
      }
    }
    if ( ( fieldAnnotation == null && idAnn == null ) && numericFieldAnnotation != null ) {
      throw new SearchException( "@NumericField without a @Field on property '" + member.getName() + "'" );
    }
  }
View Full Code Here


                configContext.getServiceManager()
            );
        transientAnnotation = member.getAnnotation( transientAnnotationClass );
      }
      catch (ClassLoadingException e) {
        throw new SearchException( "Unable to load @Transient.class even though it should be present ?!" );
      }
      return transientAnnotation != null;
    }
  }
View Full Code Here

    }
    else {
      EnumSet<org.hibernate.search.annotations.FieldCacheType> enabledTypes = EnumSet.noneOf( org.hibernate.search.annotations.FieldCacheType.class );
      Collections.addAll( enabledTypes, fieldCacheOptions.value() );
      if ( enabledTypes.size() != 1 && enabledTypes.contains( org.hibernate.search.annotations.FieldCacheType.NOTHING ) ) {
        throw new SearchException(
            "CacheFromIndex configured with conflicting parameters:" +
                " if FieldCacheType.NOTHING is enabled, no other options can be added"
        );
      }
      this.fieldCacheUsage = Collections.unmodifiableSet( enabledTypes );
View Full Code Here

    if ( bridge != null ) {
      return objectToString( fieldName, bridge, value, conversionContext );
    }

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

   *
   * @throws SearchException both for null values and for Strings not containing a valid int.
   */
  public static int parseInt(String value, String errorMsgOnParseFailure) {
    if ( value == null ) {
      throw new SearchException( errorMsgOnParseFailure );
    }
    else {
      try {
        return Integer.parseInt( value.trim() );
      }
View Full Code Here

   * @return the parsed value
   * @throws SearchException both for null values and for Strings not containing a valid int.
   */
  public static long parseLong(String value, String errorMsgOnParseFailure) {
    if ( value == null ) {
      throw new SearchException( errorMsgOnParseFailure );
    }
    else {
      try {
        return Long.parseLong( value.trim() );
      }
      catch (NumberFormatException nfe) {
        throw new SearchException( errorMsgOnParseFailure, nfe );
      }
    }
  }
View Full Code Here

   * @throws SearchException for invalid format or values.
   */
  public static final boolean parseBoolean(String value, String errorMsgOnParseFailure) {
    // avoiding Boolean.valueOf() to have more checks: makes it easy to spot wrong type in cfg.
    if ( value == null ) {
      throw new SearchException( errorMsgOnParseFailure );
    }
    else if ( "false".equalsIgnoreCase( value.trim() ) ) {
      return false;
    }
    else if ( "true".equalsIgnoreCase( value.trim() ) ) {
      return true;
    }
    else {
      throw new SearchException( errorMsgOnParseFailure );
    }
  }
View Full Code Here

  }

  private String buildSearchTerm(FieldContext fieldContext, DocumentBuilderIndexedEntity documentBuilder, ConversionContext conversionContext) {
    if ( fieldContext.isIgnoreFieldBridge() ) {
      if ( value == null ) {
        throw new SearchException(
            "Unable to search for null token on field "
                + fieldContext.getField() + " if field bridge is ignored."
        );
      }
      String stringform = value.toString();
      if ( stringform == null ) {
        throw new SearchException(
            "When ignoreFieldBridge() is enabled, toString() on the value is used: the returned string must not be null: " +
            "on field " + fieldContext.getField() );
      }
      return stringform;
    }
View Full Code Here

    try {
      Term term = new Term( ProjectionConstants.OBJECT_CLASS, entityType.getName() );
      writer.deleteDocuments( term );
    }
    catch (Exception e) {
      throw new SearchException( "Unable to purge all from Lucene index: " + entityType, e );
    }
    workspace.notifyWorkApplied( work );
  }
View Full Code Here

      return this;
    }

    public Builder analyzerDiscriminator(Discriminator discriminator, XMember discriminatorGetter) {
      if ( this.discriminator != null ) {
        throw new SearchException(
            "Multiple AnalyzerDiscriminator defined in the same class hierarchy: " + this.indexedType
                .getName()
        );
      }
View Full Code Here

TOP

Related Classes of org.hibernate.search.exception.SearchException

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.