java.lang.Object
org.litebridge.orm.persistence.AbstractStatementBuilder
- All Implemented Interfaces:
StatementBuilder
- Direct Known Subclasses:
AbstractConditionalStatementBuilder
public abstract sealed class AbstractStatementBuilder
extends Object
implements StatementBuilder
permits AbstractConditionalStatementBuilder (not exhaustive)
Abstract base class for building SQL statements.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @Nullable Class<?> protected ObjectThe DTO associated with the statement.protected final LitebridgeContextThe ORM context.protected @Nullable QueryNodeThe current query node.protected intprotected final OrmTableThe ORM table associated with the statement. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractStatementBuilder(Object dto, OrmTable ormTable, @Nullable Class<?> contextDtoClass, LitebridgeContext litebridgeContext) Constructs a newAbstractStatementBuilder. -
Method Summary
Modifier and TypeMethodDescriptionabstract PreparedOperationbuild()Builds the final SQL statement.createUpdateMetaData(PreparedOperation preparedOperation) Creates the update metadata for the statement.dto()node()Returns the current query node.intnodeHash()Returns a cached copy of the AST node hash.Returns the chain of statements built so far.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.litebridge.orm.persistence.StatementBuilder
combinable, combineWith, resultType, setField
-
Field Details
-
dto
The DTO associated with the statement. -
ormTable
The ORM table associated with the statement. -
contextDtoClass
-
litebridgeContext
The ORM context. -
node
The current query node. -
nodeHash
protected int nodeHash
-
-
Constructor Details
-
AbstractStatementBuilder
protected AbstractStatementBuilder(Object dto, OrmTable ormTable, @Nullable Class<?> contextDtoClass, LitebridgeContext litebridgeContext) Constructs a newAbstractStatementBuilder.- Parameters:
dto- The DTO associated with the statement.ormTable- The ORM table for the target DTO.contextDtoClass- The parent/context DTO class.litebridgeContext- Litebridge context.
-
-
Method Details
-
dto
- Specified by:
dtoin interfaceStatementBuilder
-
node
Description copied from interface:StatementBuilderReturns the current query node.- Specified by:
nodein interfaceStatementBuilder- Returns:
- the query node
-
nodeHash
public int nodeHash()Description copied from interface:StatementBuilderReturns a cached copy of the AST node hash.- Specified by:
nodeHashin interfaceStatementBuilder- Returns:
- the cached AST node hash
-
statementChain
Description copied from interface:StatementBuilderReturns the chain of statements built so far.- Specified by:
statementChainin interfaceStatementBuilder- Returns:
- The statement chain.
-
build
Description copied from interface:StatementBuilderBuilds the final SQL statement.- Specified by:
buildin interfaceStatementBuilder- Returns:
- The built statement.
-
createUpdateMetaData
Description copied from interface:StatementBuilderCreates the update metadata for the statement.- Specified by:
createUpdateMetaDatain interfaceStatementBuilder- Parameters:
preparedOperation- the prepared database operation- Returns:
- the update metadata
-