contextType = JPQLContextType.JOIN;
} else {
contextType = JPQLContextType.SELECT;
}
JPQLContext jpqlContext = JPQLContext.createBuilder(contextType, resultsView).build();
JPQLStatement jpqlStatement = JPQLStatement.createBuilder(jpqlContext).build();
String deltaToken = ODataJPATombstoneContext.getDeltaToken();
Query query = null;
if (deltaToken != null) {
String statement = jpqlStatement.toString();
String[] statementParts = statement.split(JPQLStatement.KEYWORD.WHERE);
String deltaCondition = jpqlContext.getJPAEntityAlias() + ".creationDate >= {ts '" + deltaToken + "'}";
if (statementParts.length > 1) {
statement =
statementParts[0] + JPQLStatement.DELIMITER.SPACE + JPQLStatement.KEYWORD.WHERE
+ JPQLStatement.DELIMITER.SPACE + deltaCondition + JPQLStatement.DELIMITER.SPACE
+ JPQLStatement.Operator.AND + statementParts[1];