14-Feb-2020
How to write complex QueryDSL queries with attribute maps
In this article, I’ll show you how to write queries to JPA entities with attribute maps (fields marked with @ElementCollection) using QueryDSL.
[read more]
Not all of the JPA annotations are actually about mapping the entities to the database, or even about persistence at all. Some of them are intended to instrument the Java language for better modeling of the domain. Here’s a simple example of two domain classes that are somehow associated with each other (accessor methods are omitted for clarity):