java.lang.Object
org.litebridge.orm.api.select.impl.AbstractSelector<Row,SqlSelectSpec>
org.litebridge.orm.api.sql.SqlSelector
- All Implemented Interfaces:
SelectTerminal<Row>
public final class SqlSelector
extends org.litebridge.orm.api.select.impl.AbstractSelector<Row,SqlSelectSpec>
-
Field Summary
Fields inherited from class org.litebridge.orm.api.select.impl.AbstractSelector
databaseProvider, dtoClass, litebridgeContext, node -
Constructor Summary
ConstructorsConstructorDescriptionSqlSelector(Table table, TransactionalDatabaseProvider databaseProvider, TableRegistry tableRegistry, LitebridgeContext litebridgeContext, QueryNode node) -
Method Summary
Modifier and TypeMethodDescriptionprotected SqlSelectSpeccreateSelectSpec(AliasGenerator aliasGenerator) @Nullable RowExecutes the query and returns the first row if present.list()Executes the query and materializes all results into aList.@Nullable RowExecutes the query and expects exactly one result.select(ExpressionSpec... expressionSpecs) Sets the current node to the specified query node.Methods inherited from class org.litebridge.orm.api.select.impl.AbstractSelector
compile, executeQuery, executeQuery, executeQuery, first, firstOrThrow, firstOrThrow, litebridgeContext, node, one, oneOrThrow, oneOrThrow, stream, toSql
-
Constructor Details
-
SqlSelector
public SqlSelector(Table table, TransactionalDatabaseProvider databaseProvider, TableRegistry tableRegistry, LitebridgeContext litebridgeContext, QueryNode node)
-
-
Method Details
-
createSelectSpec
- Specified by:
createSelectSpecin classorg.litebridge.orm.api.select.impl.AbstractSelector<Row,SqlSelectSpec>
-
select
-
withNode
Description copied from class:org.litebridge.orm.api.select.impl.AbstractSelectorSets the current node to the specified query node.- Specified by:
withNodein classorg.litebridge.orm.api.select.impl.AbstractSelector<Row,SqlSelectSpec> - Parameters:
node- the new query node- Returns:
- the selector instance
-
oneOrNull
Description copied from interface:SelectTerminalExecutes the query and expects exactly one result.- Specified by:
oneOrNullin interfaceSelectTerminal<Row>- Specified by:
oneOrNullin classorg.litebridge.orm.api.select.impl.AbstractSelector<Row,SqlSelectSpec> - Returns:
- the single result, or
nullwhen no row matches
-
firstOrNull
Description copied from interface:SelectTerminalExecutes the query and returns the first row if present.- Specified by:
firstOrNullin interfaceSelectTerminal<Row>- Specified by:
firstOrNullin classorg.litebridge.orm.api.select.impl.AbstractSelector<Row,SqlSelectSpec> - Returns:
- the first result, or
nullwhen no row matches
-
list
Description copied from interface:SelectTerminalExecutes the query and materializes all results into aList.- Specified by:
listin interfaceSelectTerminal<Row>- Specified by:
listin classorg.litebridge.orm.api.select.impl.AbstractSelector<Row,SqlSelectSpec> - Returns:
- list of all matching results (possibly empty)
-