private void findPathOnParentSubclasses(Path<?> parent, Class<?> targetType, List<Path<?>> candidatePaths) {
        for (Class child : ReflectionUtils.getSubclasses(parent.getType(), entityManager)) {
            try {
                Class clazz = Class.forName(child.getPackage().getName() + ".Q" + child.getSimpleName());
                Object childInstance = ReflectionUtils.instantiate(clazz, (String) parent.getMetadata().getElement());
                for (Field field : clazz.getFields()) {
                    testAliasCandidate(targetType, candidatePaths, getField(field, childInstance));
                }
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
private void findPathOnParentSubclasses ( Path < ? > parent , Class < ? > targetType , List < Path < ? > > candidatePaths ) { for ( Class child : ReflectionUtils . getSubclasses ( parent . getType ( ) , entityManager ) ) { try { Class clazz = Class . forName ( child . getPackage ( ) . getName ( ) + ".Q" + child . getSimpleName ( ) ) ; Object childInstance = ReflectionUtils . instantiate ( clazz , ( String ) parent . getMetadata ( ) . getElement ( ) ) ; for ( Field field : clazz . getFields ( ) ) { testAliasCandidate ( targetType , candidatePaths , getField ( field , childInstance ) ) ; } } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } }
Try to find attribute on a subclass of parent (for instance in test domain when looking for <code>Key</code> on <code>User</code>)

@param parent         parent join or "from" element
@param targetType     type of joined attribute
@param candidatePaths container for found paths