简体   繁体   English

Commerce Server 2007 OrderObjectMappings定义错误

[英]Commerce Server 2007 OrderObjectMappings definition error

I am adding 3 new properties to my PurchaseOrder object and have gone through the process of adding the 3 new columns to the database table, updating the PurchaseOrder class and lastly the OrderObjectMappings.xml file to ensure the properties in the class map to the database correctly. 我正在向我的PurchaseOrder对象添加3个新属性,并经历了将3个新列添加到数据库表,更新PurchaseOrder类以及最后OrderObjectMappings.xml文件的过程,以确保该类中的属性正确映射到数据库。 It all appears correct but I get the following error when the mapping is attempted by commerce server: 一切似乎正确,但是当商务服务器尝试映射时,出现以下错误:

[MappedClassDataMismatchException: Table PurchaseOrders column ConcessionOrder does not match expected column name MarshalledData defined in the mapping.] [MappedClassDataMismatchException:表PurchaseOrders列ConcessionOrder与映射中定义的预期列名MarshalledData不匹配。
Microsoft.CommerceServer.Runtime.Orders.POLoader.LoadFromDataSetHelper(DataSet dataSet, ClassInfo[] dependencyClassList, Int32 depClassListLen, Hashtable[] depInstanceLookup, BinaryFormatter formatter, String filter) +3406 Microsoft.CommerceServer.Runtime.Orders.POLoader.LoadFromDataSetHelper(DataSet dataSet,ClassInfo [] dependencyClassList,Int32 depClassListLen,Hashtable [] depInstanceLookup,BinaryFormatter formatter,String filter)+3406
Microsoft.CommerceServer.Runtime.Orders.POLoader.LoadFromDataSet(DataSet dataSet, OrderGroupCollection ogColl) +1080 Microsoft.CommerceServer.Runtime.Orders.POLoader.LoadFromDataSet(数据集dataSet,OrderGroupCollection ogColl)+1080
Microsoft.CommerceServer.Runtime.Orders.POLoader.LoadSearchSet(Guid searchSetId, OrderGroupCollection ogc) +388 Microsoft.CommerceServer.Runtime.Orders.POLoader.LoadSearchSet(Guid searchSetId,OrderGroupCollection ogc)+388
Microsoft.CommerceServer.Runtime.Orders.POLoader.Load(String storedProcName, ListDictionary sqlParameters) +458 Microsoft.CommerceServer.Runtime.Orders.POLoader.Load(字符串storedProcName,ListDictionary sqlParameters)+458
Microsoft.CommerceServer.Runtime.Orders.OrderContext.GetPurchaseOrdersForUser(Guid userId) +352 Microsoft.CommerceServer.Runtime.Orders.OrderContext.GetPurchaseOrdersForUser(Guid用户ID)+352

ConcessionOrder is one of my new properties and appears correctly mapped in the xml file. ConcessionOrder是我的新属性之一,并且正确显示在xml文件中。 Does anyone know of any obvious reason why this could be happening, something I have missed perhaps, another setting elsewhere? 有谁知道发生这种情况的任何明显原因,也许是我错过的东西,或者其他地方的情况?

Cheers, John 干杯,约翰

You might want to check that you updated all locations in the OrderObjectMappings.xml 您可能要检查是否已更新OrderObjectMappings.xml中的所有位置

For example in this node 例如在这个节点

<ClassTableMap Class="PurchaseOrder" Table="PurchaseOrders">

one of the 其中一个

<PropertyMap ... /> 

lines might be wrong? 线可能是错的?

The StorageMap root element of the OrderObjectMapping.xml file has 3 child elements that handle mappings between tables and classes and between table columns and class properties. OrderObjectMapping.xml文件的StorageMap根元素具有3个子元素,这些子元素处理表与类之间以及表列与类属性之间的映射。

TABLES NODE 表节点

The Tables element maps each child Table element to a physical database table. Tables元素将每个子Table元素映射到一个物理数据库表。 Each child Column element is mapped to a physical database field. 每个子Column元素都映射到一个物理数据库字段。

CLASSES NODE 班级节点

The Classes element contains a child Class element that corresponds to each Commerce Server 2007 API class. Classes元素包含与每个Commerce Server 2007 API类相对应的子Class元素。 The out of the box properties and your extensions to the properties list exist as child Property elements. 现成的属性和您对属性列表的扩展都作为子Property元素存在。

MAPPINGS NODE 映射节点

The Mappings element is responsible for mapping each child Table element in the Tables element to a child Class element of the Classes element. Mappings元素负责将Tables元素中的每个子Table元素映射到Classes元素的子Class元素。 This element drives the mapping of a physical database table and its columns to the class and child properties of that class. 该元素驱动物理数据库表及其列到该类的类和子属性的映射。

In order to extend the PurchaseOrder setup in the OrderObjectMapping.xml file to include your new " ConcessionOrder " property, your file would need to contain modifications to the Tables , Classes and Mappings elements as shown below. 为了扩展OrderObjectMapping.xml文件中的PurchaseOrder设置以包括新的“ ConcessionOrder ”属性,您的文件将需要包含对TablesClasssMappings元素的修改,如下所示。

NOTE: I have assumed that you are using a bit field to model the boolean ConcessionOrder property... 注意:我假设您正在使用位字段来建模布尔ConcessionOrder属性...

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM