@@ -114,7 +114,7 @@ public class ProcedureCallImpl<R>
114114 private FunctionReturnImpl <R > functionReturn ;
115115
116116 private final ProcedureParameterMetadataImpl parameterMetadata ;
117- private final ProcedureParamBindings paramBindings ;
117+ private final ProcedureParamBindings parameterBindings ;
118118
119119 private final ResultSetMapping resultSetMapping ;
120120
@@ -136,7 +136,7 @@ public ProcedureCallImpl(SharedSessionContractImplementor session, String proced
136136 this .procedureName = procedureName ;
137137
138138 this .parameterMetadata = new ProcedureParameterMetadataImpl ();
139- this .paramBindings = new ProcedureParamBindings ( parameterMetadata , getSessionFactory () );
139+ this .parameterBindings = new ProcedureParamBindings ( parameterMetadata , getSessionFactory () );
140140
141141 this .resultSetMapping = resolveResultSetMapping ( procedureName , true , session .getSessionFactory () );
142142
@@ -158,7 +158,7 @@ public ProcedureCallImpl(SharedSessionContractImplementor session, String proced
158158 this .procedureName = procedureName ;
159159
160160 this .parameterMetadata = new ProcedureParameterMetadataImpl ();
161- this .paramBindings = new ProcedureParamBindings ( parameterMetadata , getSessionFactory () );
161+ this .parameterBindings = new ProcedureParamBindings ( parameterMetadata , getSessionFactory () );
162162
163163 this .synchronizedQuerySpaces = new HashSet <>();
164164
@@ -192,7 +192,7 @@ public ProcedureCallImpl(
192192 this .procedureName = procedureName ;
193193
194194 this .parameterMetadata = new ProcedureParameterMetadataImpl ();
195- this .paramBindings = new ProcedureParamBindings ( parameterMetadata , getSessionFactory () );
195+ this .parameterBindings = new ProcedureParamBindings ( parameterMetadata , getSessionFactory () );
196196
197197 this .synchronizedQuerySpaces = new HashSet <>();
198198
@@ -219,7 +219,7 @@ public ProcedureCallImpl(
219219 this .procedureName = memento .getCallableName ();
220220
221221 this .parameterMetadata = new ProcedureParameterMetadataImpl ( memento , session );
222- this .paramBindings = new ProcedureParamBindings ( parameterMetadata , getSessionFactory () );
222+ this .parameterBindings = new ProcedureParamBindings ( parameterMetadata , getSessionFactory () );
223223
224224 this .synchronizedQuerySpaces = CollectionHelper .makeCopy ( memento .getQuerySpaces () );
225225
@@ -251,7 +251,7 @@ public ProcedureCallImpl(
251251 this .procedureName = memento .getCallableName ();
252252
253253 this .parameterMetadata = new ProcedureParameterMetadataImpl ( memento , session );
254- this .paramBindings = new ProcedureParamBindings ( parameterMetadata , getSessionFactory () );
254+ this .parameterBindings = new ProcedureParamBindings ( parameterMetadata , getSessionFactory () );
255255
256256 this .synchronizedQuerySpaces = CollectionHelper .makeCopy ( memento .getQuerySpaces () );
257257
@@ -278,7 +278,7 @@ public ProcedureCallImpl(
278278 this .procedureName = memento .getCallableName ();
279279
280280 this .parameterMetadata = new ProcedureParameterMetadataImpl ( memento , session );
281- this .paramBindings = new ProcedureParamBindings ( parameterMetadata , getSessionFactory () );
281+ this .parameterBindings = new ProcedureParamBindings ( parameterMetadata , getSessionFactory () );
282282
283283 this .synchronizedQuerySpaces = CollectionHelper .makeCopy ( memento .getQuerySpaces () );
284284
@@ -344,7 +344,7 @@ public ProcedureParameterMetadataImpl getParameterMetadata() {
344344
345345 @ Override
346346 public QueryParameterBindings getQueryParameterBindings () {
347- return paramBindings ;
347+ return parameterBindings ;
348348 }
349349
350350 public ParameterStrategy getParameterStrategy () {
@@ -408,7 +408,7 @@ private void markAsFunctionCall(BasicType<?> basicType) {
408408
409409 @ Override
410410 public QueryParameterBindings getParameterBindings () {
411- return paramBindings ;
411+ return parameterBindings ;
412412 }
413413
414414 @ Override
@@ -1007,33 +1007,36 @@ else if ( resultList.size() > 1 ) {
10071007 }
10081008
10091009 @ Override
1010- @ SuppressWarnings ("unchecked" )
1011- public <T > T unwrap (Class <T > cls ) {
1012- if ( cls .isInstance ( this ) ) {
1013- return (T ) this ;
1010+ public <T > T unwrap (Class <T > type ) {
1011+ if ( type .isInstance ( this ) ) {
1012+ return type .cast ( this );
10141013 }
10151014
1016- if ( cls .isInstance ( parameterMetadata ) ) {
1017- return ( T ) parameterMetadata ;
1015+ if ( type .isInstance ( parameterMetadata ) ) {
1016+ return type . cast ( parameterMetadata ) ;
10181017 }
10191018
1020- if ( cls .isInstance ( paramBindings ) ) {
1021- return ( T ) paramBindings ;
1019+ if ( type .isInstance ( parameterBindings ) ) {
1020+ return type . cast ( parameterBindings ) ;
10221021 }
10231022
1024- if ( cls .isInstance ( queryOptions ) ) {
1025- return ( T ) queryOptions ;
1023+ if ( type .isInstance ( getQueryOptions () ) ) {
1024+ return type . cast ( getQueryOptions () ) ;
10261025 }
10271026
1028- if ( cls .isInstance ( getSession () ) ) {
1029- return ( T ) getSession ( );
1027+ if ( type .isInstance ( getQueryOptions (). getAppliedGraph () ) ) {
1028+ return type . cast ( getQueryOptions (). getAppliedGraph () );
10301029 }
10311030
1032- if ( ProcedureOutputs . class . isAssignableFrom ( cls ) ) {
1033- return ( T ) getOutputs ( );
1031+ if ( type . isInstance ( getSession () ) ) {
1032+ return type . cast ( getSession () );
10341033 }
10351034
1036- throw new PersistenceException ( "Unrecognized unwrap type : " + cls .getName () );
1035+ if ( type .isInstance ( getOutputs () ) ) {
1036+ return type .cast ( getOutputs () );
1037+ }
1038+
1039+ throw new PersistenceException ( "Unrecognized unwrap type [" + type .getName () + "]" );
10371040 }
10381041
10391042 @ Override
0 commit comments