If you want to do this in a standard, way, you would have to statically define different entities that map to the same tables and deal with side effects. Or use SQL queries.
Craig On Oct 20, 2008, at 10:58 AM, baileyby wrote:
Is there a way to partially populate a POJO in dynamic fashion (i.e. withoutusing transient modifiers or annotations)? For example, I may want topopulate my POJO's name and id in one situation, and yet populate name, id,and createDate in another. Such as, entityManager.createQuery("SELECTMO.id, MO.name FROM MyObject MO") Surely, a purist would say that I shouldalways 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 allsituations (see next paragraph). I've experimented and read through JSR220spec, 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 suitdifferent 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.
Craig L Russell Architect, Sun Java Enterprise System http://db.apache.org/jdo 408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp!
smime.p7s
Description: S/MIME cryptographic signature
