mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-3558: Sequence name generation for identity strategy #4375
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Feb 4, 2015).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user Gemorroj:
In version 2.5 added support sequence with the strategy of identity.
But I cannot get the correct name of the sequence with the strategy of identity. With the strategy sequence produces the correct name. It is taken from the configuration sequenceName. Strategy identity name sequence will not be taken from the configuration, and is always generated is automatically (which is not working properly in my case).
see:
4c68a38bd6/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php (L632)the title sequence is generated automatically.
4c68a38bd6/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php (L662)and in this case, it first checks its own configuration.
@doctrinebot commented on GitHub (Feb 5, 2015):
Comment created by Gemorroj:
Any comments plz..?
@doctrinebot commented on GitHub (Feb 5, 2015):
Comment created by @ocramius:
[~Gemorroj] consider writing a test case with your problem/example: I can't understand the issue as it is currently written down.
A code example is also fine.
@doctrinebot commented on GitHub (Feb 5, 2015):
Comment created by Gemorroj:
If you use the strategy SEQUENCE, the doctrine calls the sequence specified in the configuration. And inserts a record in the database with the specified ID.
If you are using the IDENTITY strategy, doctrine inserts a record without an ID. And after a record is inserted, causes sequence (
8cbfefe03f/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php (L148)) to learn the value of id.But, with the IDENTITY strategy, doctrine does not know how actually called a sequence.
!Захват-1.png!
@doctrinebot commented on GitHub (Feb 5, 2015):
Comment created by @ocramius:
Yes, when using the
IDENTITYstrategy, the sequence name is not used:4c68a38bd6/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php (L626-L657)That's expected behavior: what are you expecting?
@doctrinebot commented on GitHub (Feb 5, 2015):
Comment created by Gemorroj:
If doctrine determines that the database uses the sequence, then I expect the setup sequence doctrine is taken from the configuration.
4c68a38bd6/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php (L636-L638)The generated name sequence wrong for me.
@doctrinebot commented on GitHub (Feb 5, 2015):
Comment created by @ocramius:
You should rather just use the
SEQUENCEstrategy.Otherwise, provide a functional test case and eventually propose a fix.