Package org.hibernate.annotations.common.reflection

Examples of org.hibernate.annotations.common.reflection.ReflectionManager


    //TODO exclude pure hbm file classes?
    //TODO move it to each event listener initialize()?
    EntityCallbackHandler callbackHandler = new EntityCallbackHandler();
    configuration.buildMappings(); //needed to get all the classes
    Iterator classes = configuration.getClassMappings();
    ReflectionManager reflectionManager = configuration.getHibernateConfiguration().getReflectionManager();
    while ( classes.hasNext() ) {
      PersistentClass clazz = (PersistentClass) classes.next();
      if ( clazz.getClassName() != null ) {
        //we can have non java class persisted by hibernate
        try {
          callbackHandler.add( reflectionManager.classForName( clazz.getClassName(), this.getClass() ), reflectionManager );
        }
        catch (ClassNotFoundException e) {
          throw new MappingException( "entity class not found: " + clazz.getNodeName(), e );
        }
      }
View Full Code Here


  }

  public AuditConfiguration(Configuration cfg, ClassLoaderService classLoaderService) {
    Properties properties = cfg.getProperties();

    ReflectionManager reflectionManager = cfg.getReflectionManager();
    globalCfg = new GlobalConfiguration( properties );
    RevisionInfoConfiguration revInfoCfg = new RevisionInfoConfiguration( globalCfg );
    RevisionInfoConfigurationResult revInfoCfgResult = revInfoCfg.configure( cfg, reflectionManager );
    auditEntCfg = new AuditEntitiesConfiguration( properties, revInfoCfgResult.getRevisionInfoEntityName() );
    auditProcessManager = new AuditProcessManager( revInfoCfgResult.getRevisionInfoGenerator() );
View Full Code Here

  /**
   * Extracts the index name used for the entity from it's annotations
   * @return the index name
   */
  private static String getDirectoryProviderName(XClass clazz, SearchConfiguration cfg) {
    ReflectionManager reflectionManager = cfg.getReflectionManager();
    if ( reflectionManager == null ) {
      reflectionManager = new JavaReflectionManager();
    }
    //get the most specialized (ie subclass > superclass) non default index name
    //if none extract the name from the most generic (superclass > subclass) @Indexed class in the hierarchy
    //FIXME I'm inclined to get rid of the default value
    Class<?> aClass = cfg.getClassMapping( clazz.getName() );
    XClass rootIndex = null;
    do {
      XClass currentClazz = reflectionManager.toXClass( aClass );
      Indexed indexAnn = currentClazz.getAnnotation( Indexed.class );
      if ( indexAnn != null ) {
        if ( indexAnn.index().length() != 0 ) {
          return indexAnn.index();
        }
View Full Code Here

    final Properties configurationProperties = factoryState.getConfigurationProperties();
    BuildContext buildContext = new BuildContext();

    //TODO we don't keep the reflectionManager. Is that an issue?
    IncrementalSearchConfiguration cfg = new IncrementalSearchConfiguration( classes, configurationProperties, factoryState );
    final ReflectionManager reflectionManager = getReflectionManager( cfg );

    //TODO programmatic mapping support
    //FIXME The current initDocumentBuilders
    initDocumentBuilders( cfg, reflectionManager, buildContext );
    final Map<Class<?>, EntityIndexBinder<?>> documentBuildersIndexedEntities = factoryState.getIndexBindingForEntity();
View Full Code Here

  }

  private SearchFactoryImplementor buildNewSearchFactory() {
    createCleanFactoryState( cfg );

    final ReflectionManager reflectionManager = getReflectionManager( cfg );

    BuildContext buildContext = new BuildContext();

    final SearchMapping mapping = SearchMappingBuilder.getSearchMapping( cfg );
    if ( mapping != null ) {
View Full Code Here

      }
    }
  }

  private ReflectionManager getReflectionManager(SearchConfiguration cfg) {
    ReflectionManager reflectionManager = cfg.getReflectionManager();
    return geReflectionManager( reflectionManager );
  }
View Full Code Here

    final Properties configurationProperties = factoryState.getConfigurationProperties();
    BuildContext buildContext = new BuildContext();

    //TODO we don't keep the reflectionManager. Is that an issue?
    IncrementalSearchConfiguration cfg = new IncrementalSearchConfiguration( classes, configurationProperties );
    final ReflectionManager reflectionManager = getReflectionManager( cfg );

    //TODO programmatic mapping support
    //FIXME The current initDocumentBuilders
    initDocumentBuilders( cfg, reflectionManager, buildContext );
    final Map<Class<?>, DocumentBuilderIndexedEntity<?>> documentBuildersIndexedEntities = factoryState.getDocumentBuildersIndexedEntities();
View Full Code Here

  }

  private SearchFactoryImplementor buildNewSearchFactory() {
    createCleanFactoryState();

    final ReflectionManager reflectionManager = getReflectionManager( cfg );

    BuildContext buildContext = new BuildContext();

    final SearchMapping mapping = SearchMappingBuilder.getSearchMapping( cfg );
    if ( mapping != null ) {
View Full Code Here

      );
    }
  }

  private ReflectionManager getReflectionManager(SearchConfiguration cfg) {
    ReflectionManager reflectionManager = cfg.getReflectionManager();
    return geReflectionManager( reflectionManager );
  }
View Full Code Here

      return shardLocalProperties;
    }
  }

  private static String getDirectoryProviderName(XClass clazz, SearchConfiguration cfg) {
    ReflectionManager reflectionManager = cfg.getReflectionManager();
    if ( reflectionManager == null ) {
      reflectionManager = new JavaReflectionManager();
    }
    //get the most specialized (ie subclass > superclass) non default index name
    //if none extract the name from the most generic (superclass > subclass) @Indexed class in the hierarchy
    //FIXME I'm inclined to get rid of the default value
    Class<?> aClass = cfg.getClassMapping( clazz.getName() );
    XClass rootIndex = null;
    do {
      XClass currentClazz = reflectionManager.toXClass( aClass );
      Indexed indexAnn = currentClazz.getAnnotation( Indexed.class );
      if ( indexAnn != null ) {
        if ( indexAnn.index().length() != 0 ) {
          return indexAnn.index();
        }
View Full Code Here

TOP

Related Classes of org.hibernate.annotations.common.reflection.ReflectionManager

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.