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 very limited; but when it comes, they become highly 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 […]

Read More →
Activating Authorization Success Event Publish Feature

Spring Security publishes various authentication and authorization events during 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 is, […]

Read More →
Configuring Vaadin without web.xml

There is always room for improvement in programming world. After my initial post about configuring Vaadin in 6 simple steps, one of my friends indicated that we could have used 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 without […]

Read More →
How to Start Working with Vaadin

We are highly satisfied with Vaadin UI Framework in our enterprise Java projects. I recommend it to anyone who are asking advice about what UI framework to use in their enterprise web applications. This article, however, is not about why we like Vaadin. It might be a topic for another article. I will try 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 separate method in your system. That’s why it is called as so. Factory methods 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 […]

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 →
A Transaction Gotcha When Using Spring with Hibernate

Spring’s transaction propagation rule SUPPORTS states that if there exists a transaction when the method is called, it should work within that transaction, otherwise it should work outside any transaction. Similarly, transaction propagation rule NOT_SUPPORTED states that if there exists any active transaction when the method is called, that active transaction should be suspended before […]

Read More →