@Internal public class JpaQueryBuilder extends AbstractSqlLikeQueryBuilder implements QueryBuilder
AbstractSqlLikeQueryBuilder.Placeholder, AbstractSqlLikeQueryBuilder.PropertyPath, AbstractSqlLikeQueryBuilder.QueryHandler, AbstractSqlLikeQueryBuilder.QueryPosition, AbstractSqlLikeQueryBuilder.QueryStateAND, AS_CLAUSE, AVG, CLOSE_BRACKET, COMMA, COUNT_DISTINCT, DELETE_CLAUSE, DISTINCT, DOT, EQUALS_FALSE, EQUALS_TRUE, FROM_CLAUSE, FUNCTION_COUNT, GREATER_THAN, GREATER_THAN_OR_EQUALS, IS_EMPTY, IS_NOT_EMPTY, IS_NOT_NULL, IS_NULL, LESS_THAN, LESS_THAN_OR_EQUALS, LOGICAL_AND, LOGICAL_OR, MAX, MIN, NOT_CLAUSE, NOT_EQUALS, OPEN_BRACKET, OR, ORDER_BY_CLAUSE, queryHandlers, SELECT_CLAUSE, SPACE, SUM, UPDATE_CLAUSE, WHERE_CLAUSEIN_VARIABLES_PATTERN, VARIABLE_PATTERN| Constructor and Description |
|---|
JpaQueryBuilder()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.StringBuilder |
appendDeleteClause(java.lang.StringBuilder queryString)
Append the delete clause.
|
protected void |
appendProjectionRowCount(java.lang.StringBuilder queryString,
java.lang.String logicalName)
Appends a row count projection to the query string.
|
QueryResult |
buildInsert(io.micronaut.core.annotation.AnnotationMetadata repositoryMetadata,
PersistentEntity entity)
Builds an insert statement for the given entity.
|
protected java.lang.String[] |
buildJoin(java.lang.String alias,
JoinPath joinPath,
java.lang.String joinType,
java.lang.StringBuilder target,
java.util.Map<java.lang.String,java.lang.String> appliedJoinPaths,
AbstractSqlLikeQueryBuilder.QueryState queryState)
Build a join expression for the given alias, association, join type and builder.
|
QueryResult |
buildPagination(Pageable pageable)
Encode the pageable.
|
protected boolean |
computePropertyPaths()
Whether property path expressions require computation by the implementation.
|
protected AbstractSqlLikeQueryBuilder.Placeholder |
formatParameter(int index)
Format the parameter at the given index.
|
java.lang.String |
getAliasName(PersistentEntity entity)
Get an alias name for the given entity.
|
protected java.lang.String |
getColumnName(PersistentProperty persistentProperty)
Get the column name for the given property.
|
protected java.lang.String |
getTableName(PersistentEntity entity)
Get the table name for the given entity.
|
protected boolean |
isAliasForBatch()
Should aliases be used in batch statements.
|
protected java.lang.String |
quote(java.lang.String persistedName)
Quote a column name for the dialect.
|
java.lang.String |
resolveJoinType(Join.Type jt)
Resolves the join type.
|
protected void |
selectAllColumns(AbstractSqlLikeQueryBuilder.QueryState queryState,
java.lang.StringBuilder queryBuffer)
Obtain the string that selects all columns from the entity.
|
protected void |
selectAllColumns(PersistentEntity entity,
java.lang.String alias,
java.lang.StringBuilder queryBuffer)
Selects all columns for the given entity and alias.
|
appendForUpdate, appendUpdateSetParameter, buildDelete, buildOrderBy, buildQuery, buildUpdate, computeEmbeddedName, encodeInExpression, formatEndsWith, formatStartsWith, formatStartsWithBeginning, formEndsWithEnd, getAliasName, getPathOnlyAliasName, getTableAsKeyword, getUnescapedTableName, handleSubQuery, isExpandEmbedded, shouldEscapeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuildDelete, buildDelete, buildOrderBy, buildQuery, buildQuery, buildUpdate, buildUpdate, newQueryBuilder, shouldAliasProjections, supportsForUpdateprotected java.lang.String quote(java.lang.String persistedName)
AbstractSqlLikeQueryBuilderquote in class AbstractSqlLikeQueryBuilderpersistedName - The persisted name.public java.lang.String getAliasName(PersistentEntity entity)
AbstractSqlLikeQueryBuildergetAliasName in class AbstractSqlLikeQueryBuilderentity - The entityprotected java.lang.String[] buildJoin(java.lang.String alias,
JoinPath joinPath,
java.lang.String joinType,
java.lang.StringBuilder target,
java.util.Map<java.lang.String,java.lang.String> appliedJoinPaths,
AbstractSqlLikeQueryBuilder.QueryState queryState)
AbstractSqlLikeQueryBuilderbuildJoin in class AbstractSqlLikeQueryBuilderalias - The aliasjoinPath - The join pathjoinType - The join type stringtarget - The target builderappliedJoinPaths - The applied joins pathsqueryState - The query stateprotected java.lang.String getTableName(PersistentEntity entity)
AbstractSqlLikeQueryBuildergetTableName in class AbstractSqlLikeQueryBuilderentity - The entityprotected java.lang.String getColumnName(PersistentProperty persistentProperty)
AbstractSqlLikeQueryBuildergetColumnName in class AbstractSqlLikeQueryBuilderpersistentProperty - The propertyprotected void selectAllColumns(AbstractSqlLikeQueryBuilder.QueryState queryState, java.lang.StringBuilder queryBuffer)
AbstractSqlLikeQueryBuilderselectAllColumns in class AbstractSqlLikeQueryBuilderqueryState - The query stateprotected void selectAllColumns(PersistentEntity entity, java.lang.String alias, java.lang.StringBuilder queryBuffer)
AbstractSqlLikeQueryBuilderselectAllColumns in class AbstractSqlLikeQueryBuilderentity - The entityalias - The aliasqueryBuffer - The buffer to append the columnsprotected void appendProjectionRowCount(java.lang.StringBuilder queryString,
java.lang.String logicalName)
AbstractSqlLikeQueryBuilderappendProjectionRowCount in class AbstractSqlLikeQueryBuilderqueryString - The query stringlogicalName - The alias to the table nameprotected final boolean computePropertyPaths()
AbstractSqlLikeQueryBuildercomputePropertyPaths in class AbstractSqlLikeQueryBuilderprotected boolean isAliasForBatch()
AbstractSqlLikeQueryBuilderisAliasForBatch in class AbstractSqlLikeQueryBuilderprotected AbstractSqlLikeQueryBuilder.Placeholder formatParameter(int index)
AbstractSqlLikeQueryBuilderformatParameter in class AbstractSqlLikeQueryBuilderindex - The parameterpublic java.lang.String resolveJoinType(Join.Type jt)
AbstractSqlLikeQueryBuilderresolveJoinType in class AbstractSqlLikeQueryBuilderjt - The join type@Nullable public QueryResult buildInsert(io.micronaut.core.annotation.AnnotationMetadata repositoryMetadata, PersistentEntity entity)
QueryBuilderbuildInsert in interface QueryBuilderrepositoryMetadata - The repository annotation metadataentity - The entity@NonNull protected java.lang.StringBuilder appendDeleteClause(java.lang.StringBuilder queryString)
AbstractSqlLikeQueryBuilderappendDeleteClause in class AbstractSqlLikeQueryBuilderqueryString - The query string@NonNull public QueryResult buildPagination(@NonNull Pageable pageable)
QueryBuilderbuildPagination in interface QueryBuilderpageable - The pageable