Class LitebridgeContext

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

public final class LitebridgeContext extends Object
A context object that provides access to core Litebridge components and configuration.
  • Constructor Details

    • LitebridgeContext

      public LitebridgeContext(LitebridgeContext.Mode mode, LitebridgeConfig config, DatabaseProvider databaseProvider, QueryPlanCache queryPlanCache, MappingPlanCache mappingPlanCache, AliasGenerator aliasGenerator, TableRegistry tableRegistry, TableMetaDataCache tableMetaDataCache, ClassFieldAccessorCache classFieldAccessorCache, TransactionManager transactionManager, SelectEngine selectEngine)
      Create a new Litebridge context with the specified components.
      Parameters:
      mode - The mode of operation for the Litebridge context.
      config - Configuration for managing runtime behaviour
      databaseProvider - The database provider.
      queryPlanCache - A cache for storing execution plans based on query structure.
      mappingPlanCache - A cache for storing mapping plans for DTOs.
      aliasGenerator - An alias generator for creating unique table and column aliases.
      tableRegistry - The table registry.
      tableMetaDataCache - The table metadata cache.
      classFieldAccessorCache - The class field accessor cache.
      transactionManager - The transaction manager.
      selectEngine - The select engine.
    • LitebridgeContext

      public LitebridgeContext(LitebridgeContext.Mode mode, LitebridgeConfig config, DatabaseProvider databaseProvider, QueryPlanCache queryPlanCache, AliasGenerator aliasGenerator, TableRegistry tableRegistry, TableMetaDataCache tableMetaDataCache, ClassFieldAccessorCache classFieldAccessorCache, TransactionManager transactionManager, SelectEngine selectEngine)
      Create a new Litebridge context with the specified components.
      Parameters:
      mode - The mode of operation for the Litebridge context.
      config - Configuration for managing runtime behaviour
      databaseProvider - The database provider.
      queryPlanCache - A cache for storing execution plans based on query structure.
      aliasGenerator - An alias generator for creating unique table and column aliases.
      tableRegistry - The table registry.
      tableMetaDataCache - The table metadata cache.
      classFieldAccessorCache - The class field accessor cache.
      transactionManager - The transaction manager.
      selectEngine - The select engine.
  • Method Details

    • mode

      public LitebridgeContext.Mode mode()
      Returns the context mode.
      Returns:
      the mode
    • config

      public LitebridgeConfig config()
      Returns the Litebridge configuration.
      Returns:
      the configuration
    • sqlFunctionRegistry

      public SqlFunctionRegistry sqlFunctionRegistry()
      Provides access to the SQL function registry.
      Returns:
      the SqlFunctionRegistry instance for the context
    • queryPlanCache

      public QueryPlanCache queryPlanCache()
      Provides access to the query plan cache.
      Returns:
      the QueryPlanCache instance for the context
    • mappingPlanCache

      public MappingPlanCache mappingPlanCache()
      Provides access to the mapping plan cache.
      Returns:
      the MappingPlanCache instance for the context
    • aliasGenerator

      public AliasGenerator aliasGenerator()
      Provides access to the alias generator.
      Returns:
      the AliasGenerator instance for the context
    • tableMetaDataCache

      public TableMetaDataCache tableMetaDataCache()
      Provides access to the table metadata cache.
      Returns:
      the TableMetaDataCache instance for the context
    • tableRegistry

      public TableRegistry tableRegistry()
      Provides access to the table registry.
      Returns:
      the TableRegistry instance for the context
    • databaseProvider

      public DatabaseProvider databaseProvider()
      Provides access to the database provider.
      Returns:
      the DatabaseProvider instance for the context
    • transactionManager

      public TransactionManager transactionManager()
      Provides access to the transaction manager.
      Returns:
      the TransactionManager instance for the context
    • classFieldAccessorCache

      public ClassFieldAccessorCache classFieldAccessorCache()
      Provides access to the class field accessor cache.
      Returns:
      the ClassFieldAccessorCache instance for the context
    • typeConverter

      public TypeConverter typeConverter()
      Provides access to the type converter.
      Returns:
      the TypeConverter instance for the context
    • selectExpressionMapper

      public SelectExpressionMapper selectExpressionMapper()
      Provides access to the select expression mapper.
      Returns:
      the SelectExpressionMapper instance for the context
    • selectEngine

      public SelectEngine selectEngine()
      Provides access to the select engine.
      Returns:
      the SelectEngine instance for the context
    • getRelatedDtoStrategy

      public RelatedDtoStrategy getRelatedDtoStrategy()
      Gets the context's related DTO retrieval strategy.
      Returns:
      the context's related DTO retrieval strategy
    • setRelatedDtoStrategy

      public void setRelatedDtoStrategy(RelatedDtoStrategy relatedDtoStrategy)
      Sets the context's related DTO retrieval strategy.
      Parameters:
      relatedDtoStrategy - the related DTO retrieval strategy to set
    • createQueryCompiler

      public QueryCompiler createQueryCompiler()
      Creates a new query compiler for the context.
      Returns:
      the new query compiler