1 Reply Latest reply on May 31, 2007 4:20 AM by Krzysztof Rudz

    General design question (entities)

    Krzysztof Rudz Newbie

      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 to. 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 use hibernate.