Class ValqueriesQueryImpl<T>
- All Implemented Interfaces:
ValqueriesGroupQuery<T>,ValqueriesQuery<T>,Setter,CrudRepository.InlineQuery<T,,ValqueriesQuery<T>> AutoCloseable
-
Field Summary
Fields inherited from class com.valqueries.automapper.BaseValqueriesQuery
groupByPropertiesFields inherited from class io.ran.CrudRepoBaseQuery
clazz, instance, queryWrapper, typeDescriber -
Constructor Summary
ConstructorsConstructorDescriptionValqueriesQueryImpl(ITransactionContext transactionContext, Class<T> modelType, GenericFactory genericFactory, MappingHelper mappingHelper, SqlDialect dialect) -
Method Summary
Modifier and TypeMethodDescriptionand(Consumer<ValqueriesQuery<T>> subQuery) Match if all the sub-conditions match.buildSimpleSelectSql(String tableAlias, String where, Collection<String> columns) voidclose()protected voidlongcount()Count the number of rows that match the query.protected voiddelete()Delete all entries that match the query.<X> Stream<X>eq(Property.PropertyValue<?> propertyValue) execute()Execute the query and return the results as aStream.<X> Stream<X>executeSqlAndGetSingleColumn(Property<X> property, String sql) freetext(Property.PropertyValue<String> propertyValue) getTableName(Clazz<?> toClass) Execute the query.<X extends Comparable<? super X>>
ValqueriesQuery<T>gt(Property.PropertyValue<X> propertyValue) <X extends Comparable<? super X>>
ValqueriesQuery<T>gte(Property.PropertyValue<X> propertyValue) in(Property.PropertyValueList<?> propertyValues) like(Property.PropertyValue<String> propertyValue) limit(int limit) Limit the results to the given number of rows.limit(int offset, int limit) Limit the results to the given number of rows, starting at the given offset.<X extends Comparable<? super X>>
ValqueriesQuery<T>lt(Property.PropertyValue<X> propertyValue) <X extends Comparable<? super X>>
ValqueriesQuery<T>lte(Property.PropertyValue<X> propertyValue) protected <X extends Comparable<? super X>>
voidprotected <X extends Comparable<? super X>>
voidnotEq(Property.PropertyValue<?> property) notIn(Property.PropertyValueList<?> propertyValues) notLike(Property.PropertyValue<String> propertyValue) or(Consumer<ValqueriesQuery<T>> subQuery) Match if any of the sub-conditions match.<X> Stream<X>selectField(Property<X> property) voidset(IStatement statement) voidsetEmpty()<X extends Comparable<? super X>>
ValqueriesQuery<T>sortAscending(Property<X> property) <X extends Comparable<? super X>>
ValqueriesQuery<T>sortDescending(Property<X> property) <X,Z extends CrudRepository.InlineQuery<X, Z>>
ValqueriesQuery<T>subQuery(RelationDescriber relation, Consumer<Z> consumer) protected voidupdate(Consumer<ValqueriesUpdate<T>> updater) withEager(RelationDescriber relation) Methods inherited from class com.valqueries.automapper.BaseValqueriesQuery
aggregateAll, concat, concat, count, count, distinct, freetext, freetext, groupBy, groupBy, in, in, in, in, isNotNull, isNotNull, like, like, max, max, min, min, notIn, notIn, notIn, notIn, notLike, notLike, selectField, subQuery, subQuery, subQueryList, subQueryList, subQueryList, sum, sumMethods inherited from class io.ran.CrudRepoBaseQuery
eq, eq, gt, gt, gte, gte, isNull, isNull, lt, lt, lte, lte, notEq, notEq, sortAscending, sortAscending, sortDescending, sortDescending, withEager, withEagerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.ran.CrudRepository.InlineQuery
distinct, eq, eq, gt, gt, gte, gte, isNull, isNull, lt, lt, lte, lte, notEq, notEq, selectField, sortAscending, sortAscending, sortDescending, sortDescending, withEager, withEagerMethods inherited from interface com.valqueries.automapper.ValqueriesQuery
aggregateAll, freetext, freetext, groupBy, groupBy, in, in, in, in, isNotNull, isNotNull, like, like, notIn, notIn, notIn, notIn, notLike, notLike, subQuery, subQuery, subQueryList, subQueryList, subQueryList
-
Constructor Details
-
ValqueriesQueryImpl
public ValqueriesQueryImpl(ITransactionContext transactionContext, Class<T> modelType, GenericFactory genericFactory, MappingHelper mappingHelper, SqlDialect dialect)
-
-
Method Details
-
and
Description copied from interface:CrudRepository.InlineQueryMatch if all the sub-conditions match. The conditions in your sub query will be AND-ed together. Since this is the default behavior, this method is intended to be used insideCrudRepository.InlineQuery.or(Consumer).Example:
Will result into the following SQL:query.or(or -> or.eq(Person::getName, "Mike").and(and -> and.eq(Person::getName, "Bob").eq(Person::getAge, 42)));WHERE (name = 'Mike' OR (name = 'Bob' AND age = 42))- Specified by:
andin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>> - Parameters:
subQuery- the sub query to be inside the AND statement- Returns:
- the query, for chaining
-
or
Description copied from interface:CrudRepository.InlineQueryMatch if any of the sub-conditions match. The conditions in your sub query will be OR-ed together.Example:
Will result into the following SQL:query.or(sub -> sub.eq(Person::getName, "Bob").eq(Person::getAge, 42));WHERE (name = 'Bob' OR age = 42)- Specified by:
orin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>> - Parameters:
subQuery- the sub query to be inside the OR statement- Returns:
- the query, for chaining
-
eq
- Specified by:
eqin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>>
-
notEq
- Specified by:
notEqin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>>
-
in
- Specified by:
inin interfaceValqueriesQuery<T>- Specified by:
inin classBaseValqueriesQuery<T>
-
notIn
- Specified by:
notInin interfaceValqueriesQuery<T>- Specified by:
notInin classBaseValqueriesQuery<T>
-
like
- Specified by:
likein interfaceValqueriesQuery<T>- Specified by:
likein classBaseValqueriesQuery<T>
-
notLike
- Specified by:
notLikein interfaceValqueriesQuery<T>- Specified by:
notLikein classBaseValqueriesQuery<T>
-
freetext
- Specified by:
freetextin interfaceValqueriesQuery<T>- Specified by:
freetextin classBaseValqueriesQuery<T>
-
gt
public <X extends Comparable<? super X>> ValqueriesQuery<T> gt(Property.PropertyValue<X> propertyValue) - Specified by:
gtin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>>
-
gte
public <X extends Comparable<? super X>> ValqueriesQuery<T> gte(Property.PropertyValue<X> propertyValue) - Specified by:
gtein interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>>
-
lt
public <X extends Comparable<? super X>> ValqueriesQuery<T> lt(Property.PropertyValue<X> propertyValue) - Specified by:
ltin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>>
-
lte
public <X extends Comparable<? super X>> ValqueriesQuery<T> lte(Property.PropertyValue<X> propertyValue) - Specified by:
ltein interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>>
-
subQuery
public <X,Z extends CrudRepository.InlineQuery<X, ValqueriesQuery<T> subQueryZ>> (RelationDescriber relation, Consumer<Z> consumer) - Specified by:
subQueryin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>>
-
isNull
- Specified by:
isNullin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>>
-
isNotNull
- Specified by:
isNotNullin interfaceValqueriesQuery<T>- Specified by:
isNotNullin classBaseValqueriesQuery<T>
-
buildSimpleSelectSql
-
getTableName
-
withEager
- Specified by:
withEagerin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>>
-
sortAscending
- Specified by:
sortAscendingin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>>
-
sortDescending
- Specified by:
sortDescendingin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>>
-
limit
Description copied from interface:CrudRepository.InlineQueryLimit the results to the given number of rows, starting at the given offset.Offset is 0-based (the first row is 0).
Offset is inclusive, limit is the size of the returned collection.
Example:
query.limit(10, 20)This will return rows 10, 11, 12, ..., 29.
- Specified by:
limitin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>> - Parameters:
offset- the offset to start atlimit- the number of rows to return- Returns:
- the query, for chaining
- See Also:
-
limit
Description copied from interface:CrudRepository.InlineQueryLimit the results to the given number of rows.Example:
query.limit(10)This will return the first 10 rows.
- Specified by:
limitin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>> - Parameters:
limit- the number of rows to return- Returns:
- the query, for chaining
- See Also:
-
execute
Description copied from interface:CrudRepository.InlineQueryExecute the query and return the results as aStream.This is a terminal operation. As such, the query should not be reused after this method is called.
The resulting
Streamfrom the operation may be a lazy stream, meaning that the results are not fetched from the database until they are accessed. As such it is important that a terminal operation is performed on the stream within a reasonable time frame to avoid holding database connections open.- Specified by:
executein interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>> - Returns:
- a
Streamof the results
-
count
public long count()Description copied from interface:CrudRepository.InlineQueryCount the number of rows that match the query.This is a terminal operation. As such, the query should not be reused after this method is called.
- Specified by:
countin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>> - Returns:
- the number of rows that match the query
-
distinct
- Specified by:
distinctin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>>
-
selectField
- Specified by:
selectFieldin interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>>
-
executeSqlAndGetSingleColumn
-
count
- Specified by:
countin classBaseValqueriesQuery<T>
-
sum
- Specified by:
sumin classBaseValqueriesQuery<T>
-
max
- Specified by:
maxin classBaseValqueriesQuery<T>
-
min
- Specified by:
minin classBaseValqueriesQuery<T>
-
concat
- Specified by:
concatin classBaseValqueriesQuery<T>
-
delete
Description copied from interface:CrudRepository.InlineQueryDelete all entries that match the query.This is a terminal operation. As such, the query should not be reused after this method is called.
WARNING: If you invoke no query methods prior to this, all rows in the table with be deleted.
- Specified by:
deletein interfaceCrudRepository.InlineQuery<T,ValqueriesQuery<T>> - Returns:
- a
CrudRepository.CrudUpdateResultwith the number of rows affected - See Also:
-
groupByExecute
Description copied from interface:ValqueriesGroupQueryExecute the query.- Specified by:
groupByExecutein interfaceValqueriesGroupQuery<T>- Returns:
- A stream of rows, each containing the values of the fields that were grouped by and the values of the aggregations, both in the same order they were queried.
-
set
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
update
- Specified by:
updatein interfaceValqueriesQuery<T>
-
getTableAlias
-
setEmpty
public void setEmpty()
-