Chce pobrac tylko okreslone pola z encji i opakować to do wrappera. Pola są w encji w różnych stopniu zagnieżdzenia, nie wszystkie obok siebie w jednej encji. Poradziłem sobie o ile zwracam wszystko co chce do wrappera bez zagnieżdzeń:
To mój wrapper:

public class PersonWrapper implements Serializable {

    private String id;
    private String numberBuilding;
    private String number;

}

A to sposób w jaki wywołuję opakowanie do wrappera:

@Override
    public List<PersonWrapper> getPersonData() {
        // 
        CriteriaBuilder builder = entityManager.getCriteriaBuilder();
        final CriteriaQuery<PersonWrapper> criteria = builder.createQuery(PersonWrapper.class);
        final List<Path> targetPaths =
                paths
                        .parallelStream()
                        .map(path -> convertPathToTargetField(criteria, path))
                        .collect(Collectors.toList());

        criteria.select(builder.construct(PersonWrapper.class, targetPaths.toArray(new Path[]{})));
        return entityManager.createQuery(criteria).getResultList();
    }

I wszystko jest ok, ale ja chce odwzorować strukturę zagnieżdzoną w postaci:

public class PersonWrapper implements Serializable {
    private String id;
    private AddressWrapper address;
    private List<PhoneWrapper> phones;
}

public class AddressWrapper implements Serializable {
    private String numberBuilding;
}
public class PhoneWrapper implements Serializable {
    private String number;
}

Problem w tym, że chcę żeby hibernate sam mi zbindował do odpowiednich klas pola które pobieram.
Robie to tak:

criteria.select(builder.construct(PersonWrapper.class, targetPaths.toArray(new Path[]{})));
        return entityManager.createQuery(criteria).unwrap(Query.class).setResultTransformer(Transformers.aliasToBean(PersonWrapper.class)).list();

Ale dostaje: org.hibernate.hql.internal.ast.QuerySyntaxException: Unable to locate appropriate constructor on class [pl.com.pekaofs.forms.dto.PersonWrapper]. Expected arguments are: java.lang.String, java.lang.String, java.lang.String

Wszystko dlatego, ze przekazuje 3 Stringi do buildera i hibernate oczekuje ze w obiekcie wrappera beda te 2 Stringi a tam jest struktura drzewiasta. Jest jakis sposob na to? Pomozecie?