Return-Path: Delivered-To: apmail-openjpa-users-archive@locus.apache.org Received: (qmail 12885 invoked from network); 20 Oct 2008 21:12:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Oct 2008 21:12:23 -0000 Received: (qmail 22843 invoked by uid 500); 20 Oct 2008 21:12:25 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 22824 invoked by uid 500); 20 Oct 2008 21:12:25 -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 22813 invoked by uid 99); 20 Oct 2008 21:12:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Oct 2008 14:12:25 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dinkar.d91411118@gmail.com designates 72.14.220.158 as permitted sender) Received: from [72.14.220.158] (HELO fg-out-1718.google.com) (72.14.220.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Oct 2008 21:11:15 +0000 Received: by fg-out-1718.google.com with SMTP id l27so1627054fgb.27 for ; Mon, 20 Oct 2008 14:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=e9AINqqfzeMO3QWHe5LGT6bmvggu9nAYtcZpMqrZ1bE=; b=N+20BRx9Hvb7660q7h8WRFC62jrYGk5c8KKdVD+aBGgpnlYbAOVWGWreFttEabtdLU Xhqjl2TK6k5XTavWoWRaxs8pvQmD6A5TNJ+mqynhKh/y716yCbClUHanoZ1X9AficVPq /tYd18S+R4yQsWoVlaiBDogynweLQgeDZKSKw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=no3M/XRiLaE64wsPCQSCHI7KNX6SXrMgOA8WdnVfKL9Q+EvNPSSP+ZjdTE5Y+RTV9m HC3en1Ohqp2wnbO8hPoXrYOS48WRdmxrUP4vvPp78EkSSF7AGANBadVECwXzQeAQc94d Xfzdkt2FZge1YRtBZq+i0sXlYJJUIkeYfF4iU= Received: by 10.187.175.6 with SMTP id c6mr1198874fap.89.1224535524345; Mon, 20 Oct 2008 13:45:24 -0700 (PDT) Received: by 10.187.200.4 with HTTP; Mon, 20 Oct 2008 13:45:24 -0700 (PDT) Message-ID: Date: Mon, 20 Oct 2008 13:45:24 -0700 From: "Dinkar Rao" To: users@openjpa.apache.org Subject: Re: Partial populate of POJO In-Reply-To: <1224525537831-1356484.post@n2.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1224525537831-1356484.post@n2.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Perhaps the per-field fetch configuration of dynamic fetch groups is what you are looking for. Please see Section 7, Fetch Groups, of Chapter 5 in the latest OpenJPA manual here: http://openjpa.apache.org/builds/latest/docs/manual/ref_guide_fetch.html hth, Dinkar On Mon, Oct 20, 2008 at 10:58 AM, baileyby wrote: > > Is there a way to partially populate a POJO in dynamic fashion (i.e. without > using transient modifiers or annotations)? For example, I may want to > populate my POJO's name and id in one situation, and yet populate name, id, > and createDate in another. Such as, entityManager.createQuery("SELECT > MO.id, MO.name FROM MyObject MO") Surely, a purist would say that I should > always have a fully populated bean to ensure data integrity, but it's simply > not reasonable for me to read in all of the possible columns in all > situations (see next paragraph). I've experimented and read through JSR220 > spec, and didn't see anything like this. Is it possible? > > I have a table with about 500 columns, of which I am reading hundreds of > rows very frequently. So, I can't reasonably fetch all 500 columns all of > the time without sacrificing performance. In actuality, I only ever need > about 20 columns, but which columns I need will change dynamically to suit > different needs. > > Any ideas/suggestions are appreciated! > -- > View this message in context: http://n2.nabble.com/Partial-populate-of-POJO-tp1356484p1356484.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. > >