With the jsqlparser it should be possible to visit any selected items to see if there are any specified names so that they could be validated against the result class. Note that this will not be possible with wildcards.
Something like this could be used to find the selected items from a plain select.
PlainSelect plainSelect = (PlainSelect) selectStatement.getSelectBody();
List selectItems = plainSelect.getSelectItems();
SelectItem has three subclasses, but only SelectExpressionItem has aliases that could be used for static validation.
With the jsqlparser it should be possible to visit any selected items to see if there are any specified names so that they could be validated against the result class. Note that this will not be possible with wildcards.
Something like this could be used to find the selected items from a plain select.
SelectItem has three subclasses, but only SelectExpressionItem has aliases that could be used for static validation.