ORO店面RestAPI相关实体规范化问题

问题描述

我创建了具有属性AcmeBundle\Api\Model\AcmeLineItemproduct的模型productUnit。然后,我添加一个新的处理器,用于设置模型项的结果集合,并使用标记注册它:

- { name: oro.api.processor,action: get_list,group: load_data,requestType: frontend,class: AcmeBundle\Api\Model\AcmeLineItem,priority: 55 }

api_frontend.yml中的模型配置:

AcmeBundle\Api\Model\AcmeLineItem:
    fields:
        quantity:
            data_type: string
        productSku:
            data_type: string
        product:
            target_class: Oro\Bundle\ProductBundle\Entity\Product
            target_type: to-one
            property_path: product
        productUnit:
            target_class: Oro\Bundle\ProductBundle\Entity\ProductUnit
            target_type: to-one
    actions:
        get: false
        get_list:
            description: Get bought line items
            disable_sorting: true
        update: false
        delete: false
        delete_list: false
        create: false

简单的请求工作正常,但是使用include参数时出现了问题。值productUnit的相关项在响应中可见,但值product-响应中的异常,具有500条代码[Semantical Error] line 0,col -1 near 'SELECT r FROM': Error: Cannot select entity through identification variables without choosing at least one root entity alias.消息。

通过调试,我发现在通过varianProductsproduct实体的@oro_api.object_normalizer属性进行规范化期间发生了异常。我没有t found a similar exception for the included products on shippinglistitems的API方法,像这样的接缝使用了与产品实体不同的规范化器。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...