Module litebridge.orm
Class FieldColumnSpecBuilderColumnStep
java.lang.Object
org.litebridgedb.orm.api.register.FieldColumnSpecBuilderColumnStep
- All Implemented Interfaces:
FieldColumnSpecBuilderTerminal
public final class FieldColumnSpecBuilderColumnStep
extends Object
implements FieldColumnSpecBuilderTerminal
A builder step for defining the column specification associated with a field in a data model.
This class is part of a fluent interface for constructing field-to-column mappings, offering
methods for configuring column generation logic, joins, and finalization of the specification.
Instances of this class are immutable and facilitate chaining to refine the configuration of a field's column mapping.
-
Method Summary
Modifier and TypeMethodDescriptiongenerate(ColumnValueGenerator generator) Configures the value generation strategy for a database column using a specified custom generator.generateUsingSequence(String sequence) Configures the column value generator to use a sequence-based approach for populating column values.Defines the join condition for a database column during field-to-column mapping configuration.Configures the join condition for a database column using the previously set column in the current field-to-column mapping configuration (i.e. aJOIN USINGjoin).
-
Method Details
-
generateUsingSequence
Configures the column value generator to use a sequence-based approach for populating column values. This method uses the provided sequence name to create aPlaceholderSequenceColumnValueGeneratorresponsible for generating values based on the specified sequence.- Parameters:
sequence- The name of the database sequence to be used for generating column values. Must not be null or empty.- Returns:
- An instance of
FieldColumnSpecBuilderTerminal, allowing further configuration of the field-to-column mapping or finalization of the specification.
-
generate
Configures the value generation strategy for a database column using a specified custom generator. This method finalises the column specification by associating it with the providedColumnValueGenerator, enabling dynamic value generation during operations like data insertion or updates.- Parameters:
generator- TheColumnValueGeneratorresponsible for generating dynamic values for the associated database column. Must not be null.- Returns:
- An instance of
FieldColumnSpecBuilderTerminal, allowing further configuration or finalisation of the field-to-column mapping.
-
joinOn
Defines the join condition for a database column during field-to-column mapping configuration.- Parameters:
column- The name of the column from the joining table to be used in the join condition. Must not be null or empty.- Returns:
- An instance of
FieldColumnSpecBuilderJoinStep, providing methods for further configuration of the join or finalization of the column specification.
-
joinUsing
Configures the join condition for a database column using the previously set column in the current field-to-column mapping configuration (i.e. aJOIN USINGjoin).This method utilizes the existing column specification and establishes a join condition where the join is based on the given column. The resulting configuration is represented as an instance of
FieldColumnSpecBuilderJoinStep, providing further options for refining the join or completing the mapping.- Returns:
- An instance of
FieldColumnSpecBuilderJoinStep, enabling additional configuration of the database column join or finalization of the specification.
-