@Internal public class JpaQueryBuilder extends AbstractSqlLikeQueryBuilder implements QueryBuilder
AbstractSqlLikeQueryBuilder.Placeholder, AbstractSqlLikeQueryBuilder.PropertyPath, AbstractSqlLikeQueryBuilder.QueryHandler, AbstractSqlLikeQueryBuilder.QueryState
AS_CLAUSE, CLOSE_BRACKET, COMMA, DELETE_CLAUSE, DOT, FROM_CLAUSE, FUNCTION_COUNT, LOGICAL_AND, LOGICAL_OR, NOT_CLAUSE, OPEN_BRACKET, ORDER_BY_CLAUSE, queryHandlers, SELECT_CLAUSE, SPACE, UPDATE_CLAUSE, WHERE_CLAUSE
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)
Obtain the string that selects all columns from the entity.
|
appendUpdateSetParameter, buildDelete, buildOrderBy, buildQuery, buildUpdate, encodeInExpression, formatEndsWith, formatStartsWith, formatStartsWithBeginning, formEndsWithEnd, getAliasName, getPathOnlyAliasName, getTableAsKeyword, getUnescapedTableName, handleSubQuery, isExpandEmbedded, shouldEscape
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildDelete, buildDelete, buildOrderBy, buildQuery, buildQuery, buildUpdate, buildUpdate, newQueryBuilder, shouldAliasProjections
protected java.lang.String quote(java.lang.String persistedName)
AbstractSqlLikeQueryBuilder
quote
in class AbstractSqlLikeQueryBuilder
persistedName
- The persisted name.public java.lang.String getAliasName(PersistentEntity entity)
AbstractSqlLikeQueryBuilder
getAliasName
in class AbstractSqlLikeQueryBuilder
entity
- 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)
AbstractSqlLikeQueryBuilder
buildJoin
in class AbstractSqlLikeQueryBuilder
alias
- 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)
AbstractSqlLikeQueryBuilder
getTableName
in class AbstractSqlLikeQueryBuilder
entity
- The entityprotected java.lang.String getColumnName(PersistentProperty persistentProperty)
AbstractSqlLikeQueryBuilder
getColumnName
in class AbstractSqlLikeQueryBuilder
persistentProperty
- The propertyprotected void selectAllColumns(AbstractSqlLikeQueryBuilder.QueryState queryState)
AbstractSqlLikeQueryBuilder
selectAllColumns
in class AbstractSqlLikeQueryBuilder
queryState
- The query stateprotected void appendProjectionRowCount(java.lang.StringBuilder queryString, java.lang.String logicalName)
AbstractSqlLikeQueryBuilder
appendProjectionRowCount
in class AbstractSqlLikeQueryBuilder
queryString
- The query stringlogicalName
- The alias to the table nameprotected final boolean computePropertyPaths()
AbstractSqlLikeQueryBuilder
computePropertyPaths
in class AbstractSqlLikeQueryBuilder
protected boolean isAliasForBatch()
AbstractSqlLikeQueryBuilder
isAliasForBatch
in class AbstractSqlLikeQueryBuilder
protected AbstractSqlLikeQueryBuilder.Placeholder formatParameter(int index)
AbstractSqlLikeQueryBuilder
formatParameter
in class AbstractSqlLikeQueryBuilder
index
- The parameterpublic java.lang.String resolveJoinType(Join.Type jt)
AbstractSqlLikeQueryBuilder
resolveJoinType
in class AbstractSqlLikeQueryBuilder
jt
- The join type@Nullable public QueryResult buildInsert(io.micronaut.core.annotation.AnnotationMetadata repositoryMetadata, PersistentEntity entity)
QueryBuilder
buildInsert
in interface QueryBuilder
repositoryMetadata
- The repository annotation metadataentity
- The entity@NonNull protected java.lang.StringBuilder appendDeleteClause(java.lang.StringBuilder queryString)
AbstractSqlLikeQueryBuilder
appendDeleteClause
in class AbstractSqlLikeQueryBuilder
queryString
- The query string@NonNull public QueryResult buildPagination(@NonNull Pageable pageable)
QueryBuilder
buildPagination
in interface QueryBuilder
pageable
- The pageable