# ExposedAutoConfiguration

@AutoConfiguration(after = [DataSourceAutoConfiguration::class])
@EnableTransactionManagement
open class ExposedAutoConfiguration(applicationContext: ApplicationContext)

Main configuration class for Exposed that can be automatically applied by Spring Boot.

This should be applied on a Spring configuration class using: `@ImportAutoConfiguration(ExposedAutoConfiguration::class)`

Note As part of the configuration, `@EnableTransactionManagement` is added without setting any attributes. This means that all attributes have their default values, including `mode = AdviceMode.PROXY` and `proxyTargetClass = false`. If the type of proxy mechanism is unexpected, the attributes can be set to the required values in a separate `@EnableTransactionManagement` on the main configuration class or in a configuration file using `spring.aop.proxy-target-class`.

## Constructors

ExposedAutoConfiguration
Link copied to clipboard
constructor(applicationContext: ApplicationContext)

## Functions

databaseConfig
Link copied to clipboard
@Bean
@ConditionalOnMissingBean(value = [DatabaseConfig::class])
open fun databaseConfig(): DatabaseConfig

Database config with default values

databaseInitializer
Link copied to clipboard
@Bean
@ConditionalOnProperty(value = ["spring.exposed.generate-ddl"], havingValue = "true", matchIfMissing = false)
open fun databaseInitializer(): DatabaseInitializer

Returns a DatabaseInitializer that auto-creates the database schema, if enabled by the property `spring.exposed.generate-ddl` in the application.properties file.

springTransactionManager
Link copied to clipboard
@Bean
open fun springTransactionManager(datasource: DataSource, databaseConfig: DatabaseConfig): SpringTransactionManager

Returns a SpringTransactionManager instance using the specified datasource and databaseConfig.