Weird Rollback Behavior of Spring TestContext Framework

One of the nice features of TestContext module of Spring Application Framework is its ability to run unit tests within a transaction context. By that way, you are both able to execute your persistence operations which usually expect an active transaction to run, and able to rollback state changes occur during execution of these persistence […]

Read More →
When It is Useful to Make Use of JPA @MapKey?

As you probably know, JPA provides way to map collection associations using java.util.Map. However, usage scenarios for such mappings are limited, but when it comes, they are invaluable to easily extract necessary information from your domain model. They are especially useful in order to categorize entities in your associated collection based on some unique key […]

Read More →
Activating Authorization Success Event Publish Feature

Spring Security publishes various authentication and authorization events during performing its security checks. Spring managed beans which implement ApplicationListener interface or beans with methods annotated with @EventListener can consume those events within the application. One of those security related events is AuthorizedEvent which indicates that user request is allowed to access secure web resource. It […]

Read More →
Configuring Vaadin without web.xml

There is always room for improvement in programming. After my initial post about configuring Vaadin in simple 6 steps, my friend indicated that we could use annotation based configuration to get rid of web.xml in our Vaadin configuration. Yes, he is right. It is possible to configure Vaadin with annotations. Let’s see how it is; […]

Read More →
How to Start Working with Vaadin

We are highly satisfied with Vaadin UI Framework. I recommend it to anyone who are asking advice about what UI framework to use in their web applications. This article, however, is not about why we love Vaadin. It might be a topic for another article. I will try to show, in this article, how to […]

Read More →
Spring XML ve Annotation Tabanlı Konfigürasyonlar Birbirinin Aynısı mı?

Yakın bir zamanda Beginning Spring isimli kitabımız üzerinden Spring öğrenmeye çalışan bir arkadaşımdan kitapta okudukları sonrasında kafasında beliren böyle bir soru geldi. Kendisine verdiğim cevap belki Spring ile çalışan veya çalışmaya başlayacak arkadaşların da işine yarayabilir düşüncesi ile buradan paylaşıyorum. Spring ApplicationContext’e hangi sınıfları kullanarak hangi bean’leri oluşturacağını, bu bean’lerin özelliklerinin neler olacağını, bean’ler arasındaki […]

Read More →
Observations about OData and Spring Data REST

Recently I had a chance to spend some time reading about OData and experiment with Apache OLingo Project in order to understand what OData provides us with in terms of making our REST services more standardized and self discoverable. I also compared it with Spring Data REST Project, what are their similarities and differences, whether […]

Read More →
Factory Method Pattern Implementation of Spring: FactoryBean

Factory method pattern aims to encapsulate object creation process within a method. That’s why it is called as factory method pattern. They can be created as either static or instance methods within a class. In Spring Application Framework, although it is possible to make use of static or instance factory methods to create Spring managed […]

Read More →
A Slight Difference Between Autowire byType and constructor

Spring documentation states that both autowire byType and constructor modes expect at most one bean definition in the ApplicationContext, so that it can be autowired into the depending bean. Here is the excerpt taken from Spring Reference Documentation Table 6.2. Autowiring modes; byType Allows a property to be autowired if exactly one bean of the […]

Read More →