Class SelectEngine

java.lang.Object
org.litebridge.orm.engine.SelectEngine

public class SelectEngine extends Object
Initiates the fluent API for creating SELECT statements.
  • Constructor Details

    • SelectEngine

      public SelectEngine(DtoConstructor dtoConstructor)
      Creates a new SelectEngine instance.
      Parameters:
      dtoConstructor - the DTO constructor instance used for building result objects
  • Method Details

    • select

      public <DTO> DtoFromClauseTerminal<DTO> select(Class<DTO> dtoClass, LitebridgeContext litebridgeContext)
      Starts a SELECT query for the specified DTO class.
      Type Parameters:
      DTO - the DTO type
      Parameters:
      dtoClass - the DTO class to query
      litebridgeContext - the Litebridge context
      Returns:
      the terminal FROM clause step
    • select

      public <DTO> DtoFromClauseTerminal<DTO> select(Class<DTO> dtoClass, Class<?> contextDtoClass, LitebridgeContext litebridgeContext)
      Starts a SELECT query for the specified DTO class within a contextual DTO mapping.
      Type Parameters:
      DTO - the DTO type
      Parameters:
      dtoClass - the DTO class to query
      contextDtoClass - the context DTO class
      litebridgeContext - the Litebridge context
      Returns:
      the terminal FROM clause step
    • select

      public FromClauseStart<Row> select(String[] fieldsOrColumns, Function<LitebridgeContext.Mode,LitebridgeContext> litebridgeContextCreator)
      Starts a SELECT query selecting the specified fields or columns.
      Parameters:
      fieldsOrColumns - the field or column names to select
      litebridgeContextCreator - the factory function for creating the Litebridge context
      Returns:
      the initial FROM clause step
    • select

      public FromClauseStart<Row> select(ExpressionSpec[] expressions, Function<LitebridgeContext.Mode,LitebridgeContext> litebridgeContextCreator)
      Starts a SELECT query selecting the specified expressions.
      Parameters:
      expressions - the query expressions to select
      litebridgeContextCreator - the factory function for creating the Litebridge context
      Returns:
      the initial FROM clause step
    • select

      public <T> FromClauseStartTypeOverride<T> select(TypeOverride<T> expression, Function<LitebridgeContext.Mode,LitebridgeContext> litebridgeContextCreator)
      Starts a SELECT query with a return type override expression.
      Type Parameters:
      T - the overridden return type
      Parameters:
      expression - the type override expression
      litebridgeContextCreator - the factory function for creating the Litebridge context
      Returns:
      the initial FROM clause step with type override
    • select

      public FromClauseStart<Row> select(Function<LitebridgeContext.Mode,LitebridgeContext> litebridgeContextCreator)
      Starts a SELECT query selecting all fields/columns.
      Parameters:
      litebridgeContextCreator - the factory function for creating the Litebridge context
      Returns:
      the initial FROM clause step