openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dinkar Rao" <>
Subject Re: Partial populate of POJO
Date Mon, 20 Oct 2008 20:45:24 GMT
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:


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
>, 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:
> Sent from the OpenJPA Users mailing list archive at

View raw message