java.lang.Object
org.litebridge.orm.engine.LitebridgeContext
A context object that provides access to core Litebridge components and configuration.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe operational mode of Litebridge. -
Constructor Summary
ConstructorsConstructorDescriptionLitebridgeContext(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.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. -
Method Summary
Modifier and TypeMethodDescriptionProvides access to the alias generator.Provides access to the class field accessor cache.config()Returns the Litebridge configuration.Creates a new query compiler for the context.Provides access to the database provider.Gets the context's related DTO retrieval strategy.Provides access to the mapping plan cache.mode()Returns the context mode.Provides access to the query plan cache.Provides access to the select engine.Provides access to the select expression mapper.voidsetRelatedDtoStrategy(RelatedDtoStrategy relatedDtoStrategy) Sets the context's related DTO retrieval strategy.Provides access to the SQL function registry.Provides access to the table metadata cache.Provides access to the table registry.Provides access to the transaction manager.Provides access to the type converter.
-
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 behaviourdatabaseProvider- 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 behaviourdatabaseProvider- 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
Returns the context mode.- Returns:
- the mode
-
config
Returns the Litebridge configuration.- Returns:
- the configuration
-
sqlFunctionRegistry
Provides access to the SQL function registry.- Returns:
- the
SqlFunctionRegistryinstance for the context
-
queryPlanCache
Provides access to the query plan cache.- Returns:
- the
QueryPlanCacheinstance for the context
-
mappingPlanCache
Provides access to the mapping plan cache.- Returns:
- the
MappingPlanCacheinstance for the context
-
aliasGenerator
Provides access to the alias generator.- Returns:
- the
AliasGeneratorinstance for the context
-
tableMetaDataCache
Provides access to the table metadata cache.- Returns:
- the
TableMetaDataCacheinstance for the context
-
tableRegistry
Provides access to the table registry.- Returns:
- the
TableRegistryinstance for the context
-
databaseProvider
Provides access to the database provider.- Returns:
- the
DatabaseProviderinstance for the context
-
transactionManager
Provides access to the transaction manager.- Returns:
- the
TransactionManagerinstance for the context
-
classFieldAccessorCache
Provides access to the class field accessor cache.- Returns:
- the
ClassFieldAccessorCacheinstance for the context
-
typeConverter
Provides access to the type converter.- Returns:
- the
TypeConverterinstance for the context
-
selectExpressionMapper
Provides access to the select expression mapper.- Returns:
- the
SelectExpressionMapperinstance for the context
-
selectEngine
Provides access to the select engine.- Returns:
- the
SelectEngineinstance for the context
-
getRelatedDtoStrategy
Gets the context's related DTO retrieval strategy.- Returns:
- the context's related DTO retrieval strategy
-
setRelatedDtoStrategy
Sets the context's related DTO retrieval strategy.- Parameters:
relatedDtoStrategy- the related DTO retrieval strategy to set
-
createQueryCompiler
Creates a new query compiler for the context.- Returns:
- the new query compiler
-