public interface QueryEnhancer
| Modifier and Type | Method and Description |
|---|---|
default String |
applySorting(Sort sort)
Adds order by clause to the JPQL query.
|
String |
applySorting(Sort sort,
String alias)
Adds order by clause to the JPQL query.
|
default String |
createCountQueryFor()
Creates a count projected query from the given original query.
|
String |
createCountQueryFor(String countProjection)
Creates a count projected query from the given original query using the provided
countProjection. |
String |
detectAlias()
Resolves the alias for the entity to be retrieved from the given JPA query.
|
Set<String> |
getJoinAliases() |
String |
getProjection()
Returns the projection part of the query, i.e. everything between
select and from. |
org.springframework.data.jpa.repository.query.DeclaredQuery |
getQuery()
Gets the query we want to use for enhancements.
|
default boolean |
hasConstructorExpression()
Returns whether the given JPQL query contains a constructor expression.
|
default String applySorting(Sort sort)
sort - the sort specification to apply.String applySorting(Sort sort, @Nullable String alias)
sort - the sort specification to apply.alias - the alias to be used in the order by clause. May be null or empty.@Nullable String detectAlias()
default String createCountQueryFor()
String createCountQueryFor(@Nullable String countProjection)
countProjection.countProjection - may be null.default boolean hasConstructorExpression()
String getProjection()
select and from.org.springframework.data.jpa.repository.query.DeclaredQuery getQuery()
DeclaredQuery that wraps the queryCopyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.