带 select 字段的实体查找给出错误消息
entity-find with select-field gives error msg
当运行以下代码时:
<entity-find entity-name="mantle.order.OrderHeaderPartFacilityStatus" list="orderPartList">
<econdition field-name="facilityId" from = "facilityId"/>
<econdition field-name="statusId" operator="in" value="OrderPlaced,"/>
<!-- <select-field field-name="orderId, "/> -->
<!-- <select-field field-name="orderName"/> -->
<!-- <select-field field-name="placedDate"/> -->
<!-- <select-field field-name="grandTotal"/> -->
<!-- <select-field field-name="orderPartSeqId"/> -->
<!-- <select-field field-name="facilityId"/> -->
<!-- <select-field field-name="facilityName"/> -->
<!-- <select-field field-name="partStatusId"/> -->
<!-- <order-by field-name="orderPartSeqId"/> -->
</entity-find>
我得到了:
"orderPartList": [
{
"enteredByPartyId": null,
"salesChannelEnumId": null,
"recurrenceInfoId": null,
"customerRoleTypeId": "Manager",
"billingAccountId": null,
"placedDate": "2016-01-01T00:00:00+0000",
"telecomContactMechId": null,
"postalContactMechId": null,
"vendorRoleTypeId": null,
"visitId": null,
"lastOrderedDate": null,
"remainingSubTotal": null,
"trackingNumber": null,
"otherPartyOrderId": null,
"statusId": "OrderPlaced",
"giftMessage": null,
"entryDate": null,
"shippingInstructions": null,
"autoCancelDate": null,
"estimatedDeliveryDate": null,
"customerPartyId": "EX_JOHN_DOE",
"validThruDate": null,
"carrierPartyId": null,
"partTotal": 5.1E+2,
"facilityId": "FWorkshopnanneihuan",
"syncStatusId": null,
"estimatedShipDate": null,
"validFromDate": null,
"estimatedPickUpDate": null,
"externalRevision": null,
"orderPartSeqId": "01",
"terminalId": null,
"shipmentMethodEnumId": null,
"shipBeforeDate": null,
"parentOrderId": null,
"isGift": null,
"productStoreId": null,
"orderRevision": 26,
"dontCancelSetDate": null,
"pseudoId": "FWorkshopnanneihuan",
"dontCancelSetUserId": null,
"systemMessageRemoteId": null,
"maySplit": null,
"externalId": null,
"parentPartSeqId": null,
"facilityName": "\u5357\u5185\u73af\u8f66\u95f4",
"orderId": "FOJohndoePassat",
"vendorPartyId": null,
"shipAfterDate": null,
"currencyUomId": null,
"orderName": "John_doe order 1",
"grandTotal": 5.1E+2,
"partStatusId": "OrderOpen",
"partName": "\u7b2c\u4e00\u90e8\u5206 John doe",
"statusDescription": "Placed"
}
],
但是当我取消注释select-field标签时,如下:
<entity-find entity-name="mantle.order.OrderHeaderPartFacilityStatus" list="orderPartList">
<econdition field-name="facilityId" from = "facilityId"/>
<econdition field-name="statusId" operator="in" value="OrderPlaced,"/>
<select-field field-name="orderId, "/>
<!-- <select-field field-name="orderName"/> -->
<!-- <select-field field-name="placedDate"/> -->
<!-- <select-field field-name="grandTotal"/> -->
<!-- <select-field field-name="orderPartSeqId"/> -->
<!-- <select-field field-name="facilityId"/> -->
<!-- <select-field field-name="facilityName"/> -->
<!-- <select-field field-name="partStatusId"/> -->
<!-- <order-by field-name="orderPartSeqId"/> -->
</entity-find>
然后我收到以下错误消息,这可能表明 select sql 不工作:
{"errorCode":500,"errors":"java.lang.IllegalArgumentException: Maps with null keys can't be converted to JSON"}
有什么问题吗?
我正在使用自定义数据 运行ing MoquiDemo-2.0.0。
这可能是一个错误或什么?有人知道吗?
field-name "orderId, " 无效。逗号用于分隔多个字段名称,因此它会将其转换为 "orderId" 和 "" 的列表,空字符串不是有效的字段名称。
类似地,在您对 statusId 的 econdition 中,@value 属性末尾有一个逗号。如果您尝试包含具有空 statusId 的记录,请使用 econdition.@or-null 属性。如果这不是您想要的,为了更有效的查询,请去掉逗号并使用等号运算符(这是默认值,因此您不需要运算符属性)。
总的来说这段代码很草率。 Moqui 试图容忍有趣的事情并尽力而为,但无效的字段名称等仍然无效,你会得到错误。您可能在服务器端日志中也有更多错误或警告,这通常是检查是否有问题的第一个地方。
当运行以下代码时:
<entity-find entity-name="mantle.order.OrderHeaderPartFacilityStatus" list="orderPartList">
<econdition field-name="facilityId" from = "facilityId"/>
<econdition field-name="statusId" operator="in" value="OrderPlaced,"/>
<!-- <select-field field-name="orderId, "/> -->
<!-- <select-field field-name="orderName"/> -->
<!-- <select-field field-name="placedDate"/> -->
<!-- <select-field field-name="grandTotal"/> -->
<!-- <select-field field-name="orderPartSeqId"/> -->
<!-- <select-field field-name="facilityId"/> -->
<!-- <select-field field-name="facilityName"/> -->
<!-- <select-field field-name="partStatusId"/> -->
<!-- <order-by field-name="orderPartSeqId"/> -->
</entity-find>
我得到了:
"orderPartList": [
{
"enteredByPartyId": null,
"salesChannelEnumId": null,
"recurrenceInfoId": null,
"customerRoleTypeId": "Manager",
"billingAccountId": null,
"placedDate": "2016-01-01T00:00:00+0000",
"telecomContactMechId": null,
"postalContactMechId": null,
"vendorRoleTypeId": null,
"visitId": null,
"lastOrderedDate": null,
"remainingSubTotal": null,
"trackingNumber": null,
"otherPartyOrderId": null,
"statusId": "OrderPlaced",
"giftMessage": null,
"entryDate": null,
"shippingInstructions": null,
"autoCancelDate": null,
"estimatedDeliveryDate": null,
"customerPartyId": "EX_JOHN_DOE",
"validThruDate": null,
"carrierPartyId": null,
"partTotal": 5.1E+2,
"facilityId": "FWorkshopnanneihuan",
"syncStatusId": null,
"estimatedShipDate": null,
"validFromDate": null,
"estimatedPickUpDate": null,
"externalRevision": null,
"orderPartSeqId": "01",
"terminalId": null,
"shipmentMethodEnumId": null,
"shipBeforeDate": null,
"parentOrderId": null,
"isGift": null,
"productStoreId": null,
"orderRevision": 26,
"dontCancelSetDate": null,
"pseudoId": "FWorkshopnanneihuan",
"dontCancelSetUserId": null,
"systemMessageRemoteId": null,
"maySplit": null,
"externalId": null,
"parentPartSeqId": null,
"facilityName": "\u5357\u5185\u73af\u8f66\u95f4",
"orderId": "FOJohndoePassat",
"vendorPartyId": null,
"shipAfterDate": null,
"currencyUomId": null,
"orderName": "John_doe order 1",
"grandTotal": 5.1E+2,
"partStatusId": "OrderOpen",
"partName": "\u7b2c\u4e00\u90e8\u5206 John doe",
"statusDescription": "Placed"
}
],
但是当我取消注释select-field标签时,如下:
<entity-find entity-name="mantle.order.OrderHeaderPartFacilityStatus" list="orderPartList">
<econdition field-name="facilityId" from = "facilityId"/>
<econdition field-name="statusId" operator="in" value="OrderPlaced,"/>
<select-field field-name="orderId, "/>
<!-- <select-field field-name="orderName"/> -->
<!-- <select-field field-name="placedDate"/> -->
<!-- <select-field field-name="grandTotal"/> -->
<!-- <select-field field-name="orderPartSeqId"/> -->
<!-- <select-field field-name="facilityId"/> -->
<!-- <select-field field-name="facilityName"/> -->
<!-- <select-field field-name="partStatusId"/> -->
<!-- <order-by field-name="orderPartSeqId"/> -->
</entity-find>
然后我收到以下错误消息,这可能表明 select sql 不工作:
{"errorCode":500,"errors":"java.lang.IllegalArgumentException: Maps with null keys can't be converted to JSON"}
有什么问题吗? 我正在使用自定义数据 运行ing MoquiDemo-2.0.0。 这可能是一个错误或什么?有人知道吗?
field-name "orderId, " 无效。逗号用于分隔多个字段名称,因此它会将其转换为 "orderId" 和 "" 的列表,空字符串不是有效的字段名称。
类似地,在您对 statusId 的 econdition 中,@value 属性末尾有一个逗号。如果您尝试包含具有空 statusId 的记录,请使用 econdition.@or-null 属性。如果这不是您想要的,为了更有效的查询,请去掉逗号并使用等号运算符(这是默认值,因此您不需要运算符属性)。
总的来说这段代码很草率。 Moqui 试图容忍有趣的事情并尽力而为,但无效的字段名称等仍然无效,你会得到错误。您可能在服务器端日志中也有更多错误或警告,这通常是检查是否有问题的第一个地方。