Class DtoJoinConditionClauseTerminal<DTO>
- Type Parameters:
DTO- the type of the DTO being queried
- All Implemented Interfaces:
ConditionClauseTerminal<DTO,,DtoJoinConditionClause<DTO>, DtoJoinConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>> DtoJoinClassTerminal<DTO>,JoinClauseTerminal<DTO,,DtoJoinClause<DTO>, DtoJoinConditionClause<DTO>, DtoJoinConditionClauseTerminal<DTO>, DtoWhereConditionClause<DTO>, DtoWhereConditionClauseTerminal<DTO>, DtoGroupByClauseTerminal<DTO>, DtoHavingConditionClause<DTO>, DtoHavingConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>, DtoOrderByClause<DTO>, DtoOrderByClauseChain<DTO>> JoinConditionClauseTerminal<DTO,,DtoJoinConditionClause<DTO>, DtoJoinConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>> LimitClauseTerminal<DTO>,OrderByClauseTerminal<DTO>,SelectTerminal<DTO>,WhereClauseTerminal<DTO,DtoGroupByClauseTerminal<DTO>, DtoHavingConditionClause<DTO>, DtoHavingConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>, DtoOrderByClause<DTO>, DtoOrderByClauseChain<DTO>>
-
Field Summary
Fields inherited from class org.litebridge.orm.api.select.impl.AbstractJoinConditionClauseTerminal
joinNodeFields inherited from class org.litebridge.orm.api.select.impl.DelegatingSelectTerminal
litebridgeContext, node, pendingNode, selectEngineTerminal -
Constructor Summary
ConstructorsConstructorDescriptionDtoJoinConditionClauseTerminal(JoinNode joinNode, SelectEngineTerminal selectEngineTerminal, LitebridgeContext litebridgeContext) Creates a new instance ofDtoJoinConditionClauseTerminal. -
Method Summary
Modifier and TypeMethodDescriptionAdds an "AND" condition to the current condition clause using the specified column.and(DtoQueryConditionBuilder<DTO> query) Adds an "AND" condition with a nested condition clause.and(ExpressionSpec expression) Adds an "AND" condition to the current condition clause using the specified expression.Adds a GROUP BY clause to the query, specifying the column(s) to group the results by.groupBy(ExpressionSpec... expressions) Adds a GROUP BY clause to the query, specifying the expressions to group the results by.Adds a JOIN clause for the specified DTO class.Adds an "OR" condition to the current condition clause using the specified column.or(DtoQueryConditionBuilder<DTO> query) Adds an "OR" condition with specified nested condition clause.or(ExpressionSpec expression) Adds an "OR" condition to the current condition clause using the specified expression.Adds an ORDER BY clause to the query, specifying the expressions to sort the results by.orderBy(ExpressionSpec... fields) Adds an ORDER BY clause to the query, specifying the fields and expressions to sort the results by.Starts a WHERE clause for the SQL query.where(ExpressionSpec expression) Starts a WHERE clause for the SQL query.where(ExistsExpressionSpec existsExpression) Starts a WHERE clause with an EXISTS expression.Convenience method to select a DTO by its primary key.@Nullable DTOwithIdOrNull(Object id) Convenience method to select a DTO by its primary key.withIdOrThrow(Object id) Retrieves a DTO by its primary key and throws an exception if no matching entry is found.withIdOrThrow(Object id, Supplier<? extends X> exceptionSupplier) Retrieves a DTO by its primary key and throws the specified exception if no matching entry is found.Methods inherited from class org.litebridge.orm.api.select.impl.OrderByClauseTerminalImpl
limitMethods inherited from class org.litebridge.orm.api.select.impl.LimitClauseTerminalImpl
offsetMethods inherited from class org.litebridge.orm.api.select.impl.DelegatingSelectTerminal
first, firstOrNull, firstOrThrow, firstOrThrow, list, litebridgeContext, node, one, oneOrNull, oneOrThrow, oneOrThrow, stream, toSqlMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.litebridge.orm.api.select.LimitClauseTerminal
offsetMethods inherited from interface org.litebridge.orm.api.select.OrderByClauseTerminal
limitMethods inherited from interface org.litebridge.orm.api.select.SelectTerminal
first, firstOrNull, firstOrThrow, firstOrThrow, list, one, oneOrNull, oneOrThrow, oneOrThrow, stream, toSql
-
Constructor Details
-
DtoJoinConditionClauseTerminal
public DtoJoinConditionClauseTerminal(JoinNode joinNode, SelectEngineTerminal selectEngineTerminal, LitebridgeContext litebridgeContext) Creates a new instance ofDtoJoinConditionClauseTerminal.- Parameters:
joinNode- the join query nodeselectEngineTerminal- the terminal select enginelitebridgeContext- the Litebridge context
-
-
Method Details
-
and
Description copied from interface:ConditionClauseTerminalAdds an "AND" condition to the current condition clause using the specified column.This method is used to chain additional conditions in a SQL query in a fluent manner.
- Specified by:
andin interfaceConditionClauseTerminal<DTO,DtoJoinConditionClause<DTO>, DtoJoinConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>> - Parameters:
field- the name of the column to be used in the "AND" condition- Returns:
- the parent condition clause interface, allowing further chaining of conditions
-
and
Description copied from interface:ConditionClauseTerminalAdds an "AND" condition to the current condition clause using the specified expression.This method is used to chain additional conditions in a SQL query in a type-safe and fluent manner.
- Specified by:
andin interfaceConditionClauseTerminal<DTO,DtoJoinConditionClause<DTO>, DtoJoinConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>> - Parameters:
expression- the expression to be used in the "AND" condition- Returns:
- the parent condition clause interface, allowing further chaining of conditions
-
and
Description copied from interface:ConditionClauseTerminalAdds an "AND" condition with a nested condition clause.The nested condition clause is grouped with parentheses to ensure proper SQL syntax.
- Specified by:
andin interfaceConditionClauseTerminal<DTO,DtoJoinConditionClause<DTO>, DtoJoinConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>> - Parameters:
query- Function that builds the nested condition clause- Returns:
- the parent condition clause interface, allowing further chaining of conditions
-
or
Description copied from interface:ConditionClauseTerminalAdds an "OR" condition to the current condition clause using the specified column.This method is used to chain additional conditions in a SQL query in a fluent manner.
- Specified by:
orin interfaceConditionClauseTerminal<DTO,DtoJoinConditionClause<DTO>, DtoJoinConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>> - Parameters:
field- the name of the column to be used in the "AND" condition- Returns:
- the parent condition clause interface, allowing further chaining of conditions
-
or
Description copied from interface:ConditionClauseTerminalAdds an "OR" condition to the current condition clause using the specified expression.This method is used to chain additional conditions in a SQL query in a type-safe and fluent manner.
- Specified by:
orin interfaceConditionClauseTerminal<DTO,DtoJoinConditionClause<DTO>, DtoJoinConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>> - Parameters:
expression- the expression to be used in the "AND" condition- Returns:
- the parent condition clause interface, allowing further chaining of conditions
-
or
Description copied from interface:ConditionClauseTerminalAdds an "OR" condition with specified nested condition clause.The nested condition clause is grouped with parentheses to ensure proper SQL syntax.
- Specified by:
orin interfaceConditionClauseTerminal<DTO,DtoJoinConditionClause<DTO>, DtoJoinConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>> - Parameters:
query- Function that builds the nested condition clause- Returns:
- the parent condition clause interface, allowing further chaining of conditions
-
where
Description copied from interface:JoinClauseTerminalStarts a WHERE clause for the SQL query.Adds a filtering condition to the SQL query based on the specified column. This method is part of a fluent API for building SQL queries and transitions to the next stage where additional filtering conditions can be specified.
- Specified by:
wherein interfaceJoinClauseTerminal<DTO,DtoJoinClause<DTO>, DtoJoinConditionClause<DTO>, DtoJoinConditionClauseTerminal<DTO>, DtoWhereConditionClause<DTO>, DtoWhereConditionClauseTerminal<DTO>, DtoGroupByClauseTerminal<DTO>, DtoHavingConditionClause<DTO>, DtoHavingConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>, DtoOrderByClause<DTO>, DtoOrderByClauseChain<DTO>> - Parameters:
field- the name of the column to apply the filtering condition on- Returns:
- an instance of
WCCrepresenting the next stage of the where condition clause
-
where
Description copied from interface:JoinClauseTerminalStarts a WHERE clause for the SQL query.Adds a filtering condition to the SQL query based on the specified expression.
- Specified by:
wherein interfaceJoinClauseTerminal<DTO,DtoJoinClause<DTO>, DtoJoinConditionClause<DTO>, DtoJoinConditionClauseTerminal<DTO>, DtoWhereConditionClause<DTO>, DtoWhereConditionClauseTerminal<DTO>, DtoGroupByClauseTerminal<DTO>, DtoHavingConditionClause<DTO>, DtoHavingConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>, DtoOrderByClause<DTO>, DtoOrderByClauseChain<DTO>> - Parameters:
expression- the expression to apply the filtering condition on- Returns:
- an instance of
WCCrepresenting the next stage of the where condition clause
-
where
Description copied from interface:JoinClauseTerminalStarts a WHERE clause with an EXISTS expression.- Specified by:
wherein interfaceJoinClauseTerminal<DTO,DtoJoinClause<DTO>, DtoJoinConditionClause<DTO>, DtoJoinConditionClauseTerminal<DTO>, DtoWhereConditionClause<DTO>, DtoWhereConditionClauseTerminal<DTO>, DtoGroupByClauseTerminal<DTO>, DtoHavingConditionClause<DTO>, DtoHavingConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>, DtoOrderByClause<DTO>, DtoOrderByClauseChain<DTO>> - Parameters:
existsExpression- the EXISTS expression specification- Returns:
- step to specify the condition operator and value
-
withId
Convenience method to select a DTO by its primary key.Use a
Collection/Listto specify composite primary keys.- Parameters:
id- the primary key value- Returns:
- the selected DTO, if found
-
withIdOrNull
Convenience method to select a DTO by its primary key.Use a
Collection/Listto specify composite primary keys.- Parameters:
id- the primary key value- Returns:
- the selected DTO, or
nullif not found
-
withIdOrThrow
Retrieves a DTO by its primary key and throws an exception if no matching entry is found.Use a
Collection/Listto specify composite primary keys.- Parameters:
id- the primary key value used to identify the DTO- Returns:
- the DTO associated with the given primary key
- Throws:
NoSuchElementException- if no DTO is found with the specified primary key
-
withIdOrThrow
public <X extends Throwable> DTO withIdOrThrow(Object id, Supplier<? extends X> exceptionSupplier) throws X Retrieves a DTO by its primary key and throws the specified exception if no matching entry is found.Use a
Collection/Listto specify composite primary keys.- Type Parameters:
X- the type of exception to be thrown- Parameters:
id- the primary key value used to identify the DTOexceptionSupplier- a supplier that provides the exception to be thrown if the DTO is not found- Returns:
- the DTO associated with the given primary key
- Throws:
X- the exception provided by the supplier if no DTO is found with the specified primary key
-
join
Description copied from interface:DtoJoinClassTerminalAdds a JOIN clause for the specified DTO class.- Specified by:
joinin interfaceDtoJoinClassTerminal<DTO>- Parameters:
dtoClass- the DTO class to join- Returns:
- the JOIN clause
-
groupBy
Description copied from interface:WhereClauseTerminalAdds a GROUP BY clause to the query, specifying the column(s) to group the results by.- Specified by:
groupByin interfaceWhereClauseTerminal<DTO,DtoGroupByClauseTerminal<DTO>, DtoHavingConditionClause<DTO>, DtoHavingConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>, DtoOrderByClause<DTO>, DtoOrderByClauseChain<DTO>> - Parameters:
fields- the column(s) to group the results by. Each column must be valid for the associated table or view in the query.- Returns:
- an instance of the type representing the GROUP BY clause, allowing further specification of ordering or transitioning to the next query stage.
-
groupBy
Description copied from interface:WhereClauseTerminalAdds a GROUP BY clause to the query, specifying the expressions to group the results by.- Specified by:
groupByin interfaceWhereClauseTerminal<DTO,DtoGroupByClauseTerminal<DTO>, DtoHavingConditionClause<DTO>, DtoHavingConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>, DtoOrderByClause<DTO>, DtoOrderByClauseChain<DTO>> - Parameters:
expressions- the expressions to group the results by.- Returns:
- an instance of the type representing the GROUP BY clause, allowing further specification of ordering or transitioning to the next query stage.
-
orderBy
Description copied from interface:WhereClauseTerminalAdds an ORDER BY clause to the query, specifying the expressions to sort the results by.- Specified by:
orderByin interfaceWhereClauseTerminal<DTO,DtoGroupByClauseTerminal<DTO>, DtoHavingConditionClause<DTO>, DtoHavingConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>, DtoOrderByClause<DTO>, DtoOrderByClauseChain<DTO>> - Parameters:
fields- the expressions that determine the order of the results. Each column must be valid for the associated table or view in the query. The order in which the expressions are specified determines the priority of ordering.- Returns:
- an instance of the type representing the ORDER BY clause, allowing further specification of ordering or transitioning to the next query stage.
-
orderBy
Description copied from interface:WhereClauseTerminalAdds an ORDER BY clause to the query, specifying the fields and expressions to sort the results by.- Specified by:
orderByin interfaceWhereClauseTerminal<DTO,DtoGroupByClauseTerminal<DTO>, DtoHavingConditionClause<DTO>, DtoHavingConditionClauseTerminal<DTO>, DtoQueryConditionBuilder<DTO>, DtoOrderByClause<DTO>, DtoOrderByClauseChain<DTO>> - Parameters:
fields- the field and column specifications that determine the order of the results. Each specification includes a mapping of a field to a column. The order in which the specifications are provided defines the priority of ordering.- Returns:
- an instance of the type representing the ORDER BY clause, allowing further specification of ordering or transitioning to the next query stage.
-