Class IridaApiJdbcDataSourceConfig


  • @Configuration
    @EntityScan(basePackages={"ca.corefacility.bioinformatics.irida.model","ca.corefacility.bioinformatics.irida.repositories.relational.auditing"})
    public class IridaApiJdbcDataSourceConfig
    extends java.lang.Object
    Configuration for IRIDA's JDBC Datasource
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  IridaApiJdbcDataSourceConfig.ApplicationContextAwareSpringLiquibase
      Custom implementation of the SpringLiquibase bean (for doing liquibase on spring startup) that exposes the application context so that we can have access to the application context in custom java changesets.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      liquibase.integration.spring.SpringLiquibase springLiquibase​(javax.sql.DataSource dataSource, org.springframework.context.ApplicationContext applicationContext)
      Create an instance of SpringLiquibase to update the database schema with liquibase change sets.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IridaApiJdbcDataSourceConfig

        public IridaApiJdbcDataSourceConfig()
    • Method Detail

      • springLiquibase

        @Bean
        public liquibase.integration.spring.SpringLiquibase springLiquibase​(javax.sql.DataSource dataSource,
                                                                            org.springframework.context.ApplicationContext applicationContext)
        Create an instance of SpringLiquibase to update the database schema with liquibase change sets. This bean should only be invoked in a production/dev environment and should *not* be invoked if Hibernate is going to be creating the database schema. The scenario should not come up, however we will test to see if Hibernate is set to generate a schema before executing.
        Parameters:
        dataSource - the connection to use to migrate the database
        applicationContext - the Spring Application Context
        Returns:
        an instance of SpringLiquibase.