Return-Path: X-Original-To: apmail-cayenne-user-archive@www.apache.org Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C4E7460CE for ; Sun, 31 Jul 2011 17:42:24 +0000 (UTC) Received: (qmail 46548 invoked by uid 500); 31 Jul 2011 17:42:24 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 46495 invoked by uid 500); 31 Jul 2011 17:42: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 46465 invoked by uid 99); 31 Jul 2011 17:42:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Jul 2011 17:42:23 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of brunorene@holos.pt designates 193.126.127.18 as permitted sender) Received: from [193.126.127.18] (HELO mail.holos.pt) (193.126.127.18) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Jul 2011 17:42:16 +0000 Received: (qmail 6894 invoked from network); 31 Jul 2011 17:41:49 -0000 Received: from mail-ey0-f171.google.com (brd@[209.85.215.171]) (envelope-sender ) by mail.holos.pt (qmail-ldap-1.03) with RC4-SHA encrypted SMTP for ; 31 Jul 2011 17:41:49 -0000 Received: by eye22 with SMTP id 22so5092015eye.30 for ; Sun, 31 Jul 2011 10:41:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.108.143 with SMTP id f15mr580266ebp.16.1312134107958; Sun, 31 Jul 2011 10:41:47 -0700 (PDT) Sender: brunorene@gmail.com X-Google-Sender-Delegation: brunorene@gmail.com Received: by 10.213.14.72 with HTTP; Sun, 31 Jul 2011 10:41:47 -0700 (PDT) In-Reply-To: References: Date: Sun, 31 Jul 2011 18:41:47 +0100 X-Google-Sender-Auth: CWOBaNCMl9fDQJsfEo5cQS24nyk Message-ID: Subject: Re: weird PK generation From: =?UTF-8?Q?Bruno_Ren=C3=A9_Santos?= To: user@cayenne.apache.org Content-Type: multipart/alternative; boundary=0015174be8b0670fc804a961079d X-Virus-Checked: Checked by ClamAV on apache.org --0015174be8b0670fc804a961079d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Michael, This time I am using MySQL. And yes I'm using the org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy. I am willing to "fool" cayenne by saying that the key is database generated but being a foreign key that would not be true and also cayenne is ignoring the value i am putting on the field... which is the weird part. As I said before commitchangestoparent I check the newObjects() and the key is properly filled. I have the auto_ok_support table but I am not using it. Would it help to drop it? But even so cayenne shouldn't use it on this case. Thanx Bruno On Sun, Jul 31, 2011 at 2:16 PM, Michael Gentry wrot= e: > Hi Bruno, > > I've not tried that scenario before. What database are you using? I > believe in the past you said you are using Oracle? If so, maybe set > the modeler to use a sequence for that table instead of the default > and see if that clears it up. Also, I'm assuming you are skipping the > option of creating the DB schema on startup if missing? (This would > try to create the AUTO_PK_SUPPORT table if missing.) > > mrg > > > On Sun, Jul 31, 2011 at 5:08 AM, Bruno Ren=C3=A9 Santos > wrote: > > Hello all, > > > > I have a dbEntity with thre foreign keys that are also its primary keys= . > > During the application I fill all three fields correctly with the objec= ts > > that should be referenced. Before the commitchangestoparent I check the > > newObjects array and all objects are filled correctly. > > > > On the Modeler I left the Default PK generation because none of the PK > will > > be generated, as they are also foreign keys. But even so Cayenne tries = to > > use the AutoPkSupport generation for only one of the foreign keys... > raising > > an integrity error. > > > > Anybody knows what can be happening? I'm using cayenne 3.0.2 > > > > Regards > > Bruno Santos > > > > -- > > Bruno Ren=C3=A9 Santos | brunorene@holos.pt | Gestor de Projectos | Ana= lista > | > > Programador | Investigador > > > > Holos - Solu=C3=A7=C3=B5es Avan=C3=A7adas em Tecnologias de Informa=C3= =A7=C3=A3o S.A. > > Parque de Ci=C3=AAncia e Tecnologia de Almada/Set=C3=BAbal . Edif=C3=AD= cio Madan Parque > > Rua dos Inventores . Quinta da Torre . 2825 - 182 Caparica . Portugal > > Phone: +351 210 438 686 . Fax: +351 210 438 687 . Web: www.holos.pt > > > > This email and any files transmitted with it are confidential and > intended > > solely for the use of the individual or entity to whom they are > addressed. > > If you are not the intended recipient or the person responsible for > > delivering the email to the intended recipient, be advised that you hav= e > > received this email in error and that any use, dissemination, forwardin= g, > > printing, or copying of this email is strictly prohibited. If you have > > received this email in error please notify Bruno Ren=C3=A9 Santos by te= lephone > on > > +351 210 438 686 > > > > --=20 Bruno Ren=C3=A9 Santos | brunorene@holos.pt | Gestor de Projectos | Analist= a | Programador | Investigador Holos - Solu=C3=A7=C3=B5es Avan=C3=A7adas em Tecnologias de Informa=C3=A7= =C3=A3o S.A. Parque de Ci=C3=AAncia e Tecnologia de Almada/Set=C3=BAbal . Edif=C3=ADcio = Madan Parque Rua dos Inventores . Quinta da Torre . 2825 - 182 Caparica . Portugal Phone: +351 210 438 686 . Fax: +351 210 438 687 . Web: www.holos.pt This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient or the person responsible for delivering the email to the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. If you have received this email in error please notify Bruno Ren=C3=A9 Santos by teleph= one on +351 210 438 686 --0015174be8b0670fc804a961079d--