Interface SelectApi

All Known Implementing Classes:
Litebridge, SelectEngine

public interface SelectApi
Litebridge ORM select API.
  • Method Details

    • select

      <DTO> DtoFromClauseTerminal<DTO> select(Class<DTO> dtoClass)
      Select a registered Data Transfer Object (DTO) type for database query operations.

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

      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.
      Throws:
      IllegalArgumentException - if the specified DTO class is not registered in the table registry.
    • select

      <DTO> DtoFromClauseTerminal<DTO> select(Class<DTO> dtoClass, @Nullable RelatedDtoStrategy relatedDtoStrategy)
      Select a registered Data Transfer Object (DTO) type for database query operations.

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

      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.
      Throws:
      IllegalArgumentException - if the specified DTO class is not registered in the table registry.
    • select

      <DTO> DtoFromClauseTerminal<DTO> select(Class<DTO> dtoClass, Class<?> contextDtoClass)
      Select a contextually-registered Data Transfer Object (DTO) type for database query operations.

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

      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.
      Throws:
      IllegalArgumentException - if the specified DTO class is not registered in the table registry.
    • select

      FromClauseStart select(String... fieldsOrColumns)
      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.

      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

      FromClauseStart select(ExpressionSpec... expressions)
      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.

      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

      <T> FromClauseStartTypeOverride<T> select(TypeOverride<T> expression)
      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.

      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

      FromClauseStart select()
      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.

      Returns:
      A FromClauseStartTypeOverride instance allowing further refinement of the SQL query by specifying the target DTO or table.