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 … Continue reading Hibernate JPA and PostgreSQL: change type from String to text (@Lob)

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 executionUses @ComponentScan(basePackages = {"tech.dimitar.rosdjpaint.bootstrap"}) annotation to bring in the component that bootstraps the dataUses @Commit annotation on test to enforce transaction does not roll back … Continue reading Spring Boot JPA Test Splice