public static Set<Bean> getBeanToValidate(Set<BeanId> ids) {
        List<JpaRef> targetPredecessors = JpaRef.getDirectPredecessors(ids);
        Set<BeanId> beansToValidate = new HashSet<>();
        for (JpaRef ref : targetPredecessors) {
            beansToValidate.add(ref.getSource());
        }
        beansToValidate.addAll(ids);
        JpaBeanQueryAssembler query = new JpaBeanQueryAssembler(beansToValidate);
        collectRefs(beansToValidate, query, 2);
        List<JpaProperty> allProperties = JpaProperty.findProperties(query.getIds());
        query.addProperties(allProperties);

        return new HashSet<>(query.assembleBeans());
    }
public static Set < Bean > getBeanToValidate ( Set < BeanId > ids ) { List < JpaRef > targetPredecessors = JpaRef . getDirectPredecessors ( ids ) ; Set < BeanId > beansToValidate = new HashSet < > ( ) ; for ( JpaRef ref : targetPredecessors ) { beansToValidate . add ( ref . getSource ( ) ) ; } beansToValidate . addAll ( ids ) ; JpaBeanQueryAssembler query = new JpaBeanQueryAssembler ( beansToValidate ) ; collectRefs ( beansToValidate , query , 2 ) ; List < JpaProperty > allProperties = JpaProperty . findProperties ( query . getIds ( ) ) ; query . addProperties ( allProperties ) ; return new HashSet < > ( query . assembleBeans ( ) ) ; }
Will return the target bean and its direct predecessors for validation