Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7017243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:53:21+00:00 2026-05-27T22:53:21+00:00

I have a multilingual database(inspired from here, the 3rd option .) My database schema

  • 0

I have a multilingual database(inspired from here, the 3rd option.)

My database schema looks like this:

 Article:          (id, fk_name, fk_description, fk_reference, fk_um)
 Translation:      (id)
 TranslationText:  (id, fk_translation, fk_language,text)
 Language          (id, name)     

 Article --(M:1)--> Translation --(1:M)--> TranslationText --(M:1)--> Language

I’m using Symfony 2 with Doctrine and i need a report for all Articles in a certain language(passsed as parameter).

The problem appers when an Article has a Name, Description or Reference in a particular language but doesn’t have Um(at least not in the language requested).

My best aproach so far is this SQL that i can’t implement in Doctrine 2 due to the lack of nested joins.(language_id = 28)

 select ing.*
    , tx_name.text, tx_description.text, tx_reference.text, tx_um.text
 from Article ing 
 left join (Translation t_name left
           join TranslationText tx_name
             on t_name.id = tx_name.fk_translation
             and tx_name.fk_language = 28)
        on ing.fk_name = t_name.id 
 left join (Translation t_description
           left join TranslationText tx_description
             on t_description.id = tx_description.fk_translation
             and tx_description.fk_language = 28)
        on ing.fk_description = t_description.id
 left join (Translation t_reference
           left join TranslationText tx_reference
             on t_reference.id = tx_reference.fk_translation
             and tx_reference.fk_language = 28)
        on ing.fk_reference = t_reference.id
 left join (Translation t_um
           left join TranslationText tx_um
             on t_um.id = tx_um.fk_translation
             and tx_um.fk_language = 28)
         on ing.fk_um = t_um.id
     ;

Is there anyway to simplify the query and to make it work in Doctrine’s DQL ?

Kind Regards,

Dan Cearnau

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:53:22+00:00Added an answer on May 27, 2026 at 10:53 pm

    I’ll try to write your query without subselects(subjoins):
    The indented join are at the same level of dbms p.o.v, but for us are dependent on previous tables.

    select ing.*
        , tx_name.text 
        , tx_description.text
        , tx_reference.text
        , tx_um.text
    from Article ing 
      left join Translation t_name on ing.fk_name = t_name.id 
         left join TranslationText tx_name
                 on (t_name.id = tx_name.fk_translation
                 and tx_name.fk_language = 28)
      left join Translation t_description on ing.fk_description = t_description.id
         left join TranslationText tx_description
                 on (t_description.id = tx_description.fk_translation
                 and tx_description.fk_language = 28)
      left join Translation translation_reference on ing.fk_reference = translation_reference.id
         left join TranslationText tx_reference
                 on (translation_reference.id = tx_reference.fk_translation
                 and tx_reference.fk_language = 28)
      left join Translation translation_um on ing.fk_um = translation_um.id
         left join TranslationText tx_um
                 on (translation_um.id = tx_um.fk_translation
                 and tx_um.fk_language = 28);
    

    Also, I think your model is overnormalized.
    For me, this is better:

    Article:          (id, another_columns)
    TranslationText:  (fk_article_id, fk_language,name_text, description_text, reference_text, um_text)
    Language          (id, name)   
    

    As I see now, this is the model indicate in the most voted answer for the question indicated in your link

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to create a multilingual table so i choose this schema: Article (
I have a database where encoding is UTF-8 for multilingual purpose. I this that
I'm writing multilingual website. I have several files on server like: /index.php /files.php /funny.php
I've designed a multilingual web site and some values in database have a tag
I want to make multilingual buttons, like those of the messagebuttons. I have a
Here is my problem: I have a multilingual SharePoint application and I have PerformancePoint
I have a multilingual website (Chinese and English). I like to validate a text
ok, here is my problem. I have a multilingual app. I translate the ui
I have built a multilingual website with CodeIgniter using this library: http://codeigniter.com/wiki/URI_Language_Identifier/ I use
I have a multilanggual website. I would like to store Locatilzation in database instead

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.