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 4ADB4965F for ; Mon, 12 Dec 2011 17:09:19 +0000 (UTC) Received: (qmail 77197 invoked by uid 500); 12 Dec 2011 17:09:19 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 77181 invoked by uid 500); 12 Dec 2011 17:09:19 -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 77173 invoked by uid 99); 12 Dec 2011 17:09:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2011 17:09:19 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.210.43] (HELO mail-pz0-f43.google.com) (209.85.210.43) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2011 17:09:11 +0000 Received: by daec6 with SMTP id c6so2622057dae.16 for ; Mon, 12 Dec 2011 09:08:49 -0800 (PST) Received: by 10.68.73.69 with SMTP id j5mr36696352pbv.11.1323709729313; Mon, 12 Dec 2011 09:08:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.48.195 with HTTP; Mon, 12 Dec 2011 09:08:26 -0800 (PST) In-Reply-To: References: From: Michael Gentry Date: Mon, 12 Dec 2011 12:08:26 -0500 Message-ID: Subject: Re: Problem with inheritance To: user@cayenne.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi Mathias, I believe you are trying to use a currently unimplemented inheritance mechanism. Cayenne does not currently support horizontal (multiple-table) inheritance: http://cayenne.apache.org/doc/inheritance-overview.html There are tricks you can do to make working with multiple related tables easier (such as adding getters/setters in your subclass to reference the parent), but you cannot currently model this behavior automatically. mrg On Fri, Dec 9, 2011 at 3:00 AM, Mathias Clerc wrote: > Hello, > > It seems like I have missed something in inheritance in Cayenne. > > I have one main table called "Element" with fields id (PK), name and description > Another table "File" inherits from "Element" with fields ID(PK, FK on > Element.id) and path. > > When I do a context.performIteratedQuery(new > SelectQuery(Element.class)) The query I see is : > SELECT t0.ID, t0.DESCRIPTION, t0.NAME, t0.TYPE, t0.ID, t0.ID, t0.PATH > FROM ELEMENT t0 > > I tried checking and unchecking the "To Dep PK" field for the relation in ID. > > What did I miss ?