openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From baileyby <byron.bai...@nashfinch.com>
Subject Partial populate of POJO
Date Mon, 20 Oct 2008 17:58:57 GMT

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.


Mime
View raw message