7 Replies Latest reply on Mar 15, 2012 12:20 AM by Ashish Vashisht

    How to use createItem via DataServiceTransaction-API correctly

    Flavy85 Level 1



      I try to create an item via the DataServiceTransaction-API:


      DataServiceTransaction dtx = DataServiceTransaction.begin(false);



      EntityA a = new EntityA();

      EntityB b = new EntityB();



      dtx.createItem(EntityA.class.getName(), a);



      When I call this serivce from my FlexClient an error occurred, wich says that EntityB is unsaved!


      I know why this erro happens but really dont't know how to fix that.


      Is there any way to make the creation cascading(from the modeler-plugin within FlashBuilder)?




      Do i have to create the "child"-properties on my own via another call of "dtx.createItem" with EntityB? If so, how can I check the DataService for the entity, if the entity already exists? via a fill operation? how do call that manually?


      I know question over question!


      Hope you can help me out!