So I have simple dto object that conatins part of entity data. The problem is how to create using query dsl those two list below.
public class DtoPackageData implements Serializable {
private final String policyNumber;
private final String status;
private final List<Payment> payments;
private final List<Role> roles;
}
At the moment i am using to constuct non list fields as:
return constructor(DtoPackageData.class,
contract.policyNumber,
contract.status)
but how to create those two list? I already tried something like:
return constructor(DtoPackageData.class,
contract.policyNumber,
contract.status,
list(Dto.class, payment.amountDue, payment.primaryKey.dueDate, payment.amountPaid));
//payment is joined as join(contract.payments, payment)
but it seems that this list function return object instead of list of objects and there is no mathing constructor.