Explicitly set Id with Doctrine when using “AUTO” strategy

前端 未结 7 704
时光说笑
时光说笑 2020-12-02 05:36

My entity uses this annotation for it\'s ID:

/**
 * @orm:Id
 * @orm:Column(type=\"integer\")
 * @orm:GeneratedValue(s         


        
7条回答
  •  清歌不尽
    2020-12-02 05:53

    In case the entity is part of a class table inheritance you need to change the id-generator in the class metadata for both entities (the entity you are persisting and the root entity)

提交回复
热议问题