2012-06-07 45 views
0

我想創建兩個oneToMany關係到一個表。但是,當我生成實體時,連接列不會在Foo實體上生成。這裏是我的YAML:oneToMany/ManyToOne雙向關聯不生成教條2中的連接列

User.orm.yml

Acme\SomeBundle\Entity\User: 
    type: entity 
    table: user 
    id: 
    id: 
     type: integer 
     generator: 
     strategy: AUTO 
    fields: 
    firstname: 
     type: string 
     length: 40 
    created_at: 
     type: datetime 
     gedmo: 
     timestampable: 
      on: create 
    updated_at: 
     type: datetime 
     gedmo: 
     timestampable: 
      on: update 
    oneToMany: 
    foos: 
     targetEntity: Foo 
     mappedBy: user 

Artist.orm.yml

Acme\SomeBundle\Entity\Artist: 
    type: entity 
    table: artist 
    id: 
    id: 
     type: integer 
     generator: 
     strategy: AUTO 
    fields: 
    name: 
     type: string 
     length: 100 
    oneToMany: 
    foos: 
     targetEntity: Foo 
     mappedBy: artist 

Foo.orm.yml

Acme\SomeBundle\Entity\Foo: 
    type: entity 
    table: foo 
    id: 
    id: 
     type: integer 
     generator: 
     strategy: AUTO 
    fields: 
    created_at: 
     type: datetime 
     gedmo: 
     timestampable: 
      on: create 
    updated_at: 
     type: datetime 
     gedmo: 
     timestampable: 
      on: update 
    ManyToOne: 
    artist: 
     targetEntity: Artist 
     inversedBy: foos 
    user: 
     targetEntity: User 
     inversedBy: foos 

在Foo表上只創建id,created_at和updated_at列,同時還應創建兩個連接列。我也嘗試在我的yaml文件中手動定義連接列,但the docs表示這不應該是必要的。

任何人都有線索?

回答

0

Pfff原來是ManyToMany上的大寫字母M.應該是manyToMany