public synchronized void registerEntityClasses ( Class < ? > aClass , boolean recursive ) { if ( recursive ) { classHandler . registerEntityClass ( aClass ) ; Field [ ] declaredFields = aClass . getDeclaredFields ( ) ; for ( Field declaredField : declaredFields ) { Class < ? > declaredFieldType = declaredField . getType ( ) ; if ( ! classHandler . containsEntityClass ( declaredFieldType ) ) { registerEntityClasses ( declaredFieldType , recursive ) ; } } } else { classHandler . registerEntityClass ( aClass ) ; } }
Scans all classes accessible from the context class loader which belong to the given class and all it s attributes - classes .