This commit provides more control over JPA entities scanning by allowing the result to be filtered. Closes gh-27892