Class SelectApiImpl

java.lang.Object
org.litebridge.orm.api.select.SelectApiImpl
All Implemented Interfaces:
SelectApi

public final class SelectApiImpl extends Object implements SelectApi
Implementation of SelectApi providing entry points for SELECT queries.
  • Constructor Details

    • SelectApiImpl

      public SelectApiImpl(LitebridgeContext litebridgeContext)
      Creates a new SelectApiImpl instance.
      Parameters:
      litebridgeContext - the Litebridge context
  • Method Details

    • select

      public <DTO> DtoFromClauseTerminal<DTO> select(Class<DTO> dtoClass)
      Description copied from interface: SelectApi
      Select a registered Data Transfer Object (DTO) type for database query operations.

      Shortcut method; equivalent to select().from(dtoClass).

      Specified by:
      select in interface SelectApi
      Type Parameters:
      DTO - The type of the DTO to select.
      Parameters:
      dtoClass - The class of the DTO to be queried, which must already be registered.
      Returns:
      A DtoFromClauseTerminal instance for querying and retrieving data for the specified DTO class.
    • select

      public <DTO> DtoFromClauseTerminal<DTO> select(Class<DTO> dtoClass, RelatedDtoStrategy relatedDtoStrategy)
      Description copied from interface: SelectApi
      Select a registered Data Transfer Object (DTO) type for database query operations.

      Shortcut method; equivalent to select().from(dtoClass, relatedDtoStrategy).

      Specified by:
      select in interface SelectApi
      Type Parameters:
      DTO - The type of the DTO to select.
      Parameters:
      dtoClass - The class of the DTO to be queried, which must already be registered.
      relatedDtoStrategy - The strategy to use for fetching related DTOs.
      Returns:
      A DtoFromClauseTerminal instance for querying and retrieving data for the specified DTO class.
    • select

      public <DTO> DtoFromClauseTerminal<DTO> select(Class<DTO> dtoClass, Class<?> contextDtoClass)
      Description copied from interface: SelectApi
      Select a contextually-registered Data Transfer Object (DTO) type for database query operations.

      Shortcut method; equivalent to select().from(dtoClass, contextDtoClass).

      Specified by:
      select in interface SelectApi
      Type Parameters:
      DTO - The type of the DTO to select.
      Parameters:
      dtoClass - The class of the DTO to be queried, which must already be registered.
      contextDtoClass - The context DTO class for determining the table mapping.
      Returns:
      A DtoFromClauseTerminal instance for querying and retrieving data for the specified DTO class.
    • select

      public FromClauseStart<Row> select(String... fieldsOrColumns)
      Description copied from interface: SelectApi
      Query data from the database, without mapping results to Data Transfer Objects (DTOs).

      Creates a SQL SELECT statement with the specified fields/expressions; the source table is specified via a chained from() call.

      This method constructs a FromClauseStartTypeOverride for further query composition by specifying the target DTO or table for the query.

      Specified by:
      select in interface SelectApi
      Parameters:
      fieldsOrColumns - An array of field/column names to be included in the SELECT statement, dependent on whether a DTO or raw SQL is selected in the chained from() call. Each field/column name must be a valid, non-null string.
      Returns:
      A FromClauseStartTypeOverride instance allowing further refinement of the SQL query by specifying the target DTO or table.
    • select

      public <T extends Number> FromClauseStartTypeOverride<T> select(T literal)
      Specified by:
      select in interface SelectApi
    • select

      public FromClauseStartTypeOverride<Boolean> select(boolean literal)
      Specified by:
      select in interface SelectApi
    • select

      public FromClauseStart<Row> select(ExpressionSpec... expressions)
      Description copied from interface: SelectApi
      Query data from the database, without mapping results to Data Transfer Objects (DTOs).

      Creates a SQL SELECT statement with the specified fields/expressions; the source table is specified via a chained from() call.

      This method constructs a FromClauseStartTypeOverride for further query composition by specifying the target DTO or table for the query.

      Specified by:
      select in interface SelectApi
      Parameters:
      expressions - An array of ExpressionSpec objects representing the expressions to be part of the SELECT statement.
      Returns:
      A FromClauseStartTypeOverride instance allowing further refinement of the SQL query by specifying the target DTO or table.
    • select

      public <T> FromClauseStartTypeOverride<T> select(TypeOverride<T> expression)
      Description copied from interface: SelectApi
      Query data from the database, without mapping results to Data Transfer Objects (DTOs).

      Creates a SQL SELECT statement with the specified fields/expressions; the source table is specified via a chained from() call.

      This method constructs a FromClauseStartTypeOverride for further query composition by specifying the target DTO or table for the query.

      Specified by:
      select in interface SelectApi
      Type Parameters:
      T - The return type of the query
      Parameters:
      expression - Return type-overriding expression
      Returns:
      A FromClauseStartTypeOverride instance allowing further refinement of the SQL query by specifying the target DTO or table.
    • select

      public FromClauseStart<Row> select()
      Description copied from interface: SelectApi
      Query data from the database, without mapping results to Data Transfer Object (DTOs).

      Creates a SQL SELECT statement with all fields/expressions. The source table is specified via a chained from() call.

      This method constructs a FromClauseStartTypeOverride for further query composition by specifying the target DTO or table for the query.

      Specified by:
      select in interface SelectApi
      Returns:
      A FromClauseStartTypeOverride instance allowing further refinement of the SQL query by specifying the target DTO or table.