Doctrine 2: cascade persist Oracle “IDENTITY” is returning 0 as last inserted ID

前端 未结 1 1789
北恋
北恋 2021-01-29 04:58

I am using doctrine 2 with oracle, the tables in the database has some triggers that generate the IDs, and my ID mapping of my tables is like the following:

/**
         


        
相关标签:
1条回答
  • 2021-01-29 05:36

    Oracle doesn't support auto incrementing, so you cannot use the "IDENTITY" strategy in Doctrine. You'll have to use the "SEQUENCE" (or "AUTO") strategy.

    When specifying "AUTO", Doctrine will use "IDENTITY" for MySql and "SEQUENCE" for Oracle.

    http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html#identifier-generation-strategies

    0 讨论(0)
提交回复
热议问题