I'm quite new to all these EJB3 annotations.
At present we have to redesign our application. In general, what we want to achieve is storing documents with multi-lingual, versioned dictionaries.
DataBase desgin: (very simplified)
Documents table:
DOC_ID ..... some other doc columns DICT_ID
122 .......... 12
Dictionaries table:
DICT_ID DICT_LOCALE DICT_VALUE
12 en_GB british value
12 de_DE german value
(Dictionary is also versioned - we store versions in this table too. But to simplify, it is not important.)
The question is how to design entity beans in order to be able to write EJB query fetching document together with dictionary value for proper locale:
getDocument(docId, locale).
We have a workaround, getting the document, and then fetching the dictionary for it, but it's inefficient. We'd like to fetch millions of documents in the future.
Any suggestions for these two entity beans and EJB-query getting the document? Maybe the DB design is wrong?
We tried to use @OneToMany annotation and LEFT JOIN in the query, but we are getting PersistanceExpetion: "could not get a field value by reflection getter"
|