openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <>
Subject Re: 'Masking' fields in an Entity
Date Tue, 31 Mar 2009 05:20:00 GMT

  You are correct in detaching the instance with the current fetch plan. In theory, now the
detached instance should only have the fields selected by the fetch plan. If that is not happening
then verify the following in order
  1. Is the instance detached? OpenJPAEntityManager.isDetached(pc)
  2. What happens if you access and fields that is not supposed to be loaded in the detached
Configure openjpa.DetachState [1] with  AccessUnloaded to throw an exception on any attempt
to acess any unloaded field.
  3. If the detached instane is serialized and deserialized, which fields in the deserialized
object are populated?
  The above steps to ascertain that when JAXB is xmlizing the instance, inadvertently no fields
are getting loaded as a side-effect.

  You have to tell me more about the process that convertes these instances into XML -- such
as when is this process is triggered? Which fields of the managed instance are processed by
this XMLization process? Is there any possibility that a field will get loaded as a side-effect?
Please note that any pc.getXXX() on a managed instance pc will load the field XXX.


Pinaki Poddar            
OpenJPA PMC Member/Committer
JPA Expert Group Member
View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message