You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Daniel Lee <ts...@gmail.com> on 2007/05/15 03:17:41 UTC

What is the use of _impl and _fieldImpl in PCDataImpl class?

Hi,

I'm trying to understand OpenJPA open source code but having difficulties in
figuring out the use of _impl and _fieldImpl fields in PCDataImpl.  Could
someone help describe these 2 fields?  Many thanks in advance.

Tsunfang

Re: What is the use of _impl and _fieldImpl in PCDataImpl class?

Posted by Patrick Linskey <pl...@gmail.com>.
They're used to store the data from OpenJPAStateManager.getImplData()
and getImplData(int  field).

Those impl data slots, in turn, are available for use by StoreManager
implementations for random bits of per-field or per-instance state
that doesn't fit elsewhere but is useful for the StoreManager
implementation.

This is similar to the 'intermediate data' concept, which you can see
in the get/set intermediate calls in that class.

OpenJPA uses intermediate data when it loads "extra" data from the
database that can be consumed later to materialize something, and impl
data for data that should be around for longer than just while the
field is not loaded.

For example, when OpenJPA loads an instance that has a -to-one
relation that is not eager, but not explicitly lazy, it will generate
SQL that selects the foreign key data for the relationship along with
the other primary-table data. That way, if you do lazily load the data
later, OpenJPA can go directly to cache, or at least bypass the join,
when loading the related data. That info is stored in an intermediate,
since either it or the relation itself can be loaded at any given
time.

Based no code analysis, it looks like OpenJPA only uses impl data for
BLOBs currently.\

-Patrick

On 5/14/07, Daniel Lee <ts...@gmail.com> wrote:
> Hi,
>
> I'm trying to understand OpenJPA open source code but having difficulties in
> figuring out the use of _impl and _fieldImpl fields in PCDataImpl.  Could
> someone help describe these 2 fields?  Many thanks in advance.
>
> Tsunfang
>


-- 
Patrick Linskey
202 669 5907