@@ -140,7 +140,7 @@ public class SqmTreePrinter implements SemanticQueryWalker<Object> {
140
140
private static final Logger LOGGER = QueryLogging .subLogger ( "sqm.ast" );
141
141
private static final boolean DEBUG_ENABLED = LOGGER .isDebugEnabled ();
142
142
143
- public static void logTree (SqmQuerySpec sqmQuerySpec , String header ) {
143
+ public static void logTree (SqmQuerySpec <?> sqmQuerySpec , String header ) {
144
144
if ( ! DEBUG_ENABLED ) {
145
145
return ;
146
146
}
@@ -154,24 +154,24 @@ public static void logTree(SqmQuerySpec sqmQuerySpec, String header) {
154
154
LOGGER .debugf ( "%s :%n%s" , title , treePrinter .buffer .toString () );
155
155
}
156
156
157
- public static void logTree (SqmStatement sqmStatement ) {
157
+ public static void logTree (SqmStatement <?> sqmStatement ) {
158
158
if ( ! DEBUG_ENABLED ) {
159
159
return ;
160
160
}
161
161
162
162
final SqmTreePrinter printer = new SqmTreePrinter ();
163
163
164
- if ( sqmStatement instanceof SqmSelectStatement ) {
165
- printer .visitSelectStatement ( ( SqmSelectStatement ) sqmStatement );
164
+ if ( sqmStatement instanceof SqmSelectStatement <?> statement ) {
165
+ printer .visitSelectStatement ( statement );
166
166
}
167
- else if ( sqmStatement instanceof SqmDeleteStatement <?> ) {
168
- printer .visitDeleteStatement ( ( SqmDeleteStatement ) sqmStatement );
167
+ else if ( sqmStatement instanceof SqmDeleteStatement <?> statement ) {
168
+ printer .visitDeleteStatement ( statement );
169
169
}
170
- else if ( sqmStatement instanceof SqmUpdateStatement ) {
171
- printer .visitUpdateStatement ( ( SqmUpdateStatement ) sqmStatement );
170
+ else if ( sqmStatement instanceof SqmUpdateStatement <?> statement ) {
171
+ printer .visitUpdateStatement ( statement );
172
172
}
173
- else if ( sqmStatement instanceof SqmInsertSelectStatement ) {
174
- printer .visitInsertSelectStatement ( ( SqmInsertSelectStatement ) sqmStatement );
173
+ else if ( sqmStatement instanceof SqmInsertSelectStatement <?> statement ) {
174
+ printer .visitInsertSelectStatement ( statement );
175
175
}
176
176
177
177
LOGGER .debugf ( "SqmStatement Tree :%n%s" , printer .buffer .toString () );
@@ -257,11 +257,11 @@ private void logWithIndentation(String pattern, Object arg1) {
257
257
}
258
258
259
259
private void logWithIndentation (String pattern , Object arg1 , Object arg2 ) {
260
- logWithIndentation ( String .format ( pattern , arg1 , arg2 ) );
260
+ logWithIndentation ( String .format ( pattern , arg1 , arg2 ) );
261
261
}
262
262
263
263
private void logWithIndentation (String pattern , Object ... args ) {
264
- logWithIndentation ( String .format ( pattern , args ) );
264
+ logWithIndentation ( String .format ( pattern , args ) );
265
265
}
266
266
267
267
private void logIndented (String line ) {
@@ -386,7 +386,7 @@ public Object visitSelectStatement(SqmSelectStatement<?> statement) {
386
386
}
387
387
388
388
@ Override
389
- public Object visitCteStatement (SqmCteStatement sqmCteStatement ) {
389
+ public Object visitCteStatement (SqmCteStatement <?> sqmCteStatement ) {
390
390
if ( DEBUG_ENABLED ) {
391
391
logIndented ( "cte" );
392
392
}
@@ -536,7 +536,7 @@ public Object visitFromClause(SqmFromClause fromClause) {
536
536
}
537
537
538
538
@ Override
539
- public Object visitRootPath (SqmRoot sqmRoot ) {
539
+ public Object visitRootPath (SqmRoot <?> sqmRoot ) {
540
540
processStanza (
541
541
"root" ,
542
542
"`" + sqmRoot .getNavigablePath () + "`" ,
@@ -551,21 +551,17 @@ public Object visitRootDerived(SqmDerivedRoot<?> sqmRoot) {
551
551
processStanza (
552
552
"derived" ,
553
553
"`" + sqmRoot .getNavigablePath () + "`" ,
554
- () -> {
555
- processJoins ( sqmRoot );
556
- }
554
+ () -> processJoins ( sqmRoot )
557
555
);
558
556
return null ;
559
557
}
560
558
561
559
@ Override
562
- public Object visitRootFunction (SqmFunctionRoot sqmRoot ) {
560
+ public Object visitRootFunction (SqmFunctionRoot <?> sqmRoot ) {
563
561
processStanza (
564
562
"derived" ,
565
563
"`" + sqmRoot .getNavigablePath () + "`" ,
566
- () -> {
567
- processJoins ( sqmRoot );
568
- }
564
+ () -> processJoins ( sqmRoot )
569
565
);
570
566
return null ;
571
567
}
@@ -575,9 +571,7 @@ public Object visitRootCte(SqmCteRoot<?> sqmRoot) {
575
571
processStanza (
576
572
"cte" ,
577
573
"`" + sqmRoot .getNavigablePath () + "`" ,
578
- () -> {
579
- processJoins ( sqmRoot );
580
- }
574
+ () -> processJoins ( sqmRoot )
581
575
);
582
576
return null ;
583
577
}
@@ -594,7 +588,7 @@ private void processJoins(SqmFrom<?,?> sqmFrom) {
594
588
}
595
589
596
590
@ Override
597
- public Object visitCrossJoin (SqmCrossJoin joinedFromElement ) {
591
+ public Object visitCrossJoin (SqmCrossJoin <?> joinedFromElement ) {
598
592
processStanza (
599
593
"cross" ,
600
594
"`" + joinedFromElement .getNavigablePath () + "`" ,
@@ -630,7 +624,7 @@ private void processJoinPredicate(SqmJoin<?, ?> joinedFromElement) {
630
624
}
631
625
632
626
@ Override
633
- public Object visitQualifiedEntityJoin (SqmEntityJoin joinedFromElement ) {
627
+ public Object visitQualifiedEntityJoin (SqmEntityJoin <?,?> joinedFromElement ) {
634
628
if ( inJoinPredicate ) {
635
629
logWithIndentation ( "-> [joined-path] - `%s`" , joinedFromElement .getNavigablePath () );
636
630
}
@@ -648,7 +642,7 @@ public Object visitQualifiedEntityJoin(SqmEntityJoin joinedFromElement) {
648
642
}
649
643
650
644
@ Override
651
- public Object visitQualifiedAttributeJoin (SqmAttributeJoin joinedFromElement ) {
645
+ public Object visitQualifiedAttributeJoin (SqmAttributeJoin <?,?> joinedFromElement ) {
652
646
if ( inJoinPredicate ) {
653
647
logWithIndentation ( "-> [joined-path] - `%s`" , joinedFromElement .getNavigablePath () );
654
648
}
@@ -722,14 +716,14 @@ public Object visitQualifiedCteJoin(SqmCteJoin<?> joinedFromElement) {
722
716
}
723
717
724
718
@ Override
725
- public Object visitBasicValuedPath (SqmBasicValuedSimplePath path ) {
719
+ public Object visitBasicValuedPath (SqmBasicValuedSimplePath <?> path ) {
726
720
logWithIndentation ( "-> [basic-path] - `%s`" , path .getNavigablePath () );
727
721
728
722
return null ;
729
723
}
730
724
731
725
@ Override
732
- public Object visitEmbeddableValuedPath (SqmEmbeddedValuedSimplePath path ) {
726
+ public Object visitEmbeddableValuedPath (SqmEmbeddedValuedSimplePath <?> path ) {
733
727
logWithIndentation ( "-> [embedded-path] - `%s`" , path .getNavigablePath () );
734
728
735
729
return null ;
@@ -764,14 +758,14 @@ public Object visitDiscriminatorPath(DiscriminatorSqmPath<?> sqmPath) {
764
758
}
765
759
766
760
@ Override
767
- public Object visitEntityValuedPath (SqmEntityValuedSimplePath path ) {
761
+ public Object visitEntityValuedPath (SqmEntityValuedSimplePath <?> path ) {
768
762
logWithIndentation ( "-> [entity-path] - `%s`" , path .getNavigablePath () );
769
763
770
764
return null ;
771
765
}
772
766
773
767
@ Override
774
- public Object visitPluralValuedPath (SqmPluralValuedSimplePath path ) {
768
+ public Object visitPluralValuedPath (SqmPluralValuedSimplePath <?> path ) {
775
769
logWithIndentation ( "-> [plural-path] - `%s`" , path .getNavigablePath () );
776
770
777
771
return null ;
@@ -783,7 +777,7 @@ public Object visitIndexedPluralAccessPath(SqmIndexedCollectionAccessPath<?> pat
783
777
}
784
778
785
779
@ Override
786
- public Object visitTreatedPath (SqmTreatedPath sqmTreatedPath ) {
780
+ public Object visitTreatedPath (SqmTreatedPath <?,?> sqmTreatedPath ) {
787
781
return null ;
788
782
}
789
783
@@ -803,7 +797,7 @@ public Object visitSelectClause(SqmSelectClause selectClause) {
803
797
}
804
798
805
799
@ Override
806
- public Object visitSelection (SqmSelection selection ) {
800
+ public Object visitSelection (SqmSelection <?> selection ) {
807
801
processStanza (
808
802
selection .getAlias () == null ? "selection" : "selection(" + selection .getAlias () + ")" ,
809
803
() -> selection .getSelectableNode ().accept ( this )
@@ -818,26 +812,26 @@ public Object visitValues(SqmValues values) {
818
812
}
819
813
820
814
@ Override
821
- public Object visitPositionalParameterExpression (SqmPositionalParameter expression ) {
815
+ public Object visitPositionalParameterExpression (SqmPositionalParameter <?> expression ) {
822
816
logWithIndentation ( "?%s" , expression .getPosition () );
823
817
824
818
return null ;
825
819
}
826
820
827
821
@ Override
828
- public Object visitNamedParameterExpression (SqmNamedParameter expression ) {
822
+ public Object visitNamedParameterExpression (SqmNamedParameter <?> expression ) {
829
823
logWithIndentation ( ":%s" , expression .getName () );
830
824
831
825
return null ;
832
826
}
833
827
834
828
@ Override
835
- public Object visitJpaCriteriaParameter (JpaCriteriaParameter expression ) {
829
+ public Object visitJpaCriteriaParameter (JpaCriteriaParameter <?> expression ) {
836
830
return null ;
837
831
}
838
832
839
833
@ Override
840
- public Object visitEntityTypeLiteralExpression (SqmLiteralEntityType expression ) {
834
+ public Object visitEntityTypeLiteralExpression (SqmLiteralEntityType <?> expression ) {
841
835
return null ;
842
836
}
843
837
@@ -847,12 +841,12 @@ public Object visitEmbeddableTypeLiteralExpression(SqmLiteralEmbeddableType<?> e
847
841
}
848
842
849
843
@ Override
850
- public Object visitParameterizedEntityTypeExpression (SqmParameterizedEntityType expression ) {
844
+ public Object visitParameterizedEntityTypeExpression (SqmParameterizedEntityType <?> expression ) {
851
845
return null ;
852
846
}
853
847
854
848
@ Override
855
- public Object visitUnaryOperationExpression (SqmUnaryOperation expression ) {
849
+ public Object visitUnaryOperationExpression (SqmUnaryOperation <?> expression ) {
856
850
return null ;
857
851
}
858
852
@@ -1066,12 +1060,12 @@ public Object visitNegatedPredicate(SqmNegatedPredicate predicate) {
1066
1060
}
1067
1061
1068
1062
@ Override
1069
- public Object visitInListPredicate (SqmInListPredicate predicate ) {
1063
+ public Object visitInListPredicate (SqmInListPredicate <?> predicate ) {
1070
1064
return null ;
1071
1065
}
1072
1066
1073
1067
@ Override
1074
- public Object visitInSubQueryPredicate (SqmInSubQueryPredicate predicate ) {
1068
+ public Object visitInSubQueryPredicate (SqmInSubQueryPredicate <?> predicate ) {
1075
1069
return null ;
1076
1070
}
1077
1071
@@ -1096,12 +1090,12 @@ public Object visitSortSpecification(SqmSortSpecification sortSpecification) {
1096
1090
}
1097
1091
1098
1092
@ Override
1099
- public Object visitOffsetExpression (SqmExpression expression ) {
1093
+ public Object visitOffsetExpression (SqmExpression <?> expression ) {
1100
1094
return null ;
1101
1095
}
1102
1096
1103
1097
@ Override
1104
- public Object visitFetchExpression (SqmExpression expression ) {
1098
+ public Object visitFetchExpression (SqmExpression <?> expression ) {
1105
1099
return null ;
1106
1100
}
1107
1101
@@ -1116,12 +1110,12 @@ public Object visitMapEntryFunction(SqmMapEntryReference<?, ?> function) {
1116
1110
}
1117
1111
1118
1112
@ Override
1119
- public Object visitElementAggregateFunction (SqmElementAggregateFunction binding ) {
1113
+ public Object visitElementAggregateFunction (SqmElementAggregateFunction <?> binding ) {
1120
1114
return null ;
1121
1115
}
1122
1116
1123
1117
@ Override
1124
- public Object visitIndexAggregateFunction (SqmIndexAggregateFunction path ) {
1118
+ public Object visitIndexAggregateFunction (SqmIndexAggregateFunction <?> path ) {
1125
1119
return null ;
1126
1120
}
1127
1121
@@ -1131,12 +1125,12 @@ public Object visitFunctionPath(SqmFunctionPath<?> functionPath) {
1131
1125
}
1132
1126
1133
1127
@ Override
1134
- public Object visitLiteral (SqmLiteral literal ) {
1128
+ public Object visitLiteral (SqmLiteral <?> literal ) {
1135
1129
return null ;
1136
1130
}
1137
1131
1138
1132
@ Override
1139
- public Object visitTuple (SqmTuple sqmTuple ) {
1133
+ public Object visitTuple (SqmTuple <?> sqmTuple ) {
1140
1134
return null ;
1141
1135
}
1142
1136
@@ -1146,22 +1140,22 @@ public Object visitCollation(SqmCollation sqmCollate) {
1146
1140
}
1147
1141
1148
1142
@ Override
1149
- public Object visitBinaryArithmeticExpression (SqmBinaryArithmetic expression ) {
1143
+ public Object visitBinaryArithmeticExpression (SqmBinaryArithmetic <?> expression ) {
1150
1144
return null ;
1151
1145
}
1152
1146
1153
1147
@ Override
1154
- public Object visitSubQueryExpression (SqmSubQuery expression ) {
1148
+ public Object visitSubQueryExpression (SqmSubQuery <?> expression ) {
1155
1149
return null ;
1156
1150
}
1157
1151
1158
1152
@ Override
1159
- public Object visitSimpleCaseExpression (SqmCaseSimple expression ) {
1153
+ public Object visitSimpleCaseExpression (SqmCaseSimple <?,?> expression ) {
1160
1154
return null ;
1161
1155
}
1162
1156
1163
1157
@ Override
1164
- public Object visitSearchedCaseExpression (SqmCaseSearched expression ) {
1158
+ public Object visitSearchedCaseExpression (SqmCaseSearched <?> expression ) {
1165
1159
return null ;
1166
1160
}
1167
1161
@@ -1191,12 +1185,12 @@ public Object visitAnyDiscriminatorTypeValueExpression(SqmAnyDiscriminatorValue<
1191
1185
}
1192
1186
1193
1187
@ Override
1194
- public Object visitDynamicInstantiation (SqmDynamicInstantiation sqmDynamicInstantiation ) {
1188
+ public Object visitDynamicInstantiation (SqmDynamicInstantiation <?> sqmDynamicInstantiation ) {
1195
1189
processStanza (
1196
1190
"dynamic-instantiation (" + sqmDynamicInstantiation .getInstantiationTarget ().getJavaType () + ')' ,
1197
1191
() -> processStanza (
1198
1192
"arguments" ,
1199
- () -> ( ( SqmDynamicInstantiation <?>) sqmDynamicInstantiation ) .getArguments ().forEach (
1193
+ () -> sqmDynamicInstantiation .getArguments ().forEach (
1200
1194
argument -> processStanza (
1201
1195
"argument (" + argument .getAlias () + ')' ,
1202
1196
() -> {
@@ -1228,12 +1222,12 @@ public <N extends Number> Object visitHqlNumericLiteral(SqmHqlNumericLiteral<N>
1228
1222
}
1229
1223
1230
1224
@ Override
1231
- public Object visitFullyQualifiedClass (Class namedClass ) {
1225
+ public Object visitFullyQualifiedClass (Class <?> namedClass ) {
1232
1226
return null ;
1233
1227
}
1234
1228
1235
1229
@ Override
1236
- public Object visitAsWrapperExpression (AsWrapperSqmExpression expression ) {
1230
+ public Object visitAsWrapperExpression (AsWrapperSqmExpression <?> expression ) {
1237
1231
return null ;
1238
1232
}
1239
1233
@@ -1243,7 +1237,7 @@ public Object visitNamedExpression(SqmNamedExpression<?> expression) {
1243
1237
}
1244
1238
1245
1239
@ Override
1246
- public Object visitModifiedSubQueryExpression (SqmModifiedSubQueryExpression expression ) {
1240
+ public Object visitModifiedSubQueryExpression (SqmModifiedSubQueryExpression <?> expression ) {
1247
1241
return null ;
1248
1242
}
1249
1243
}
0 commit comments