@Introspected
public interface QueryBuilder
Modifier and Type | Field and Description |
---|---|
static java.util.regex.Pattern |
IN_VARIABLES_PATTERN
Deprecated.
|
static java.util.regex.Pattern |
VARIABLE_PATTERN
A pattern used to find variables in a query string.
|
Modifier and Type | Method and Description |
---|---|
QueryResult |
buildDelete(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata,
QueryModel query)
Encode the given query into the encoded query instance.
|
default QueryResult |
buildDelete(QueryModel query)
Encode the given query into the encoded query instance.
|
QueryResult |
buildInsert(io.micronaut.core.annotation.AnnotationMetadata repositoryMetadata,
PersistentEntity entity)
Builds an insert statement for the given entity.
|
QueryResult |
buildOrderBy(PersistentEntity entity,
Sort sort)
Encode the given query into the encoded query instance.
|
QueryResult |
buildPagination(Pageable pageable)
Encode the pageable.
|
QueryResult |
buildQuery(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata,
QueryModel query)
Encode the given query for the passed annotation metadata and query.
|
default QueryResult |
buildQuery(QueryModel query)
Encode the given query into the encoded query instance.
|
QueryResult |
buildUpdate(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata,
QueryModel query,
java.util.List<java.lang.String> propertiesToUpdate)
Encode the given query into the encoded query instance.
|
default QueryResult |
buildUpdate(QueryModel query,
java.util.List<java.lang.String> propertiesToUpdate)
Encode the given query into the encoded query instance.
|
static QueryBuilder |
newQueryBuilder(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
Build a query build from the configured annotation metadata.
|
default boolean |
shouldAliasProjections()
Whether projections should be aliased.
|
default boolean |
supportsForUpdate()
Whether FOR UPDATE queries are supported.
|
static final java.util.regex.Pattern VARIABLE_PATTERN
@Deprecated static final java.util.regex.Pattern IN_VARIABLES_PATTERN
@Nullable QueryResult buildInsert(io.micronaut.core.annotation.AnnotationMetadata repositoryMetadata, PersistentEntity entity)
repositoryMetadata
- The repository annotation metadataentity
- The entity@NonNull default QueryResult buildQuery(@NonNull QueryModel query)
query
- The queryQueryResult buildQuery(@NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, @NonNull QueryModel query)
annotationMetadata
- The annotation metadataquery
- The query model@NonNull default QueryResult buildUpdate(@NonNull QueryModel query, @NonNull java.util.List<java.lang.String> propertiesToUpdate)
query
- The querypropertiesToUpdate
- The property names to updateQueryResult buildUpdate(@NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, @NonNull QueryModel query, @NonNull java.util.List<java.lang.String> propertiesToUpdate)
annotationMetadata
- The annotation metadataquery
- The querypropertiesToUpdate
- The property names to update@NonNull default QueryResult buildDelete(@NonNull QueryModel query)
query
- The queryQueryResult buildDelete(@NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, @NonNull QueryModel query)
annotationMetadata
- The annotation metadataquery
- The query@NonNull QueryResult buildOrderBy(@NonNull PersistentEntity entity, @NonNull Sort sort)
entity
- The root entitysort
- The sort@NonNull QueryResult buildPagination(@NonNull Pageable pageable)
pageable
- The pageable@NonNull static QueryBuilder newQueryBuilder(@NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
annotationMetadata
- The annotation metadata.default boolean shouldAliasProjections()
default boolean supportsForUpdate()