Spring JPA – Delete by multiple values

After, apparently, encountering a JPA bug with delete all by in the repository, I had to figure out the best approach to run a delete by query. Using named query on the entity seems to work just as expected, so I am posting the link to the solution here as a reference: https://medium.com/the-full-stack-developer/how-to-delete-records-in-spring-data-based-on-multiple-values-563500ad51cc

Hibernate JPA and PostgreSQL: change type from String to text (@Lob)

In existing table with data populated, changing the column type from string to text requires some migration. For large data type, Postgres stores the data in a separate location and just references it by using an ID. This means that, until then, column data would be a string content and after the change, it would…

Liquibase SpringBoot Multiple Data Sources

I was working on an example of how to get Liquibase with SpringBoot and multiple databases working. After some documentation and reading stackoverflow, here it is, for a future reference: https://github.com/divukman/liquibase_spring_boot_example

Spring Boot JPA Test Splice

Here is a small example that: Uses @DataJpaTest annotation to bring in only configuration relevant for JPA tests (entities, repos etc…) Uses @TestMethodOrder(MethodOrderer.OrderAnnotation.class) and @Order annotations to enforce order of method execution Uses @ComponentScan(basePackages = {“tech.dimitar.rosdjpaint.bootstrap”}) annotation to bring in the component that bootstraps the data Uses @Commit annotation on test to enforce transaction does…