DDC-554: Sequence Names in XML Driver #683

Closed
opened 2026-01-22 12:46:47 +01:00 by admin · 1 comment
Owner

Originally created by @doctrinebot on GitHub (Apr 29, 2010).

Originally assigned to: @jwage on GitHub.

Jira issue originally created by user @beberlei:

Hi all,

I'm working with Doctrine 2.0 ALPHA 4 on Opensolaris with PHP 5.3 and Postgresql 8.3.

When specifiying a sequence name in xml mapping file, Doctrine doesn't seems to use it. After debugging time, i found in ORM/Mapping/Driver/XmlDriver.php on line 193 :

            // Check for SequenceGenerator/TableGenerator definition
            if (isset($idElement->{'sequence-generator'})) {
                $seqGenerator = $idElement->{'sequence-generator'};
                $metadata->setSequenceGeneratorDefinition(array(
                    'sequenceName' => $seqGenerator->{'sequence-name'},
                    'allocationSize' => $seqGenerator->{'allocation-size'},
                    'initialValue' => $seqGeneratorAnnot->{'initial-value'}
                ));
            } else if (isset($idElement->{'table-generator'})) {
                throw MappingException::tableIdGeneratorNotImplemented($className);
            }

Obviously $seqGenerator->{'sequence-name'} return void things, even if xml file is correct. So i decided to replace it with : $seqGenerator['sequence-name']

            // Check for SequenceGenerator/TableGenerator definition
            if (isset($idElement->{'sequence-generator'})) {
                $seqGenerator = $idElement->{'sequence-generator'};
                $metadata->setSequenceGeneratorDefinition(array(
                    'sequenceName' => (string)$seqGenerator['sequence-name'],
                    'allocationSize' => (string)$seqGenerator['allocation-size'],
                    'initialValue' => (string)$seqGeneratorAnnot['initial-value']
                ));
            } else if (isset($idElement->{'table-generator'})) {
                throw MappingException::tableIdGeneratorNotImplemented($className);
            }

Hope it will be usefull.

Paul Fariello

Originally created by @doctrinebot on GitHub (Apr 29, 2010). Originally assigned to: @jwage on GitHub. Jira issue originally created by user @beberlei: Hi all, I'm working with Doctrine 2.0 ALPHA 4 on Opensolaris with PHP 5.3 and Postgresql 8.3. When specifiying a sequence name in xml mapping file, Doctrine doesn't seems to use it. After debugging time, i found in ORM/Mapping/Driver/XmlDriver.php on line 193 : ``` // Check for SequenceGenerator/TableGenerator definition if (isset($idElement->{'sequence-generator'})) { $seqGenerator = $idElement->{'sequence-generator'}; $metadata->setSequenceGeneratorDefinition(array( 'sequenceName' => $seqGenerator->{'sequence-name'}, 'allocationSize' => $seqGenerator->{'allocation-size'}, 'initialValue' => $seqGeneratorAnnot->{'initial-value'} )); } else if (isset($idElement->{'table-generator'})) { throw MappingException::tableIdGeneratorNotImplemented($className); } ``` Obviously $seqGenerator->{'sequence-name'} return void things, even if xml file is correct. So i decided to replace it with : $seqGenerator['sequence-name'] ``` // Check for SequenceGenerator/TableGenerator definition if (isset($idElement->{'sequence-generator'})) { $seqGenerator = $idElement->{'sequence-generator'}; $metadata->setSequenceGeneratorDefinition(array( 'sequenceName' => (string)$seqGenerator['sequence-name'], 'allocationSize' => (string)$seqGenerator['allocation-size'], 'initialValue' => (string)$seqGeneratorAnnot['initial-value'] )); } else if (isset($idElement->{'table-generator'})) { throw MappingException::tableIdGeneratorNotImplemented($className); } ``` Hope it will be usefull. ## Paul Fariello
admin added the Bug label 2026-01-22 12:46:47 +01:00
admin closed this issue 2026-01-22 12:46:49 +01:00
Author
Owner

@doctrinebot commented on GitHub (Apr 29, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Apr 29, 2010): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#683