简体   繁体   English

与rejectChanges相关的错误

[英]Bug related to rejectChanges

I think I found a bug for which I have prepared a small test (based on DocCode project): 我认为我发现了一个我已经准备了一个小测试(基于DocCode项目)的错误:

test("all customers (concise)", 1, function () {
    var realEm = newEm();
    var metadataStore = realEm.metadataStore; // model metadata known to this EntityManager
    var orderType = metadataStore.getEntityType("Order"); // metadata about the Customer type 
    var newOrder = orderType.createEntity(); // call the factory function for the Customer type

    realEm.addEntity(newOrder);

    newOrder.CustomerID("729de505-ea6d-4cdf-89f6-0360ad37bde7");

    var items = realEm.rejectChanges();

    var query = EntityQuery.from("Customers")
        .where("CustomerID", "==", "729de505-ea6d-4cdf-89f6-0360ad37bde7")
        .expand("Orders");
    stop();
    realEm.executeQuery(query)
        .then(function (data) {
            console.log(data);
            /*SELECT        OrderID, CustomerID, EmployeeID, OrderDate, RequiredDate, ShippedDate, Freight, ShipName, ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry, 
            RowVersion
            FROM[Order]
            WHERE(CustomerID = '729de505-ea6d-4cdf-89f6-0360ad37bde7')*/
            ok(data.results[0].Orders().length == 10, "The customers must have 10 Orders")
        })
        .fin(start);
});

As you can see (performing the commented query) the Customer must have 10 Orders, but the array returned has 11. 如您所见(执行带注释的查询),客户必须有10个订单,但是返回的数组有11个。

Am I right or am I doing something wrong? 我是对还是错?

Ok, this was a bug and has been fixed in v 0.84.2. 好的,这是一个错误,已在0.84.2版中修复。 Please give it a try and let us know. 请尝试一下,让我们知道。

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

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