INT-2881: Add support for the firstRecord to retrieving JPA gateway

JIRA: https://jira.springsource.org/browse/INT-2881