HHH-8222 - Implement @NamedStoredProcedureQuery binding

This commit is contained in:
Steve Ebersole 2013-05-09 20:36:14 -05:00
parent e9a54405c2
commit 9a590c8e69
1 changed files with 2 additions and 3 deletions

View File

@ -173,17 +173,16 @@ public class Util {
* @param resultClasses The Classes to which the results should be mapped
*/
public static void resolveResultClasses(ResultClassesResolutionContext context, Class... resultClasses) {
int i = 1;
int i = 0;
for ( Class resultClass : resultClasses ) {
context.addQueryReturns(
new NativeSQLQueryRootReturn( "alias" + i, resultClass.getName(), LockMode.READ )
new NativeSQLQueryRootReturn( "alias" + (++i), resultClass.getName(), LockMode.READ )
);
try {
final EntityPersister persister = context.getSessionFactory().getEntityPersister( resultClass.getName() );
context.addQuerySpaces( (String[]) persister.getQuerySpaces() );
}
catch (Exception ignore) {
}
}
}