Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 93429 invoked from network); 29 Nov 2007 11:34:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Nov 2007 11:34:37 -0000 Received: (qmail 75792 invoked by uid 500); 29 Nov 2007 11:34:24 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 75774 invoked by uid 500); 29 Nov 2007 11:34:24 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 75762 invoked by uid 99); 29 Nov 2007 11:34:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Nov 2007 03:34:24 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gcjcu-cayenne-user-moved1@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Nov 2007 11:34:04 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IxheP-0005x8-Jc for user@cayenne.apache.org; Thu, 29 Nov 2007 11:33:49 +0000 Received: from p5088a3dc.dip0.t-ipconnect.de ([80.136.163.220]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Nov 2007 11:33:49 +0000 Received: from the.freakazoid by p5088a3dc.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Nov 2007 11:33:49 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: user@cayenne.apache.org From: Detlef Burt Subject: Replace Objects in a Database? Date: Thu, 29 Nov 2007 12:33:23 +0100 Lines: 36 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5088a3dc.dip0.t-ipconnect.de User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) Sender: news X-Virus-Checked: Checked by ClamAV on apache.org Hello, after being able to keep my Data after sending my Objects via JMS (Thanks Andrus) I now have a problem when I try to write the Objects back into the Database. After sending the Objects to the Client-Application, the Client changes some data ( Just a timestamp in my Testcase ) and then sends an Update-Request to the Server. Due to the fact, that the Client has no access to the DataContext or the underlying ObjectStore, the changes made to the Object won't be recorded. After the Server receives the Object, it reconnects the Object to the DataContext, thus being able to get a snapshot from the database or even create an UpdateQuery. But I can't go anywhere from here. Executing the UpdateQuery won't have any effect because Cayenne doesn't know what changed. I also tried to get a Snapshot from the DB, convert my DataObject to a DataRow and then create and register the diff of those by myself. But I couldn't find anything like that :/ To sum it all up: - Can I tell Cayenne to replace the Database Contents with the data from my Object while retaining the ObjectId ? - Can I tell Cayenne to "scan" an Object for changes and register the differences, so that calling commitChanges will update the Object? - Or is it possible to create a DataRow from a DataObject so I can create and register an ObjectDiff ? NOTE: When updating the Object, I don't know what class is being updated and what properties it has, all I have is my CayennePersistableObject Baseclass, which extends CayenneDataObject. Detlef