odata4j

Does odata4j client support batch operations or transactions?


How do I get a batch insert done in odata4j client? suppose I want to insert an Order with its OrderDetail lines inserted in one call, how can I acheive this? And If the Order ID is auto-generated identity field, then how do we specify this ID in detail lines? Thanks.


Solution

  • Have a look at .inline(navProp, entities) as part of the consumer createEntity call.

    See http://code.google.com/p/odata4j/source/browse/odata4j-fit/src/test/java/org/odata4j/test/integration/producer/jpa/northwind/CreateTest.java#81 for an example.

    Hope that helps,
    - john