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 <byron.bailey@nashfinch.com> 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.
>
>
|