Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 49374 invoked from network); 30 Jul 2009 16:03:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Jul 2009 16:03:37 -0000 Received: (qmail 35281 invoked by uid 500); 30 Jul 2009 16:03:38 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 35255 invoked by uid 500); 30 Jul 2009 16:03:38 -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 35245 invoked by uid 99); 30 Jul 2009 16:03:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Jul 2009 16:03:38 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [209.191.125.111] (HELO web38905.mail.mud.yahoo.com) (209.191.125.111) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 30 Jul 2009 16:03:27 +0000 Received: (qmail 38946 invoked by uid 60001); 30 Jul 2009 16:03:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1248969785; bh=wbgdcfSdwJBaK73nyCRkk9y2VPctMfx09Pt++chy/iw=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Her0VIJqJtJD/6ZQjbxvJ0a9fX4Q+lcrsAPtG04GvXZmV29T6QvFlL0gPnFFYLUnV84pnb8/zDWcwRvek/6yyVmWgVXxZBS3AC7x1JBsGjfJco09t2pLGInHG7Bt/fPjRILtLShWGg/GbtyxKikV4c22Yg1pyMNmeLnty9Cgc/E= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=q121oeHJTH/bcOwa9tskAdoHHbit5swWirXWMWf5LO1ZA4SIsFXB7AiyEnjyZSSndrKRmlz0V0OcLLzVAOOaMU2bdPKkESGgeL4eCMI2CEhewTbQmEcdn69rfOPrQbWAJf8YIhOiZG4rQ6wyyeOx2M21ON+F5aFOA5Anwt3qgwQ=; Message-ID: <433745.38364.qm@web38905.mail.mud.yahoo.com> X-YMail-OSG: pOq5u_gVM1kl1sy3B2NQXkMZVitgKMH7dL6Mdx9dZttxwJ_om6f3or8l4lQFoAZceZgIseK87jwh7wy5NJpWXX8yhclSvUNo1Ow0JzkqcQjuuYzo7NoFtDXOIsKXUIPUCGWu64b47hUBpTVgYqWtS2YbKbF_R_4s.QP7zbLqVjFJXiFa6znA5wYoOnpu9TAyIfg9dtFwS9u.uW1Uunp_JH1fLw86KMipNIxYM4VeK40GLH20gRwuIZM7vDFSQsV47jq4O4093h5AMieuFUxf_VVwYXiG0a58lFiLuCA8_Yv.mzmpeJlxp.WyOmzId1rWa.k3ULr1mDGZQCbAjORjeEi9MQCtHgnfrQe9Fz0- Received: from [204.212.175.30] by web38905.mail.mud.yahoo.com via HTTP; Thu, 30 Jul 2009 09:03:05 PDT X-Mailer: YahooMailClassic/6.0.19 YahooMailWebService/0.7.289.15 Date: Thu, 30 Jul 2009 09:03:05 -0700 (PDT) From: Eric Lazarus Subject: Re: The right way to populate meaningful keys To: user@cayenne.apache.org In-Reply-To: <5adb61290907300801q27e99090y4f9257dd8dfa483e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org (Reminder: Avoid meaningful keys when you have the choice, like anytime you= are designing the database from scratch.=0A=0AWho wants to write the wikip= edia article on the meaningful pointer problem...?) =0A=0AEric=0A+1 (917) 5= 89-6579=0A=0A=0A--- On Thu, 7/30/09, Michael Gentry = wrote:=0A=0A> From: Michael Gentry =0A> Subject: Re= : The right way to populate meaningful keys=0A> To: user@cayenne.apache.org= =0A> Date: Thursday, July 30, 2009, 11:01 AM=0A> Hi Juergen,=0A> =0A> I sus= pect that you need to assign the key on the other side=0A> of your=0A> 1:1 = relationship, too.=A0 Another thing you could try=0A> doing is using the=0A= > To Dep PK checkbox in the DbEntity Relationship panel to=0A> see if=0A> C= ayenne will auto-copy your meaningful PK for you.=0A> =0A> http://cayenne.a= pache.org/doc/to-dep-pk-checkbox.html=0A> =0A> I'm not sure if the To Dep P= K will work that way, but it is=0A> worth a=0A> try.=A0 If you assign all t= he keys, though, it should=0A> work.=0A> =0A> =0A> On Thu, Jul 30, 2009 at = 10:53 AM, Juergen Saar=0A> wrote:=0A> > This was my way = =A0...=0A> > But I ran in deep trouble with the ObjectId ... this=0A> seems= not to be=0A> > sycronized=0A> >=0A> > My actual CayenneRuntimeException:= =0A> > Can't extract a master key. Missing key (esd_abteil),=0A> master ID= =0A> > ()=0A> >=0A> > It belongs to= a 1:1 Relation and the PK-Values in=0A> source and target are=0A> > correc= tly set.=0A> > The Commit is interrupted and the Relation-Data are=0A> not = inserted to DB.=0A> >=0A> >=0A> > In nearly all cases ... even when all dat= a is inserted=0A> in DB the following=0A> > CayenneRuntimException is throw= n:=0A> > Temporary ID hasn't been replaced on=0A> commit:{ > TEMP:0000022273C50001>; new; ...}=0A> >=0A> > Any idea?=0A> > -Juerg= en-=0A> >=0A> > PS: I'm using the Version 2.0.4=0A> >=0A> >=0A> > 2009/7/30= Michael Gentry =0A> >=0A> >> Cayenne, by default, d= oesn't map keys from the=0A> DbEntity (database=0A> >> definition) to the O= bjEntity (Java definition),=0A> but you can go into=0A> >> the ObjEntity an= d add them and it should be fine.=0A> =A0After you do that,=0A> >> just cal= l the set/get methods for the keys to=0A> set/get them. =A0If you=0A> >> se= t a key on a new object before you=0A> commitChanges(), Cayenne will use=0A= > >> your key instead of trying to generate one.=0A> >>=0A> >> mrg=0A> >>= =0A> >>=0A> >> On Thu, Jul 30, 2009 at 1:24 AM, Juergen=0A> Saar=0A> wrote:=0A> >> > Hi all,=0A> >> >=0A> >> > I'm using cayenne wi= thin an old 4GL-Project=0A> with meaningful Primary Keys.=0A> >> >=0A> >> >= Is there a 'best practice' to get this keys=0A> into the DataObject-Instan= ce?=0A> >> >=0A> >> > Actually I've various trouble with this ...=0A> >> >= =0A> >> >=0A> >> > Any hint or code-sniplet would be helpful=0A> ...=0A> >>= > -Juergen-=0A> >> >=0A> >>=0A> >=0A> =0A=0A=0A