in src/main/java/com/epam/digital/data/platform/restapi/core/searchhandler/AbstractSearchHandler.java [64:82]
protected List<O> getContent(Request<I> input) {
I searchCriteria = input.getPayload();
try {
var selectFields = selectFields();
var selectRequest =
context
.select(selectFields)
.from(DSL.table(tableName()))
.where(whereClause(searchCriteria))
.and(getCommonCondition(input))
.limit(offset(searchCriteria), limit(searchCriteria));
return CollectionUtils.size(selectFields) > 1
? selectRequest.fetchInto(entityType())
: selectRequest.fetch(this::mapFieldsToEntity);
} catch (Exception e) {
throw new SqlErrorException("Can not read from DB", e);
}
}