I am trying to get a list of several columns from my table using QueryDSL and automatically populate my DB object, like this example, in an older manual:
List<CatDTO> catDTOs = query.from(cat)
.list(EConstructor.create(CatDTO.class, cat.id, cat.name));
The problem is that it looks like the EConstructor class was removed in version 2.2.0, and all the examples that I have found now look like this:
List<Object[]> rows = query.from(cat)
.list(cat.id, cat.name);
This forces me to manually map all objects to my CatDTO class.
Is there an alternative to this? Any alternative to EConstructor?
source
share