Daobab is able to work at many QueryTargets which may be a database schemas, memory buffors or remote endpoints.
QueryTarget and select are connected.
Every QueryTarget implementation provides a select methods.
It's possible to read table contents (entities), single table column(field) or some collection of columns from one or many tables (plates).
Similarly, as it is into an SQL, you have to specify what you want to get just at the beginning of the query.
The last method in the chain, specifies the expected data form you want to read. There are few of them:
- findOne() - reads just a single object. It may return null if there is no object returned or just the first one if there is more.
- findFirst() - works as above, but return an Optional
- findMany() - return a List of objects. If query has no result, empty list is given.
- forEach() - executes a a loop over returned collection
Additionally, any kind of select may be performed based on raw native string query.
Sub-queries or so-called inner selects are also possible.
Also, any inner select may have another inner selects inside.