Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 66898 invoked from network); 23 Feb 2007 22:24:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Feb 2007 22:24:03 -0000 Received: (qmail 68022 invoked by uid 500); 23 Feb 2007 22:24:12 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 67998 invoked by uid 500); 23 Feb 2007 22:24:11 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 67989 invoked by uid 99); 23 Feb 2007 22:24:11 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Feb 2007 14:24:11 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=RCVD_IN_SORBS_WEB,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of tommut@gmail.com designates 66.249.82.230 as permitted sender) Received: from [66.249.82.230] (HELO wx-out-0506.google.com) (66.249.82.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Feb 2007 14:23:59 -0800 Received: by wx-out-0506.google.com with SMTP id i26so601296wxd for ; Fri, 23 Feb 2007 14:23:38 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=otUqJSvw/IVB+AbyQpWgUi+sEhKPDpJKsrodduyuFFRIMZZYotpDt85QPRiS02IeWRviYF01Sp8sJEJpFIh3VJe1FQu+xX5oKSNLOHsk3w/nm4W4rje3TwD9kMNqkfJFR/01WH7iqonGNnVBgDtZ7/417LaLryb4Px3BnCOfuZY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=ThJxzqfBPUnXf1pFrVY2A7KX+loGa3fdh05vA8uAl4CW7SI4praX+tyl8JO1X+fNZeDIYCW8edlALLLk9oHX+fvs63jxW4vgCw6E9Xopz2OoAmxThlO70046UErIG5FsXkTPpi8QZVQEXARuZvBCW87x2sAbt12Rzp/F9zElc+0= Received: by 10.90.89.5 with SMTP id m5mr2743919agb.1172269418761; Fri, 23 Feb 2007 14:23:38 -0800 (PST) Received: from ?9.37.209.204? ( [129.33.49.251]) by mx.google.com with ESMTP id 38sm4990363wrl.2007.02.23.14.23.38; Fri, 23 Feb 2007 14:23:38 -0800 (PST) Message-ID: <45DF696A.4030806@gmail.com> Date: Fri, 23 Feb 2007 17:23:38 -0500 From: Tom Mutdosch User-Agent: Thunderbird 2.0b2 (Windows/20070116) MIME-Version: 1.0 To: open-jpa-dev@incubator.apache.org Subject: Re: possible to write a JPA Query to that filters both an Entity and its relationship entities? References: <45DDFB3F.2090205@gmail.com> <5240F16C-5619-4174-8754-6940EE6CCDF8@SUN.com> <7D856CDFE035FF45A0420ACBD71BDD63034FDFF6@repbex02.amer.bea.com> <45DF635C.1040305@gmail.com> <7D856CDFE035FF45A0420ACBD71BDD63034FE2D6@repbex02.amer.bea.com> In-Reply-To: <7D856CDFE035FF45A0420ACBD71BDD63034FE2D6@repbex02.amer.bea.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org True. In this case, I guess I'd rather lean towards the side of "best practice". It sounds like in your estimation (and I see there are tons of discussions about this after doing a quick search) that would be to keep this separated into another type of wrapper object and keep my Entities pure. That sounds reasonable. I don't come from a Hibernate background, but is this (using separate DTOs) the common practice to handle the scenario where your view differs from your entity model? Thanks, Tom Patrick Linskey wrote: > You could do that, but personally, I tend to be wary of putting computed > data into the entity types themselves. You're in the grey area in the > question of when to use your domain model as a DTO graph vs. creating a > separate set of DTOs. > > -Patrick > >