Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 8302 invoked from network); 1 Apr 2010 15:50:33 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Apr 2010 15:50:33 -0000 Received: (qmail 66842 invoked by uid 500); 1 Apr 2010 15:50:32 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 66810 invoked by uid 500); 1 Apr 2010 15:50:31 -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 66802 invoked by uid 99); 1 Apr 2010 15:50:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Apr 2010 15:50:31 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of john1.summers@citi.com designates 85.158.136.227 as permitted sender) Received: from [85.158.136.227] (HELO mail162.messagelabs.com) (85.158.136.227) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Apr 2010 15:50:20 +0000 X-VirusChecked: Checked X-Env-Sender: john1.summers@citi.com X-Msg-Ref: server-9.tower-162.messagelabs.com!1270136995!8552007!1 X-StarScan-Version: 6.2.4; banners=-,-,- X-Originating-IP: [192.193.219.200] Received: (qmail 16068 invoked from network); 1 Apr 2010 15:49:57 -0000 Received: from mail.citigroup.com (HELO mail.citigroup.com) (192.193.219.200) by server-9.tower-162.messagelabs.com with AES256-SHA encrypted SMTP; 1 Apr 2010 15:49:57 -0000 Received: from imbhub-gt01.nam.nsroot.net (imbhub-gt01.nam.nsroot.net [169.171.119.171]) by imbdmz-sw01.namdmz.dmzroot.net (Switch-3.4.1/Switch-3.4.1) with ESMTP id o31Fns51004294 for ; Thu, 1 Apr 2010 15:49:54 GMT Received: from exlniht02.eur.nsroot.net (exlniht02.eur.nsroot.net [169.186.207.99]) by imbhub-gt01.nam.nsroot.net (Switch-3.4.1/Switch-3.4.1) with ESMTP id o31Fnjt9031971 for ; Thu, 1 Apr 2010 15:49:54 GMT Received: from exlnht01.eur.nsroot.net (169.182.192.16) by exlniht02.eur.nsroot.net (169.186.207.99) with Microsoft SMTP Server (TLS) id 8.1.393.2; Thu, 1 Apr 2010 16:49:34 +0100 Received: from exlnmb03.eur.nsroot.net ([169.186.207.102]) by exlnht01.eur.nsroot.net ([169.182.192.16]) with mapi; Thu, 1 Apr 2010 16:49:33 +0100 From: "Summers, John1 " To: "'user@cayenne.apache.org'" Date: Thu, 1 Apr 2010 16:49:33 +0100 Subject: can Cayenne handle an inheritance model like this?... Thread-Topic: can Cayenne handle an inheritance model like this?... Thread-Index: AcrRsuydUxhTQoo8RGuMSCJVJ0M/8Q== Message-ID: <9689DCBBE9ADB54EA734BAC89C11C204D7A15043@exlnmb03.eur.nsroot.net> Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-GB x-wiganss: 01000000010017exlnht01.eur.nsroot.net ID0042<9689DCBBE9ADB54EA734BAC89C11C204D7A15043@exlnmb03.eur.nsroot.net> Content-Type: multipart/alternative; boundary="_000_9689DCBBE9ADB54EA734BAC89C11C204D7A15043exlnmb03eurnsro_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_9689DCBBE9ADB54EA734BAC89C11C204D7A15043exlnmb03eurnsro_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello Apache-Cayenne users, I am engaged on a project where we are trying to replace a messy bespoke Da= ta Access Layer with a more modern ORM framework. We have been looking at H= ibernate but it cannot handle our inheritance model. I would like to ask if= Cayenne can handle such a model because if it can we will continue and mak= e a full assessmet of Cayenne. I will describe the model to you now: Ok the database tables look like this: BASEENTITY -ID -LINKID TRADE -ID INSTR -ID And the Java object hierarchy is that BaseEntity is the superclass with Tra= de and Instr (and others) as the subclass. Here's the rub... The ID fields on the 3 tables do NOT express a hierarchy. They are unique t= o each table only. You cannot look up a Trade's BaseEntity by using the tra= de ID and finding a matching LINKID in BaseEntity. The connection is actually the BASEENTITY.LINKID field. The LINKID matches = IDs in the TRADE or INSTR table. Like this: BASEENTITY ID=3D1, LINKID=3D100 ID=3D2, LINKID=3D200 TRADE ID=3D100 INSTR ID=3D200 Hibernate cannot handle this. Unidirectional one to one relationships requi= re annotation on each end. The 'table per class' inheritance model requires= the ID fields in TRADE and INSTR to be foreign keys of BASEENTITY, which t= hey are not. Look forward to any advice. Thanks, John --_000_9689DCBBE9ADB54EA734BAC89C11C204D7A15043exlnmb03eurnsro_--