Welcome

Hibernate Merge may Cause EAGER Initialization of LAZY OneToOne Associations

Let’s have following two simple entities, having 1:1 lazy association between each other. @Entity @Table(name=”T_FOO”) public class Foo { @Id @GeneratedValue private Long id; @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE) @JoinColumn(name = “bar_id”) private Bar bar; public Long getId() { return id; } public Bar getBar() { return bar; } public void setBar(Bar bar) { […]

Feature Interaction Problems and Spring Security

Feature interaction problem is something that features work smoothly and without any problem in your system individually; however, problems arise with those features when you bring them together. Bertrand Meyer has recently published his thoughts about the topic as well. While reading on it, I’ve come to realize that Spring Security has several similar issues […]

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 able to both execute your persistence operations which usually expect an active transaction to run, and also rollback state changes occur during execution of these persistence operations […]

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 […]

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, […]

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 […]

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 […]

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 […]