A few weeks ago we learned how we can parse date and time information from a request parameter by using the @DateTimeFormat annotation. This is a simple and clean solution that works very well if we don't have "too many" controller methods that use this approach. The drawback of this solution is that we have […] Read more
Spring Framework
A few days ago I had to write a controller method that is used to upload files to a Spring web application. This is an easy task, but I had another requirement that turned out to be a problem: every file has an expiration date that must be given when the file is uploaded. What […] Read more
When we hear the word auditing, the first thing that comes to mind is an audit log that contains each version of the audited entity. Implementing an audit log is a complex task that takes a lot of time. Luckily, most of the time we don’t need to do it. However, it is quite common […] Read more
When we hear the word auditing, the first thing that comes to mind is an audit log that contains each version of the audited entity. Implementing an audit log is a complex task that takes a lot of time. Luckily, most of the time we don’t need to do it. However, it is quite common […] Read more
The previous part of this tutorial described how we can create database queries with the @Query annotation. This tutorial has now covered two of the three methods which we can use to create query methods with Spring Data JPA. This blog post describes the last method. We will learn to create database queries by using […] Read more
The previous part of this tutorial described how we can create database queries from the method names of our query methods. Although that strategy has its advantages, it has its weaknesses as well. This blog post describes how we can avoid those weaknesses by using the @Query annotation. We will also implement a simple search […] Read more