Applied patch from jira issue OFBIZ-5844 - Convert java files to EntityQuery. Thanks Arun for the contribution.