NativeQueryGenerator Class
- java.
lang. Object - com.
azure. spring. data. cosmos. core. generator. NativeQueryGenerator
- com.
public class NativeQueryGenerator
Augment custom queries sourced from @Query annotations
Constructor Summary
Constructor | Description |
---|---|
NativeQueryGenerator() |
Creates an instance of NativeQueryGenerator. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Sql |
generateCountQuery(SqlQuerySpec querySpec)
Generate count query. |
Sql |
generateSortedQuery(SqlQuerySpec querySpec, Sort sort)
Generate sorted query. |
static
Native |
getInstance()
Return the native query generator instance. |
Methods inherited from java.lang.Object
Constructor Details
NativeQueryGenerator
public NativeQueryGenerator()
Creates an instance of NativeQueryGenerator.
Method Details
generateCountQuery
public SqlQuerySpec generateCountQuery(SqlQuerySpec querySpec)
Generate count query.
Parameters:
querySpec
- SQL query spec.
Returns:
count query
WARNING: This function is only to be used with @Query annotations
generateSortedQuery
public SqlQuerySpec generateSortedQuery(SqlQuerySpec querySpec, Sort sort)
Generate sorted query.
Parameters:
querySpec
- SQL query spec
sort
- Sort
Returns:
sorted query
WARNING: This function is only to be used with @Query annotations
getInstance
public static NativeQueryGenerator getInstance()
Return the native query generator instance.
Returns:
The native query generator instance