// Process the multiple result sets.
call.setHasMultipleResultSets(hasMultipleResultSets());
// Create a JPA query to store internally on the session.
JPAQuery query = new JPAQuery(getName(), call, processQueryHints(session));
if (! m_resultClasses.isEmpty()) {
// Process the multiple result classes.
for (MetadataClass resultClass : m_resultClasses) {
query.addResultClassNames(getJavaClassName(resultClass));
}
} else if (! m_resultSetMappings.isEmpty()) {
// Process the multiple result set mapping.
query.setResultSetMappings(m_resultSetMappings);
} else {
// Legacy support (EclipseLink @NamedStoreProcedureQuery).
if (!getResultClass().isVoid()) {
query.setResultClassName(getJavaClassName(getResultClass()));
} else if (hasResultSetMapping(session)) {
query.addResultSetMapping(getResultSetMapping());
}
}
addJPAQuery(query, session);
}