Multi-tenancy with Hibernate 4

Multi-tenancy indicates an approach in software development where a single application simultaneously serves multiple clients. These clients are also called tenants. This approach is very common in Software as a Service (SaaS) solutions.

Concurrency control with Hibernate 4

Most of the time it is OK to simply let the database do the work of concurrency control, however sometimes you can encounter an application where you need to take over. In this article I will give a brief introduction…

Auditing with Hibernate 4

In this article I will give you a brief introduction to Entity auditing with Hibernate, or to be more specific with Hibernate Envers which is since some 3.x version part of the Hibernate core.

Caching with Hibernate 4

If you have a bigger application you think about performance and how you can improve it. Caching is one way to do this because it enables fewer queries going to the database. Querying the database is always a performance impact…

Entity relations with Hibernate 4

Last time I introduced annotations instead XML configuration. Now I will dig deeper and show how you can create entity relations and map them to the database. If you look at the Book entity in the example you might think:…

Hibernate 4 Database configuration

In the previous articles I have shown you how to get started with Hibernate 4: create entities, manage relations and inheritance and how to query the stored data. However every time I used an in-memory database which means that every…

Hibernate 4 annotations Configuration

In the last, introductory article I mentioned the so-called “XML-Hell” which is the massive usage of XML to do Hibernate configuration. In this article, I will introduce the annotation-based configuration, where you can use Hibernate’s annotations on the entities to…