Spring Framework

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

Screencast: Integration Testing of Spring Data JPA Repositories

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

Spring Data JPA Tutorial: Integration Testing

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

Spring from the Trenches: New Like Expressions of Spring Data JPA

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

Spring From the Trenches: Adding Validation to a REST API

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