cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Dahbura <>
Subject Re: Help Again on DataContext
Date Fri, 06 May 2011 18:05:19 GMT
Can you send me a little more of the code snippet please?

Is it basically registering the object into a new context or the same one it came from?


----- Original Message -----
From: "miguel_de_sousa" <>
Sent: Wednesday, May 4, 2011 9:16:21 PM
Subject: Re: Help Again on DataContext

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).


     String serialisedXml = XMLEncoder.encode(persistentObject);

      XMLEncoder.decode(serialisedXml, getDataContext());

      catch(CayenneRuntimeException ex){

 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:
Sent from the Cayenne - User mailing list archive at

View raw message