Using JPA I realize that I have dynamic growing entities, i.e. the number of properties might be vary for an entity. Knowing that there a some solutions based on key-value tables I would be interested in having more information about how to apply that techniques to JPA (JPQL).
An example structure would look like:
REF-ID KEY VALUE
1000 name foo
1000 category basic
1001 name bar
1001 category advanced
1001 descr none
--------------------|------------
PRIMARY |
The problem know is that this kind of table might grow enormously, up to millions of records. And the next question is how to map queries, something like
SELECT name, category, descr
FROM KEYSTORE
WHERE id=1000;
... where descr might be available or not
Is there any concept that I missing here to fit this requirements when using JPA or do I have to use other techniques here? What about performance?