@@ -371,11 +371,8 @@ public void visitQuerySpec(QuerySpec querySpec) {
371
371
var stages = new ArrayList <AstStage >(3 );
372
372
373
373
createMatchStage (querySpec ).ifPresent (stages ::add );
374
-
375
374
createSortStage (querySpec ).ifPresent (stages ::add );
376
-
377
- var projectStageSpecifications = acceptAndYield (querySpec .getSelectClause (), PROJECT_STAGE_SPECIFICATIONS );
378
- stages .add (new AstProjectStage (projectStageSpecifications ));
375
+ stages .add (createProjectStage (querySpec .getSelectClause ()));
379
376
380
377
astVisitorValueHolder .yield (COLLECTION_AGGREGATE , new AstAggregateCommand (collection , stages ));
381
378
}
@@ -402,6 +399,11 @@ private Optional<AstSortStage> createSortStage(QuerySpec querySpec) {
402
399
return Optional .empty ();
403
400
}
404
401
402
+ private AstProjectStage createProjectStage (SelectClause selectClause ) {
403
+ var projectStageSpecifications = acceptAndYield (selectClause , PROJECT_STAGE_SPECIFICATIONS );
404
+ return new AstProjectStage (projectStageSpecifications );
405
+ }
406
+
405
407
@ Override
406
408
public void visitFromClause (FromClause fromClause ) {
407
409
if (fromClause .getRoots ().size () != 1 ) {
@@ -549,7 +551,7 @@ public void visitSortSpecification(SortSpecification sortSpecification) {
549
551
format ("%s does not support null precedence: NULLS %s" , MONGO_DBMS_NAME , nullPrecedence ));
550
552
}
551
553
if (sortSpecification .isIgnoreCase ()) {
552
- throw new FeatureNotSupportedException ("Case-insensitive sorting not supported " );
554
+ throw new FeatureNotSupportedException ("TODO-HIBERNATE-79 https://jira.mongodb.org/browse/HIBERNATE-79 " );
553
555
}
554
556
555
557
var astSortOrder =
@@ -574,8 +576,7 @@ public void visitSortSpecification(SortSpecification sortSpecification) {
574
576
575
577
private AstSortField createAstSortField (Expression sortExpression , AstSortOrder astSortOrder ) {
576
578
if (!isFieldPathExpression (sortExpression )) {
577
- throw new FeatureNotSupportedException (
578
- format ("%s does not support sort key not of field path type" , MONGO_DBMS_NAME ));
579
+ throw new FeatureNotSupportedException ("TODO-HIBERNATE-79 https://jira.mongodb.org/browse/HIBERNATE-79" );
579
580
}
580
581
var fieldPath = acceptAndYield (sortExpression , FIELD_PATH );
581
582
return new AstSortField (fieldPath , astSortOrder );
0 commit comments