Class LiquibaseDaoImpl

Object
AbstractJPADao<LiquibaseChangelog,String>
LiquibaseDaoImpl
All Implemented Interfaces:
Dao<LiquibaseChangelog,String>, LiquibaseDao

@Repository public class LiquibaseDaoImpl extends AbstractJPADao<LiquibaseChangelog,String> implements LiquibaseDao
DAO para buscar changelogs aplicados no banco de dados. Por serem registros gerenciados pelo Liquibase, não é permitido modificar os mesmos.
Author:
Tiago Inaba
  • Field Details

    • jdbcTemplate

      @Autowired protected NamedParameterJdbcTemplate jdbcTemplate
  • Constructor Details

    • LiquibaseDaoImpl

      public LiquibaseDaoImpl()
  • Method Details

    • remove

      public void remove(LiquibaseChangelog e)
      Specified by:
      remove in interface Dao<LiquibaseChangelog,String>
      Overrides:
      remove in class AbstractJPADao<LiquibaseChangelog,String>
    • removeById

      public void removeById(String id)
      Specified by:
      removeById in interface Dao<LiquibaseChangelog,String>
      Overrides:
      removeById in class AbstractJPADao<LiquibaseChangelog,String>
    • save

      public LiquibaseChangelog save(LiquibaseChangelog e)
      Specified by:
      save in interface Dao<LiquibaseChangelog,String>
      Overrides:
      save in class AbstractJPADao<LiquibaseChangelog,String>
    • update

      public LiquibaseChangelog update(LiquibaseChangelog e)
      Specified by:
      update in interface Dao<LiquibaseChangelog,String>
      Overrides:
      update in class AbstractJPADao<LiquibaseChangelog,String>
    • getAppliedMigrations

      @Transactional(propagation=REQUIRED) public List<LiquibaseChangelog> getAppliedMigrations(String tablename)
      PostgreSQL armazena tabelas em lowercase, e o Oracle em uppercase. Por isso, para checar se a tabela existe, é necessária a checagem do banco de dados. Para o `SELECT` só é necessário transformar em uppercase para manter a compatibilidade com o Oracle, pois o PostgreSQL transforma em lowercase automaticamente, a não ser que cercado por aspas duplas.
      Specified by:
      getAppliedMigrations in interface LiquibaseDao