Hi Tony,

Sorry if this reply doesn't really help a lot but the way I do something
similar to what you're talking about is I serialise the object into xml with
XMLEncoder.encode(persistentObject) then when I get the serialised object
back I do XMLEncoder.decode(serialisedObjectXml, DataObject).

So:

     String serialisedXml = XMLEncoder.encode(persistentObject);
     
     .....

     
      XMLEncoder.decode(serialisedXml, getDataContext());
      
      try{

             getDataContext().commitChanges();
      }
      catch(CayenneRuntimeException ex){
             getDataContext().rollbackChanges();
     }

 I do this as a seperation of concerns because I use webservices as the
point of contact for all clients (webapps/Desktop GUI apps/Mobile apps), but
does work very nicely -- it also works with new objects (so I create the XML
that would represent the new object without the primary key set and Cayenne
works that out on commit).


--
View this message in context: 
http://cayenne.195.n3.nabble.com/Help-Again-on-DataContext-tp2899105p2901635.html
Sent from the Cayenne - User mailing list archive at Nabble.com.

Reply via email to