Class NativeQueryGenerator
java.lang.Object
com.azure.spring.data.cosmos.core.generator.NativeQueryGenerator
Augment custom queries sourced from @Query annotations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.azure.cosmos.models.SqlQuerySpecgenerateCountQuery(com.azure.cosmos.models.SqlQuerySpec querySpec) Generate count query.com.azure.cosmos.models.SqlQuerySpecgenerateSortedQuery(com.azure.cosmos.models.SqlQuerySpec querySpec, org.springframework.data.domain.Sort sort) Generate sorted query.static NativeQueryGeneratorReturn the native query generator instance.
-
Constructor Details
-
NativeQueryGenerator
public NativeQueryGenerator()Creates an instance ofNativeQueryGenerator.
-
-
Method Details
-
getInstance
Return the native query generator instance.- Returns:
- The native query generator instance
-
generateSortedQuery
public com.azure.cosmos.models.SqlQuerySpec generateSortedQuery(com.azure.cosmos.models.SqlQuerySpec querySpec, org.springframework.data.domain.Sort sort) Generate sorted query.- Parameters:
querySpec- SQL query specsort- Sort- Returns:
- sorted query WARNING: This function is only to be used with @Query annotations
-
generateCountQuery
public com.azure.cosmos.models.SqlQuerySpec generateCountQuery(com.azure.cosmos.models.SqlQuerySpec querySpec) Generate count query.- Parameters:
querySpec- SQL query spec.- Returns:
- count query WARNING: This function is only to be used with @Query annotations
-