1
vote
1answer
376 views

Is Java's ElementCollection Considered a Bad Practice?

From my understanding, an ElementCollection has no primary key, is embedded with the class, and cannot be queried. This sounds pretty hefty, but it allows me the comfort of writing an enum class which ...
1
vote
2answers
1k views

Designing complex query builders in java/jpa/hibernate

I need to build complex sql queries programatically, based on large filter conditions. For example, below are few sample/hypothitical filter conditions, based on which i need to fetch users Country: ...
2
votes
1answer
868 views

When using Java Persistence API (JPA), which layer owns the entities?

When working with annotations on entities in JPA, do these entities belong to the model layer or the persistence layer? Does there have to be some kind of clone of the entities (simple JavaBeans) in ...