Package org.hibernate.reflection

Examples of org.hibernate.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


      Class target = void.class;
      /*
       * target has priority over reflection for the map key type
       */
      if ( property.isAnnotationPresent( org.hibernate.annotations.MapKey.class ) ) {
        ReflectionManager reflectionManager = mappings.getReflectionManager();
        target = property.getAnnotation( org.hibernate.annotations.MapKey.class ).targetElement();
      }
      else if ( property.isAnnotationPresent( MapKeyManyToMany.class ) ) {
        target = property.getAnnotation( MapKeyManyToMany.class ).targetEntity();
      }
View Full Code Here

    return indexProps;
  }

  public static String getDirectoryProviderName(XClass clazz, Configuration cfg) {
    //yuk
    ReflectionManager reflectionManager =
        ( (AnnotationConfiguration) cfg ).createExtendedMappings().getReflectionManager();
    //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
    PersistentClass pc = cfg.getClassMapping( clazz.getName() );
    XClass rootIndex = null;
    do {
      XClass currentClazz = reflectionManager.toXClass( pc.getMappedClass() );
      Indexed indexAnn = currentClazz.getAnnotation( Indexed.class );
      if ( indexAnn != null ) {
        if ( indexAnn.index().length() != 0 ) {
          return indexAnn.index();
        }
View Full Code Here

          throw new HibernateException( "Class does not implement "
            + MessageInterpolator.class.getName() + ": " + interpolatorString, e );
        }
      }
      Iterator<PersistentClass> classes = (Iterator<PersistentClass>) cfg.getClassMappings();
            ReflectionManager reflectionManager;
            if ( cfg instanceof AnnotationConfiguration ) {
                //reuse the existing reflectionManager one when possible
                reflectionManager = ( (AnnotationConfiguration) cfg).getReflectionManager();
            }
            else {
View Full Code Here

      Class target = void.class;
      /*
       * target has priority over reflection for the map key type
       */
      if ( property.isAnnotationPresent( org.hibernate.annotations.MapKey.class ) ) {
        ReflectionManager reflectionManager = mappings.getReflectionManager();
        target = property.getAnnotation( org.hibernate.annotations.MapKey.class ).targetElement();
      }
      else if ( property.isAnnotationPresent( MapKeyManyToMany.class ) ) {
        target = property.getAnnotation( MapKeyManyToMany.class ).targetEntity();
      }
View Full Code Here

TOP

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