Return-Path: Delivered-To: apmail-openjpa-users-archive@locus.apache.org Received: (qmail 13605 invoked from network); 20 Jan 2009 16:00:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jan 2009 16:00:07 -0000 Received: (qmail 29441 invoked by uid 500); 20 Jan 2009 16:00:05 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 29390 invoked by uid 500); 20 Jan 2009 16:00:05 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 29373 invoked by uid 99); 20 Jan 2009 16:00:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jan 2009 08:00:05 -0800 X-ASF-Spam-Status: No, hits=2.8 required=10.0 tests=HTML_MESSAGE,HTML_OBFUSCATE_05_10,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of hakon.sagehaug@googlemail.com designates 74.125.44.28 as permitted sender) Received: from [74.125.44.28] (HELO yx-out-2324.google.com) (74.125.44.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jan 2009 15:59:56 +0000 Received: by yx-out-2324.google.com with SMTP id 8so1236184yxb.69 for ; Tue, 20 Jan 2009 07:59:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=Y83iGO43Uzb8LQZ9C/vcltcK2WsosVWUJyStfQ1HzFA=; b=aRBreCjLTtFwy6s0LLt4xTQD8y/qUTFX8MFEY59h8bvhRrppvn2dyls9jHBwn3IIcg pZ2CkjHoCmGhggHJsNW16cu0SfcT1MXNi9kB//edcDo5H5srApybXG4jPxL1+VMmLyhs OXYGX9tS29p5DQjDFngQQHHXq2IJU9/OkQGTc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=fmO7SdQh5EgotRZSOETVQOBWEZClbLywZXOx3iHlLLiy6+NefEBIa+Qocm/AP3X3S5 2GdYevf//xr/zkWxR3SwNeKIR7BHVFrUeeoCL+M9jm4y8OTxqh1tY16Yno9p3x5+ijMv g/qlzIHnAdIiRmKPTAUdbZYi8wdVS2sjt+YfA= MIME-Version: 1.0 Sender: hakon.sagehaug@googlemail.com Received: by 10.100.178.2 with SMTP id a2mr1302470anf.114.1232467175753; Tue, 20 Jan 2009 07:59:35 -0800 (PST) Date: Tue, 20 Jan 2009 16:59:35 +0100 X-Google-Sender-Auth: dc13b04c5e8fd7ee Message-ID: Subject: Entity that referring to it self From: =?ISO-8859-1?Q?H=E5kon_Sagehaug?= To: users@openjpa.apache.org Content-Type: multipart/alternative; boundary=0016e64097223548f00460ec20d2 X-Virus-Checked: Checked by ClamAV on apache.org --0016e64097223548f00460ec20d2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi I want to have some thing like this. Ive got a Project entity, and now i want this project to include a list of other projects, like related projects, but struggling a bit how to annotate this and how to design the database. Some thoughts: 1. Create a new entity class that holds a pair of projects, and a list of this entity e.g ProjectPair 2 Have it mapped, could one us @MapKey(name=3D"project_id") and have a map = of friends projects 3. Or as a many-to-many or one-to-many, not sure what is is any hints on this? cheers, H=E5kon --=20 H=E5kon Sagehaug, Software Developer Parallab, Bergen Center for Computational Science (BCCS) UNIFOB AS (University of Bergen Research Company) --0016e64097223548f00460ec20d2--