Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 61EF2200C59 for ; Mon, 17 Apr 2017 18:18:36 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 60924160BAB; Mon, 17 Apr 2017 16:18:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A8C47160B9C for ; Mon, 17 Apr 2017 18:18:35 +0200 (CEST) Received: (qmail 10065 invoked by uid 500); 17 Apr 2017 16:18:34 -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 10053 invoked by uid 99); 17 Apr 2017 16:18:34 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Apr 2017 16:18:34 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 2A475C04EF for ; Mon, 17 Apr 2017 16:18:34 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id xxPSSsojXvSg for ; Mon, 17 Apr 2017 16:18:32 +0000 (UTC) Received: from mail-oi0-f68.google.com (mail-oi0-f68.google.com [209.85.218.68]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 75C775FC3A for ; Mon, 17 Apr 2017 16:18:32 +0000 (UTC) Received: by mail-oi0-f68.google.com with SMTP id a21so12595028oic.2 for ; Mon, 17 Apr 2017 09:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=nhSMzO0mpPfYAbQaULHdpVfEvoqvvGHmZaLxhFcpjY0=; b=R4nygy7ZX/gwppHFJNuu0475GnGDY1cSbyOY4vNZ2g+HZeEB/kYXUnE6PnKNluGFzX 9kzQvZhxDU2cXGaCIWZKtEn90g6TraAKxwA2f6wWury9/CxRY6U0eGRNRGp+lsAD+CJd SjIrWxHeIJLn+HhBnWogPDaI9sPLjVJq1J/9wLm2xNtTsMHH+zqHg+GHrLXDnHTyMht9 6Jx14ELneNFjsECYQE8EIVHDviLnPP7gZYsPDFxLBm7MOj2hAFcDNj0fEI+BXTDsKH0l weW/zJLojUz4zqIpsprkrElMVq3iHJGoWVt5alrrpWELuFQRe7vNhQw99oXrY+Fo0gZb Dv7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=nhSMzO0mpPfYAbQaULHdpVfEvoqvvGHmZaLxhFcpjY0=; b=rR7oQgFHdDdXbUUcACUXohCdYMNHhtwj16XNsjAZpgLQddDbTpVXZpmOVR3IFunMOn dt3NaW2JdC5tKX2/UZlGzuuIYKrFiuIlXN71v6ZqBm5Y/U6/wyArvn6sIgtD+u6OXIJ5 8Pl34zHnTf7pAuX0mKPVvZryPvOvZ+py5tKPb1MmUzg3QmVsvx8ftZsCmHVeGefXUwub dNhpeAdL33c7g2S4qx8VM7CnwQMZ8xCB60SDXnjWNKkXHuOF9/SB1KRVrclcDi3o+Mvg X0//nspPBTXbW5zKOH9np+x3FsAFEKn0n1+O7vpf2vqR7upGONLc/dTBP2NcruiCRaCc 8u6A== X-Gm-Message-State: AN3rC/5C43mhc2TiYPM9THhZ/Ur1YGwCYpevqbSZKteWHODqhvG5jQq+ B0yrZp4RPkBQ27RT+oONwzWAqKpmKsku X-Received: by 10.202.220.195 with SMTP id t186mr5420972oig.144.1492445910782; Mon, 17 Apr 2017 09:18:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.59.55 with HTTP; Mon, 17 Apr 2017 09:18:10 -0700 (PDT) In-Reply-To: <8A2AE276-1DFD-47EE-A0EB-EAA3FF65CD9F@amphorainc.com> References: <8A2AE276-1DFD-47EE-A0EB-EAA3FF65CD9F@amphorainc.com> From: Mike Kienenberger Date: Mon, 17 Apr 2017 12:18:10 -0400 Message-ID: Subject: Re: Poorly modeled to-one relationship help To: user@cayenne.apache.org Content-Type: multipart/alternative; boundary=001a113d3e205bd926054d5f241a archived-at: Mon, 17 Apr 2017 16:18:36 -0000 --001a113d3e205bd926054d5f241a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Set the as "toDep PK" property as true for the db relationship from cost to cost_ext_info for the COST DbEntity. https://www.google.com/search?q=3Dcayenne+dependent+primary+key On Mon, Apr 17, 2017 at 12:11 PM, Ken Anderson wrote: > All, > > > > We have a situation in our database that seems to require some special > tricks in Cayenne to make work. One of our developers is having issues > with the following situation: > > > > Table Primary Key > > > > cost cost_num > > cost_ext_info cost_num > > > > The cost_ext_info table just has the same primary key that the cost table > has. We use custom primary key generation for cost (grabs from another > table), but how do we setup the relationship so the cost_num is propagate= d > from the cost table when we insert both at the same time? > > > > In WO, I would make the relationship to-many, and it would propagate the > primary key down. If we try that in Cayenne, it still tries to fill in t= he > primary key of cost_ext_info before propagating apparently (since we=E2= =80=99re > getting an error that it can=E2=80=99t create a primary key for cost_ext_= info). > > > > Thoughts? Many thanks in advance. > > > > Ken > > > > *Ken Anderson* > > CTO Amphora, Inc. > > Mobile: +1 914 262 8540 <(914)%20262-8540> > > > > [image: id:image001.png@01CE8142.D18AEB10] > > > www.amphorainc.com > > > Confidentiality Notice: This e-mail and accompanying documents contain > confidential information intended for a specific individual and purpose. > This e-mailed information is private and protected by law. If you are not > the intended recipient, you are hereby notified that any disclosure, > copying, or distribution, or the taking of any action based on the conten= ts > of this information, is strictly prohibited. > --001a113d3e205bd926054d5f241a--