Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-787

Camelcase tablename lost when creating models based on the database

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA4
    • Fix Version/s: 2.0-RC1
    • Component/s: Tools
    • Security Level: All
    • Labels:
      None
    • Environment:
      Ubuntu
      MySQL 5.1

      Description

      I have a table articleLocale and I created the model with the doctrine tool using the following command: # doctrine orm:convert-mapping --from-database annotation temp.

      The model that was created was Articlelocale instead of ArticleLocale and the annotations were wrong.

      <?php
      /**
       * Articlelocale
       *
       * @Table(name="articlelocale")
       * @Entity
       */
      class Articlelocale
      {
      //....
      }
      

      When trying to fetch some data, I get the following error: Message: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'doctrine.articlelocale' doesn't exist
      If i change the annotation so that it reads articleLocale instead of articlelocale it works like it should be working.

      <?php
      /**
       * Articlelocale
       *
       * @Table(name="articleLocale")
       * @Entity
       */
      class Articlelocale
      {
      //....
      }
      

      So there is a problem with camelCase table names.

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Fixed

        Show
        Benjamin Eberlei added a comment - Fixed

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Van Hauwaert Bert
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: