Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1784

Error on generate entities: 'Attribute "allocationSize" of @ORM\SequenceGenerator'

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.2.3, 2.3
    • Component/s: Tools
    • Security Level: All
    • Labels:
      None

      Description

      When I generated my entities on version 2.2.2 through "orm:convert-mapping", the sequence has a value ' allocationSize="1", initialValue="1" ' with quotes.

      So I received an error:

      Attribute "allocationSize" of @ORM\SequenceGenerator declared on property entities\Test::$id expects a integer, but got string.

      To fix, I removed the quotes. is It a bug?

      Part of entity generated:

      /**

      • @var integer $id
        *
      • @ORM\Column(name="id", type="integer", precision=0, scale=0, nullable=false, unique=false)
      • @ORM\Id
      • @ORM\GeneratedValue(strategy="SEQUENCE")
      • @ORM\SequenceGenerator(sequenceName="test_id_seq", allocationSize="1", initialValue="1") /* SEE QUOTES ON allocationSize="1", initialValue="1" */
        */
        private $id;

        Activity

        Augusto Ximenes de Souza created issue -
        Hide
        Augusto Ximenes de Souza added a comment - - edited

        I think the problem is on the line 1037 to 1042 of Class Doctrine \ ORM \ Tools \ EntityGenerator:

        if (isset($metadata->sequenceGeneratorDefinition['allocationSize']))

        { $sequenceGenerator[] = 'allocationSize="' . $metadata->sequenceGeneratorDefinition['allocationSize'] . '"'; }

        if (isset($metadata->sequenceGeneratorDefinition['initialValue']))

        { $sequenceGenerator[] = 'initialValue="' . $metadata->sequenceGeneratorDefinition['initialValue'] . '"'; }

        Replace to:

        if (isset($metadata->sequenceGeneratorDefinition['allocationSize']))

        { $sequenceGenerator[] = 'allocationSize=' . $metadata->sequenceGeneratorDefinition['allocationSize']; }

        if (isset($metadata->sequenceGeneratorDefinition['initialValue']))

        { $sequenceGenerator[] = 'initialValue=' . $metadata->sequenceGeneratorDefinition['initialValue']; }
        Show
        Augusto Ximenes de Souza added a comment - - edited I think the problem is on the line 1037 to 1042 of Class Doctrine \ ORM \ Tools \ EntityGenerator: if (isset($metadata->sequenceGeneratorDefinition ['allocationSize'] )) { $sequenceGenerator[] = 'allocationSize="' . $metadata->sequenceGeneratorDefinition['allocationSize'] . '"'; } if (isset($metadata->sequenceGeneratorDefinition ['initialValue'] )) { $sequenceGenerator[] = 'initialValue="' . $metadata->sequenceGeneratorDefinition['initialValue'] . '"'; } Replace to: if (isset($metadata->sequenceGeneratorDefinition ['allocationSize'] )) { $sequenceGenerator[] = 'allocationSize=' . $metadata->sequenceGeneratorDefinition['allocationSize']; } if (isset($metadata->sequenceGeneratorDefinition ['initialValue'] )) { $sequenceGenerator[] = 'initialValue=' . $metadata->sequenceGeneratorDefinition['initialValue']; }
        Fabio B. Silva made changes -
        Field Original Value New Value
        Assignee Benjamin Eberlei [ beberlei ] Fabio B. Silva [ fabio.bat.silva ]
        Show
        Fabio B. Silva added a comment - Fixed by : https://github.com/doctrine/doctrine2/commit/d5d47222c1dc5ea97ebd8f4c68834fbe4abeb238
        Fabio B. Silva made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.3 [ 10185 ]
        Resolution Fixed [ 1 ]
        Hide
        Benjamin Eberlei added a comment -

        Merged into 2.2

        Show
        Benjamin Eberlei added a comment - Merged into 2.2
        Benjamin Eberlei made changes -
        Fix Version/s 2.2.3 [ 10196 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 13641 ] jira-feedback [ 15324 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 15324 ] jira-feedback2 [ 17188 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17188 ] jira-feedback3 [ 19443 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-1784, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Fabio B. Silva
            Reporter:
            Augusto Ximenes de Souza
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: