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 F374A200C02 for ; Fri, 20 Jan 2017 17:48:12 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id F1FA3160B48; Fri, 20 Jan 2017 16:48:12 +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 47C90160B34 for ; Fri, 20 Jan 2017 17:48:12 +0100 (CET) Received: (qmail 62726 invoked by uid 500); 20 Jan 2017 16:48:11 -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 62714 invoked by uid 99); 20 Jan 2017 16:48:11 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jan 2017 16:48:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id B8CC21A0232 for ; Fri, 20 Jan 2017 16:48:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-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: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id T1uJju3FA_DN for ; Fri, 20 Jan 2017 16:48:09 +0000 (UTC) Received: from mail-yb0-f182.google.com (mail-yb0-f182.google.com [209.85.213.182]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 3D18D5F27D for ; Fri, 20 Jan 2017 16:48:09 +0000 (UTC) Received: by mail-yb0-f182.google.com with SMTP id 123so61214835ybe.3 for ; Fri, 20 Jan 2017 08:48:09 -0800 (PST) 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=ZlWaIBLS7kZ7ETBIe3G4mQfcUlw6D/tMvoDrArPpah0=; b=GrRXWtNXeGorA/5NMO/ikNY9FFSdMH/8I10wVKtXxBi4/sijF/ecu7LUMALesCEu15 yNi3ykbNOPBmvqIWm6C0QCViSniwsBeyA2+p2nphT5XKOPyipz9oNdE5WoTmAVnuRDWM y2R1R169cfp7hLeQHEBGHV7HAYD3tMaAJJtZlSctBCWh5JY+nNfpfGYoV2aId+fFPPg0 qNi2zakD31Ckk0kfD5sZ8WH1pvlYSQeKkKzUPDx8J4xBCs/5iMgJMLxBT4GeCn9rMtvH 0B0Uy5lNi1SdDqPsfSLnlBgt8/Pfy/9Ja9V9WqquGZkw3RoVnP+x+JNmmV1z0InwY38w ZhXA== 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=ZlWaIBLS7kZ7ETBIe3G4mQfcUlw6D/tMvoDrArPpah0=; b=VsZI6Q743VI2kzKb6hM5Iuvcy6GJqxGIHqWLKNZwBvdmeX8QRoNR1EJYomp2v08b9H 234laqnCHhjAcnKv7Jsn/bq/PIrnVzjr4hbwVvhP61RWxzAbv8efubdSxJpWIyrXg+Ck gBfSqiODiEVb5gOQwdGGW5mKnjZia7vSbmdV90Kgd6p3dM4YkJMYdBG8YHZ/eqNCQ+xc GIgO273eVyB9APEAP8wTAosg9GaA1MQJajKRLZHSXFA1WzLLZu9JyeyucvOQnMoy2y/l /IkHTGLpI18YcnoOjGgS7fz+Kawe2JgvnDQv820tSMj3RidBE3eMqGK9mOsCycQoyWZR uF8w== X-Gm-Message-State: AIkVDXLzMHVdKzDrOvDxE5Cis6TkH6Tn/VovjA+F8BmZrFl//3jka2mNAAFKwEY8nRkW23n7AAquSvldOsFEXQ== X-Received: by 10.233.239.17 with SMTP id d17mr12949623qkg.13.1484930882737; Fri, 20 Jan 2017 08:48:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.50.37 with HTTP; Fri, 20 Jan 2017 08:48:02 -0800 (PST) In-Reply-To: <7FEEA078-383D-4EB7-8FF6-6F6B1EBA6253@objectstyle.org> References: <7FEEA078-383D-4EB7-8FF6-6F6B1EBA6253@objectstyle.org> From: sagar bijlwan Date: Fri, 20 Jan 2017 16:48:02 +0000 Message-ID: Subject: Re: Issue while accessing primary key in cayenne 4.0.M4 To: user@cayenne.apache.org Content-Type: multipart/alternative; boundary=94eb2c11214ec81e240546896901 archived-at: Fri, 20 Jan 2017 16:48:13 -0000 --94eb2c11214ec81e240546896901 Content-Type: text/plain; charset=UTF-8 Thanks Andrus for the prompt reply, I think how I was able to generate setter for the PK in Cayenne 3. 1. While reengineering DB schema in modeler, there is a checkbox for meaningful PK. 2. I checked that one and hence it resulted in setter for PK. However, in revamped UI of 4.0.M4, this checkbox is chucked out and now there is a text field which is pretty subtle change and I happen to miss that. Once I write name of the table in the field, generated model has the PK as a property. Now this was fine with single table. If there are multiple tables then Is a comma separated list of table names a good approach ? or what you mentioned in point 2 of your previous mail ? ( my bet is on this ). Regards Sagar On Fri, Jan 20, 2017 at 4:17 PM, Andrus Adamchik wrote: > Actually NOT making PK a part of the object model was a default in Cayenne > since day 1. > > 1. If all you need is to read the PK value, you can use > Cayenne.pkForObject(..) > 2. If this is a meaningful PK and you need a setter, just create a new > ObjAttribute in the Modeler manually and map it to PK column. > > HTH, > Andrus > > --------------- > Andrus Adamchik > @andrus_a | @ApacheCayenne > > > On Jan 20, 2017, at 10:50 AM, sagar bijlwan > wrote: > > > > Hello, > > > > In cayenne 3 primary key column is also available as a property in auto > > generated java model so it can be easily accessed using setters and > > getters, However, it seems same can't be said about cayenne 4. When I am > > generating Java model of the same DB table, I am only getting PK column ( > > and not the new "Property" type for the primary key) thus I don't have > any > > setters and getters for the primary key. > > > > Am I missing something here as I don't seem to recall doing anything > > special in cayenne 3? Or should I do anything extra in cayenne 4 to make > it > > work? > > > > Any insight into this would be appreciated. > > > > Regards > > Sagar > > > -- S A M --94eb2c11214ec81e240546896901--