Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDC-3445: ERROR GENERATED VALUE (UUID) #4253

Closed
doctrinebot opened this issue Dec 10, 2014 · 3 comments
Closed

DDC-3445: ERROR GENERATED VALUE (UUID) #4253

doctrinebot opened this issue Dec 10, 2014 · 3 comments
Assignees
Labels

Comments

@doctrinebot
Copy link

Jira issue originally created by user AdenKejawen:

UUID is not working (missing ID and need to set manually)

/****
 * @ORM\Entity
 * @ORM\Table(name = "utl_role")
 */
class Role implements EntityInterface
{
    /****
     * @ORM\Id
     * @ORM\Column(name = "id", type = "guid")
     * @ORM\GeneratedValue(strategy = "UUID")
     ****/
    protected $id;

i need to pass the id manually

$role->setId((new UuidGenerator())->generate($this->em, $role));

because the id is not set and error when i try to persist.

This error is arrive when i try to persist an entity i loop

I use postgresql 9.3

@doctrinebot
Copy link
Author

Comment created by @Ocramius:

Can you check this also against master (2.5-dev)?

@doctrinebot
Copy link
Author

Comment created by AdenKejawen:

i think it same because the uuid generator is same

https://github.com/doctrine/doctrine2/blob/master/lib%2FDoctrine%2FORM%2FId%2FUuidGenerator.php#L42

in that code, i see the uuid is generated from database provider/platform, i suggest to use code base generator like

https://github.com/ramsey/uuid/blob/master/src%2FUuid.php

it just my suggestion

thanks

@doctrinebot doctrinebot added the Bug label Dec 7, 2015
@ostrolucky ostrolucky added this to the 3.0 milestone Aug 5, 2018
@ostrolucky
Copy link
Member

Due to various issues, support for DB-generated UUIDs has been dropped in Doctrine/DBAL 3.0. See #7330 or doctrine/dbal#3211. Hence, this issue is no longer relevant.

@ostrolucky ostrolucky assigned ostrolucky and unassigned beberlei Aug 10, 2018
@greg0ire greg0ire removed this from the 3.0.0 milestone Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants