Class SelectQuery<T>
- java.lang.Object
-
- net.lecousin.reactive.data.relational.query.SelectQuery<T>
-
- Type Parameters:
T
- type of entity this select will return
public class SelectQuery<T> extends Object
Specifies a SELECT operation, possibly with joins, where clause, limit and order by clause.- Author:
- Guillaume Le Cousin
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Flux<T>
execute(LcReactiveDataRelationalClient client)
Execute the query using the given database client.reactor.core.publisher.Flux<T>
execute(LcReactiveDataRelationalClient client, LcEntityReader reader)
Execute the query using the given database client and the given reader.reactor.core.publisher.Mono<Long>
executeCount(LcReactiveDataRelationalClient client)
Execute a COUNT request, using the joins and where clause of this select query.static <T> SelectQuery<T>
from(Class<T> type, String alias)
Create a SELECT query from the table of the given entity type, using the given alias.SelectQuery<T>
join(String entityName, String propertyName, String alias)
Create a join, using the link entityName.propertyName, and using the given alias as the joined entity name.SelectQuery<T>
limit(long start, long count)
Apply a limit and offset to the select query.SelectQuery<T>
orderBy(String entityName, String propertyName, boolean ascending)
Add an ORDER BY clause to this select query.String
toString()
SelectQuery<T>
where(Criteria criteria)
Set the given criteria in the where clause.
-
-
-
Method Detail
-
from
public static <T> SelectQuery<T> from(Class<T> type, String alias)
Create a SELECT query from the table of the given entity type, using the given alias.
-
join
public SelectQuery<T> join(String entityName, String propertyName, String alias)
Create a join, using the link entityName.propertyName, and using the given alias as the joined entity name.
-
where
public SelectQuery<T> where(Criteria criteria)
Set the given criteria in the where clause. If criteria already exist, a AND is created between the existing criteria and the new criteria.
-
limit
public SelectQuery<T> limit(long start, long count)
Apply a limit and offset to the select query.
-
orderBy
public SelectQuery<T> orderBy(String entityName, String propertyName, boolean ascending)
Add an ORDER BY clause to this select query.
-
execute
public reactor.core.publisher.Flux<T> execute(LcReactiveDataRelationalClient client)
Execute the query using the given database client.
-
execute
public reactor.core.publisher.Flux<T> execute(LcReactiveDataRelationalClient client, LcEntityReader reader)
Execute the query using the given database client and the given reader.
-
executeCount
public reactor.core.publisher.Mono<Long> executeCount(LcReactiveDataRelationalClient client)
Execute a COUNT request, using the joins and where clause of this select query. Any join which are not useful (not used for conditions) are automatically ignored.
-
-