Class TestDoubleQuery<T,Z extends CrudRepository.InlineQuery<T,Z>>
- All Implemented Interfaces:
CrudRepository.InlineQuery<T,Z>
- Direct Known Subclasses:
TestDoubleQuery
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected final GenericFactoryprotected final TestDoubleIndexprotected Integerprotected final MappingHelperprotected intprotected final List<Comparator<T>>protected final TestDoubleStore<Object,T> protected final TestDoubleDbFields inherited from class io.ran.CrudRepoBaseQuery
clazz, genericFactory, instance, queryWrapper, typeDescriber -
Constructor Summary
ConstructorsConstructorDescriptionTestDoubleQuery(Class<T> modelType, GenericFactory genericFactory, MappingHelper mappingHelper, TestDoubleDb testDoubleDb) -
Method Summary
Modifier and TypeMethodDescriptionMatch if all the sub-conditions match.longcount()Count the number of rows that match the query.delete()Delete all entries that match the query.<X> Stream<X>eq(Property.PropertyValue<?> propertyValue) execute()Execute the query and return the results as aStream.protected abstract Z<X extends Comparable<? super X>>
Zgt(Property.PropertyValue<X> propertyValue) <X extends Comparable<? super X>>
Zgte(Property.PropertyValue<X> 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>>
Zlt(Property.PropertyValue<X> propertyValue) <X extends Comparable<? super X>>
Zlte(Property.PropertyValue<X> propertyValue) notEq(Property.PropertyValue<?> propertyValue) Match if any of the sub-conditions match.<X> Stream<X>selectField(Property<X> property) <X extends Comparable<? super X>>
ZsortAscending(Property<X> property) <X extends Comparable<? super X>>
ZsortDescending(Property<X> property) <X,Y extends CrudRepository.InlineQuery<X, Y>>
ZsubQuery(RelationDescriber relationDescriber, Consumer<Y> consumer) withEager(RelationDescriber relationDescriber) Methods inherited from class io.ran.CrudRepoBaseQuery
distinct, eq, eq, gt, gt, gte, gte, isNull, isNull, lt, lt, lte, lte, notEq, notEq, selectField, 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, withEager
-
Field Details
-
filters
-
indexLookups
-
sorts
-
mappingHelper
-
testDoubleDb
-
store
-
index
-
factory
-
offset
protected int offset -
limit
-
delayLimit
protected boolean delayLimit
-
-
Constructor Details
-
TestDoubleQuery
public TestDoubleQuery(Class<T> modelType, GenericFactory genericFactory, MappingHelper mappingHelper, TestDoubleDb testDoubleDb)
-
-
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,Z extends CrudRepository.InlineQuery<T, Z>> - 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,Z extends CrudRepository.InlineQuery<T, Z>> - Parameters:
subQuery- the sub query to be inside the OR statement- Returns:
- the query, for chaining
-
eq
- Specified by:
eqin interfaceCrudRepository.InlineQuery<T,Z extends CrudRepository.InlineQuery<T, Z>>
-
notEq
- Specified by:
notEqin interfaceCrudRepository.InlineQuery<T,Z extends CrudRepository.InlineQuery<T, Z>>
-
gt
- Specified by:
gtin interfaceCrudRepository.InlineQuery<T,Z extends CrudRepository.InlineQuery<T, Z>>
-
gte
- Specified by:
gtein interfaceCrudRepository.InlineQuery<T,Z extends CrudRepository.InlineQuery<T, Z>>
-
lt
- Specified by:
ltin interfaceCrudRepository.InlineQuery<T,Z extends CrudRepository.InlineQuery<T, Z>>
-
lte
- Specified by:
ltein interfaceCrudRepository.InlineQuery<T,Z extends CrudRepository.InlineQuery<T, Z>>
-
isNull
- Specified by:
isNullin interfaceCrudRepository.InlineQuery<T,Z extends CrudRepository.InlineQuery<T, Z>>
-
withEager
- Specified by:
withEagerin interfaceCrudRepository.InlineQuery<T,Z extends CrudRepository.InlineQuery<T, Z>>
-
sortAscending
- Specified by:
sortAscendingin interfaceCrudRepository.InlineQuery<T,Z extends CrudRepository.InlineQuery<T, Z>>
-
sortDescending
- Specified by:
sortDescendingin interfaceCrudRepository.InlineQuery<T,Z extends CrudRepository.InlineQuery<T, Z>>
-
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,Z extends CrudRepository.InlineQuery<T, Z>> - 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,Z extends CrudRepository.InlineQuery<T, Z>> - Parameters:
limit- the number of rows to return- Returns:
- the query, for chaining
- See Also:
-
subQuery
public <X,Y extends CrudRepository.InlineQuery<X, Z subQueryY>> (RelationDescriber relationDescriber, Consumer<Y> consumer) - Specified by:
subQueryin interfaceCrudRepository.InlineQuery<T,Z extends CrudRepository.InlineQuery<T, Z>>
-
getQuery
-
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,Z extends CrudRepository.InlineQuery<T, Z>> - Returns:
- a
Streamof the results
-
executeInternal
-
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,Z extends CrudRepository.InlineQuery<T, Z>> - Returns:
- the number of rows that match the query
-
distinct
- Specified by:
distinctin interfaceCrudRepository.InlineQuery<T,Z extends CrudRepository.InlineQuery<T, Z>>
-
selectField
- Specified by:
selectFieldin interfaceCrudRepository.InlineQuery<T,Z extends CrudRepository.InlineQuery<T, Z>>
-
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,Z extends CrudRepository.InlineQuery<T, Z>> - Returns:
- a
CrudRepository.CrudUpdateResultwith the number of rows affected - See Also:
-