Package org.hibernate.annotations.common.reflection.java

Examples of org.hibernate.annotations.common.reflection.java.JavaReflectionManager


    assertFalse( ReflectionHelper.isSearchAnnotation( annotation ) );
  }

  @Test
  public void testIsSearchEnabled() throws Exception {
    ReflectionManager reflectionManager = new JavaReflectionManager();

    assertTrue(
        "Should be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( A.class ) )
    );
    assertTrue(
        "Should be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( B.class ) )
    );
    assertTrue(
        "Should be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( C.class ) )
    );
    assertTrue(
        "Should be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( D.class ) )
    );

    assertFalse(
        "Should not be a search enabled class",
        ReflectionHelper.containsSearchAnnotations( reflectionManager.toXClass( E.class ) )
    );
  }
View Full Code Here


    SearchConfiguration searchConfiguration = new SearchConfigurationForTest();
    ConfigContext configContext = new ConfigContext(
        searchConfiguration,
        new BuildContextForTest( searchConfiguration )
    );
    metadataProvider = new AnnotationMetadataProvider( new JavaReflectionManager(), configContext );
  }
View Full Code Here

    SearchConfiguration searchConfiguration = new SearchConfigurationForTest();
    ConfigContext configContext = new ConfigContext(
        searchConfiguration,
        new BuildContextForTest( searchConfiguration )
    );
    metadataProvider = new AnnotationMetadataProvider( new JavaReflectionManager(), configContext );
  }
View Full Code Here

  private void createReflectionManager() {
    createReflectionManager( new JPAMetadataProvider() );
  }

  private void createReflectionManager(MetadataProvider metadataProvider) {
    reflectionManager = new JavaReflectionManager();
    ( ( MetadataProviderInjector ) reflectionManager ).setMetadataProvider( metadataProvider );
  }
View Full Code Here

    namingStrategy = EJB3NamingStrategy.INSTANCE;
    setEntityResolver( new EJB3DTDEntityResolver() );
    anyMetaDefs = new HashMap<String, AnyMetaDef>();
    propertiesAnnotatedWithMapsId = new HashMap<XClass, Map<String, PropertyData>>();
    propertiesAnnotatedWithIdAndToOne = new HashMap<XClass, Map<String, PropertyData>>();
    reflectionManager = new JavaReflectionManager();
    ( ( MetadataProviderInjector ) reflectionManager ).setMetadataProvider( new JPAMetadataProvider() );
    configurationArtefactPrecedence = Collections.emptyList();
  }
View Full Code Here

   * @return the index name
   */
  private static String getIndexName(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() );
View Full Code Here

    return getReflectionManager( reflectionManager );
  }

  private ReflectionManager getReflectionManager(ReflectionManager reflectionManager) {
    if ( reflectionManager == null ) {
      reflectionManager = new JavaReflectionManager();
    }
    return reflectionManager;
  }
View Full Code Here

  private void createReflectionManager() {
    createReflectionManager( new JPAMetadataProvider() );
  }

  private void createReflectionManager(MetadataProvider metadataProvider) {
    reflectionManager = new JavaReflectionManager();
    ( ( MetadataProviderInjector ) reflectionManager ).setMetadataProvider( metadataProvider );
  }
View Full Code Here

   * @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() );
View Full Code Here

  }

  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() );
View Full Code Here

TOP

Related Classes of org.hibernate.annotations.common.reflection.java.JavaReflectionManager

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.