Example complex JPA implementation using Hibernate