The @Scheduled annotation offers an easy way to create scheduled tasks in Spring powered applications. We can use it to schedule our tasks by using either periodic scheduling or cron expressions. Although period scheduling can also be useful, the cron expressions give us much more control over the invocation of the scheduled tasks. That is […] Read more
Spring Framework
I think that the integration testing of Spring Data Repositories is an important and often neglected topic. That is why I decided to turn my recent blog post about it into a screencast which answers to the following question: How can we write tests for our repositories because after all, they are just interfaces? This […] Read more
My Spring Data JPA tutorial has taught us that we can create database queries and persist entities in the database by using special repository interfaces. This raises an interesting question: How can we write integration tests for our Spring Data JPA repositories because they are just interfaces? This blog post answers to that question. During […] Read more
Today's war story talks about the like expression handling of Spring Data JPA. Although I have written earlier about a better solution for implementing text based search functions, using an external search server like Solr is not a viable option if the implemented search function is rather simple. Let's consider the following example. Using the […] Read more
I received a question from a reader of my Spring Data book last week and decided to publish my answer as a blog post. The question was: How can I use Querydsl with Spring Data JPA in a multi-module Maven project? This blog post answers to that question and describes how we can create a […] Read more
I am a bit ashamed to admit this but until yesterday, I had no idea that I can add validation to a REST API by using the @Valid and the @RequestBody annotations. This was not working in Spring MVC 3.0 and for some reason I had not noticed that the support for this was added […] Read more