dragon321723 2012-07-03 00:13
浏览 39

关于学说2映射的问题Yaml

I am trying to get these mappings right but I just cannot seem to and would love some advice...

Entities\User:
  type: entity
  oneToMany:
    citations:
      targetEntity: Citation
      mappedBy: user
      cascade: ["all"]

Entities\Citation:
  type: entity
  manyToOne:
    item:
      targetEntity: Item
      inversedBy: citations
      joinColumn:
        name: item_id
        referencedColumnName: id
  manyToOne:
    user:
      targetEntity: User
      inversedBy: citations
      joinColumn:
        name: user_id
        referencedColumnName: id


Entities\Item:
  type: entity
  oneToMany:
    authors:
      targetEntity: Author
      mappedBy: item
      cascade: ["all"]
  oneToMany:
    citations:
      targetEntity: Citation
      mappedBy: item


Entities\Author:
  type: entity
  manyToOne:
    item:
      targetEntity: Item
      inversedBy: authors

The errors I get from the schema validator tool are:

[Mapping] FAIL - The entity-class 'Entities\Item' mapping is invalid: * The association Entities\Item#citations refers to the owning side field Entities\Citation#item which does not exist.

[Mapping] FAIL - The entity-class 'Entities\Citation' mapping is invalid: * The association Entities\Citation#user refers to the inverse side field Entities\User#citations which does not exist.

[Mapping] FAIL - The entity-class 'Entities\Author' mapping is invalid: * The association Entities\Author#item refers to the inverse side field Entities\Item#authors which does not exist.

As you can see I have the inverse sides, why is it not seeing them?

  • 写回答

1条回答 默认 最新

  • dongmu6578 2012-07-06 00:15
    关注

    Have you created the related properties on the classes (in the php files) ?

    ie: Does Entities\Citation has an item property ? .. property $item;

    评论

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?