public class DefaultQueryEnhancer extends Object implements QueryEnhancer
QueryEnhancer using QueryUtils.| Constructor and Description |
|---|
DefaultQueryEnhancer(org.springframework.data.jpa.repository.query.DeclaredQuery query) |
| Modifier and Type | Method and Description |
|---|---|
String |
applySorting(Sort sort,
String alias)
Adds order by clause to the JPQL 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplySorting, createCountQueryFor, hasConstructorExpressionpublic DefaultQueryEnhancer(org.springframework.data.jpa.repository.query.DeclaredQuery query)
public String applySorting(Sort sort, @Nullable String alias)
QueryEnhancerapplySorting in interface QueryEnhancersort - the sort specification to apply.alias - the alias to be used in the order by clause. May be null or empty.public String detectAlias()
QueryEnhancerdetectAlias in interface QueryEnhancerpublic String createCountQueryFor(@Nullable String countProjection)
QueryEnhancercountProjection.createCountQueryFor in interface QueryEnhancercountProjection - may be null.public String getProjection()
QueryEnhancerselect and from.getProjection in interface QueryEnhancerpublic Set<String> getJoinAliases()
getJoinAliases in interface QueryEnhancerpublic org.springframework.data.jpa.repository.query.DeclaredQuery getQuery()
QueryEnhancergetQuery in interface QueryEnhancerDeclaredQuery that wraps the queryCopyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.