@@ -2562,6 +2562,16 @@ private void checkOrdinalParameter(
25622562 }
25632563 }
25642564
2565+ private static String stripTypeAnnotations (String argType ) {
2566+ while ( argType .startsWith ("@" ) ) {
2567+ int index = argType .indexOf (' ' );
2568+ if (index >0 ) {
2569+ argType = argType .substring (index +1 );
2570+ }
2571+ }
2572+ return argType ;
2573+ }
2574+
25652575 private void checkNamedParameter (
25662576 SqmParameter <?> param , List <String > paramNames , List <String > paramTypes , ExecutableElement method ,
25672577 AnnotationMirror mirror , AnnotationValue value , String queryParamType ) {
@@ -2584,7 +2594,8 @@ private void checkNamedParameter(
25842594 }
25852595 }
25862596
2587- private static boolean isLegalAssignment (SqmParameter <?> param , String argType , String queryParamType ) {
2597+ private static boolean isLegalAssignment (SqmParameter <?> param , String argumentType , String queryParamType ) {
2598+ final String argType = stripTypeAnnotations (argumentType );
25882599 return param .allowMultiValuedBinding ()
25892600 ? isLegalAssignment (argType , LIST + '<' + queryParamType + '>' )
25902601 : isLegalAssignment (argType , queryParamType );
@@ -2636,7 +2647,12 @@ private List<String> parameterTypes(ExecutableElement method) {
26362647 private String typeAsString (TypeMirror type ) {
26372648 String result = type .toString ();
26382649 for ( AnnotationMirror annotation : type .getAnnotationMirrors () ) {
2639- result = result .replace (annotation .toString (), "" );
2650+ final String annotationString = annotation .toString ();
2651+ result = result
2652+ // if it has a space after it, we need to remove that too
2653+ .replace (annotationString + ' ' , "" )
2654+ // just in case it did not have a space after it
2655+ .replace (annotationString , "" );
26402656 }
26412657 for ( AnnotationMirror annotation : type .getAnnotationMirrors () ) {
26422658 result = annotation .toString () + ' ' + result ;
0 commit comments