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 boolean
protected final GenericFactory
protected final TestDoubleIndex
protected Integer
protected final MappingHelper
protected int
protected final List<Comparator<T>>
protected final TestDoubleStore<Object,
T> protected final TestDoubleDb
Fields 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.long
count()
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, withEager
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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.InlineQuery
Match 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:
and
in 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.InlineQuery
Match 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:
or
in 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:
eq
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>>
-
notEq
- Specified by:
notEq
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>>
-
gt
- Specified by:
gt
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>>
-
gte
- Specified by:
gte
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>>
-
lt
- Specified by:
lt
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>>
-
lte
- Specified by:
lte
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>>
-
isNull
- Specified by:
isNull
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>>
-
withEager
- Specified by:
withEager
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>>
-
sortAscending
- Specified by:
sortAscending
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>>
-
sortDescending
- Specified by:
sortDescending
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>>
-
limit
Description copied from interface:CrudRepository.InlineQuery
Limit 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:
limit
in 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.InlineQuery
Limit the results to the given number of rows.Example:
query.limit(10)
This will return the first 10 rows.
- Specified by:
limit
in 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:
subQuery
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>>
-
getQuery
-
execute
Description copied from interface:CrudRepository.InlineQuery
Execute 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
Stream
from 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:
execute
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>> - Returns:
- a
Stream
of the results
-
executeInternal
-
count
public long count()Description copied from interface:CrudRepository.InlineQuery
Count 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:
count
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>> - Returns:
- the number of rows that match the query
-
distinct
- Specified by:
distinct
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>>
-
selectField
- Specified by:
selectField
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>>
-
delete
Description copied from interface:CrudRepository.InlineQuery
Delete 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:
delete
in interfaceCrudRepository.InlineQuery<T,
Z extends CrudRepository.InlineQuery<T, Z>> - Returns:
- a
CrudRepository.CrudUpdateResult
with the number of rows affected - See Also:
-