}
@Override
public StoredProcedureQuery createNamedStoredProcedureQuery(String name) {
checkOpen();
final ProcedureCallMemento memento = ( (SessionImplementor) internalGetSession() ).getFactory()
.getNamedQueryRepository().getNamedProcedureCallMemento( name );
if ( memento == null ) {
throw new IllegalArgumentException( "No @NamedStoredProcedureQuery was found with that name : " + name );
}
final ProcedureCall procedureCall = memento.makeProcedureCall( internalGetSession() );
final StoredProcedureQueryImpl jpaImpl = new StoredProcedureQueryImpl( procedureCall, this );
// apply hints
if ( memento.getHintsMap() != null ) {
for ( Map.Entry<String,Object> hintEntry : memento.getHintsMap().entrySet() ) {
jpaImpl.setHint( hintEntry.getKey(), hintEntry.getValue() );
}
}
return jpaImpl;
}