Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      In order to simplify and speed up the sql generation
      an ANSI quote strategy would be useful.

      The implementation would be something like :

      <?php
      class AnsiQuoteStrategy implements \Doctrine\ORM\Mapping\QuoteStrategy
      {
          /**
           * {@inheritdoc}
           */
          public function getColumnName($fieldName, ClassMetadata $class, AbstractPlatform $platform)
          {
              return $class->fieldMappings[$fieldName]['columnName'];
          }
      
          /**
           * {@inheritdoc}
           */
          public function getTableName(ClassMetadata $class, AbstractPlatform $platform)
          {
              return $class->table['name'];
          }
      
          /**
           * {@inheritdoc}
           */
          public function getSequenceName(array $definition, ClassMetadata $class, AbstractPlatform $platform)
          {
              return $definition['sequenceName'];
          }
      
          /**
           * {@inheritdoc}
           */
          public function getJoinColumnName(array $joinColumn, ClassMetadata $class, AbstractPlatform $platform)
          {
              return $joinColumn['name'];
          }
      
          /**
           * {@inheritdoc}
           */
          public function getReferencedJoinColumnName(array $joinColumn, ClassMetadata $class, AbstractPlatform $platform)
          {
              return $joinColumn['referencedColumnName'];
          }
      
          /**
           * {@inheritdoc}
           */
          public function getJoinTableName(array $association, ClassMetadata $class, AbstractPlatform $platform)
          {
              return $association['joinTable']['name'];
          }
      
          /**
           * {@inheritdoc}
           */
          public function getIdentifierColumnNames(ClassMetadata $class, AbstractPlatform $platform)
          {
              return $class->identifier;
          }
      
          /**
           * {@inheritdoc}
           */
          public function getColumnAlias($columnName, $counter, AbstractPlatform $platform, ClassMetadata $class = null)
          {
              return $platform->getSQLResultCashing($columnName . $counter);
          }
      }
      

        Activity

        Fabio B. Silva created issue -
        Fabio B. Silva made changes -
        Field Original Value New Value
        Description In order to simplify and speed up the sql generation
        an ANSI quote strategy would be useful.

        The implementations would be something like :


        {code}
        <?php
        class AnsiQuoteStrategy implements \Doctrine\ORM\Mapping\QuoteStrategy
        {
            /**
             * {@inheritdoc}
             */
            public function getColumnName($fieldName, ClassMetadata $class, AbstractPlatform $platform)
            {
                return $class->fieldMappings[$fieldName]['columnName'];
            }

            /**
             * {@inheritdoc}
             */
            public function getTableName(ClassMetadata $class, AbstractPlatform $platform)
            {
                return $class->table['name'];
            }

            /**
             * {@inheritdoc}
             */
            public function getSequenceName(array $definition, ClassMetadata $class, AbstractPlatform $platform)
            {
                return $definition['sequenceName'];
            }

            /**
             * {@inheritdoc}
             */
            public function getJoinColumnName(array $joinColumn, ClassMetadata $class, AbstractPlatform $platform)
            {
                return $joinColumn['name'];
            }

            /**
             * {@inheritdoc}
             */
            public function getReferencedJoinColumnName(array $joinColumn, ClassMetadata $class, AbstractPlatform $platform)
            {
                return $joinColumn['referencedColumnName'];
            }

            /**
             * {@inheritdoc}
             */
            public function getJoinTableName(array $association, ClassMetadata $class, AbstractPlatform $platform)
            {
                return $association['joinTable']['name'];
            }

            /**
             * {@inheritdoc}
             */
            public function getIdentifierColumnNames(ClassMetadata $class, AbstractPlatform $platform)
            {
                return $class->identifier;
            }

            /**
             * {@inheritdoc}
             */
            public function getColumnAlias($columnName, $counter, AbstractPlatform $platform, ClassMetadata $class = null)
            {
                return $platform->getSQLResultCashing($columnName . $counter);
            }
        }
        {code}
        In order to simplify and speed up the sql generation
        an ANSI quote strategy would be useful.

        The implementation would be something like :


        {code}
        <?php
        class AnsiQuoteStrategy implements \Doctrine\ORM\Mapping\QuoteStrategy
        {
            /**
             * {@inheritdoc}
             */
            public function getColumnName($fieldName, ClassMetadata $class, AbstractPlatform $platform)
            {
                return $class->fieldMappings[$fieldName]['columnName'];
            }

            /**
             * {@inheritdoc}
             */
            public function getTableName(ClassMetadata $class, AbstractPlatform $platform)
            {
                return $class->table['name'];
            }

            /**
             * {@inheritdoc}
             */
            public function getSequenceName(array $definition, ClassMetadata $class, AbstractPlatform $platform)
            {
                return $definition['sequenceName'];
            }

            /**
             * {@inheritdoc}
             */
            public function getJoinColumnName(array $joinColumn, ClassMetadata $class, AbstractPlatform $platform)
            {
                return $joinColumn['name'];
            }

            /**
             * {@inheritdoc}
             */
            public function getReferencedJoinColumnName(array $joinColumn, ClassMetadata $class, AbstractPlatform $platform)
            {
                return $joinColumn['referencedColumnName'];
            }

            /**
             * {@inheritdoc}
             */
            public function getJoinTableName(array $association, ClassMetadata $class, AbstractPlatform $platform)
            {
                return $association['joinTable']['name'];
            }

            /**
             * {@inheritdoc}
             */
            public function getIdentifierColumnNames(ClassMetadata $class, AbstractPlatform $platform)
            {
                return $class->identifier;
            }

            /**
             * {@inheritdoc}
             */
            public function getColumnAlias($columnName, $counter, AbstractPlatform $platform, ClassMetadata $class = null)
            {
                return $platform->getSQLResultCashing($columnName . $counter);
            }
        }
        {code}
        Fabio B. Silva made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Fix Version/s 2.4 [ 10321 ]

          People

          • Assignee:
            Fabio B. Silva
            Reporter:
            Fabio B. Silva
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: