Package org.hibernate.search

Examples of org.hibernate.search.SearchException


  public FullTextIndexEventListener() {
    String msg = "FullTextIndexEventListener default constructor is obsolete. Remove all explicit" +
        "event listener configuration. As of Hibernate Core 3.6 Hibernate Search will be automatically enabled " +
        "if it is detected on the classpath.";
    log.error( msg );
    throw new SearchException( msg );
  }
View Full Code Here


   * Initialize method called by Hibernate Core when the SessionFactory starts
   */

  public void initialize(Configuration cfg) {
    if(installation != SINGLE_INSTANCE) {
      throw new SearchException( "Only Installation.SINGLE_INSTANCE is supported" );
    }
   
    if ( searchFactoryImplementor == null ) {
      searchFactoryImplementor = new SearchFactoryBuilder()
          .configuration( new SearchConfigurationFromHibernateCore( cfg ) )
View Full Code Here

        break;
      case PURGE_ALL:
        // not breaking intentionally: PURGE_ALL should not reach this
        // class
      default:
        throw new SearchException( "unexpected state:" + type );
      }
    }
View Full Code Here

        }
        // nothing to do, as something else was done
        break;
      case PURGE_ALL:
      default:
        throw new SearchException( "unexpected state:" + type );
      }
    }
View Full Code Here

        for ( Version v : Version.values() ) {
          msg.append( v.toString() );
          msg.append( ", " );
        }
        msg.delete( msg.lastIndexOf( "," ), msg.length() - 1 );
        throw new SearchException( msg.toString() );
      }
    }
    return version;
  }
View Full Code Here

    }
    else if ( annotatedElement instanceof XPackage ) {
      return ( (XPackage) annotatedElement ).getName();
    }
    else {
      throw new SearchException( "Unknown XAnnoatedElement: " + annotatedElement );
    }
  }
View Full Code Here

    BoostStrategy strategy;
    try {
      strategy = boostStrategyClass.newInstance();
    }
    catch ( Exception e ) {
      throw new SearchException(
          "Unable to instantiate boost strategy implementation: " + boostStrategyClass.getName()
      );
    }
    return strategy;
  }
View Full Code Here

    else {
      try {
        return ClassLoaderHelper.analyzerInstanceFromClass( analyzerClass, context.getLuceneMatchVersion() );
      }
      catch ( ClassCastException e ) {
        throw new SearchException(
            "Lucene analyzer does not implement " + Analyzer.class.getName() + ": " + analyzerClass.getName(),
            e
        );
      }
      catch ( Exception e ) {
        throw new SearchException(
            "Failed to instantiate lucene analyzer with type " + analyzerClass.getName(), e
        );
      }
    }
  }
View Full Code Here

  private void checkForAnalyzerDiscriminator(XAnnotatedElement annotatedElement, PropertiesMetadata propertiesMetadata) {
    AnalyzerDiscriminator discriminatorAnn = annotatedElement.getAnnotation( AnalyzerDiscriminator.class );
    if ( discriminatorAnn != null ) {
      if ( propertiesMetadata.discriminator != null ) {
        throw new SearchException(
            "Multiple AnalyzerDiscriminator defined in the same class hierarchy: " + beanXClass.getName()
        );
      }

      Class<? extends Discriminator> discriminatorClass = discriminatorAnn.impl();
      try {
        propertiesMetadata.discriminator = discriminatorClass.newInstance();
      }
      catch ( Exception e ) {
        throw new SearchException(
            "Unable to instantiate analyzer discriminator implementation: " + discriminatorClass.getName()
        );
      }

      if ( annotatedElement instanceof XMember ) {
View Full Code Here

  private void checkForSimilarity(XClass currClass) {
    org.hibernate.search.annotations.Similarity similarityAnn = currClass.getAnnotation( org.hibernate.search.annotations.Similarity.class );
    if ( similarityAnn != null ) {
      if ( similarity != null ) {
        throw new SearchException(
            "Multiple similarities defined in the same class hierarchy or on the index settings: " + beanXClass
                .getName()
        );
      }
      Class<?> similarityClass = similarityAnn.impl();
View Full Code Here

TOP

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