Using value object properties in JPA entities

Motivation

Most of the time, when we design basic properties of a JPA entity we use easy-to-map types like java.lang.String, java.math.BigDecimal, etc.. In this post, I will discuss the the usage of value objects​1​ instead which are known from the concept of domain driven design​2​.

I will explain the benefits of using value objects and how to integrate them into JPA entities. Furthermore, this post provides useful hints for DbUnit tests of such entities.

Continue reading “Using value object properties in JPA entities”