[hibernate-dev] [Hibernate Search] Feedback on Document Field lazy loading

Hardy Ferentschik hibernate at ferentschik.de
Sun Jun 15 06:01:10 EDT 2008


Hi,

On Sun, 15 Jun 2008 10:24:55 +0200, Sanne Grinovero  
<sanne.grinovero at gmail.com> wrote:

> what is your goal? performance?

Yeah, what's the actual goal? If the goal is performance have to compared  
the performance of the original
solution with this 'simple' patch? I think to justify complicating a nice  
and simple API the improvement must
be substantial.

And so that I just understand the problem properly. There are two cases to  
consider - projected vs. non projected queries.

When using projections the proposed solution works fine. The fields we  
want to return are explicitly specified and we return 'only' EntityInfos  
anyway. So no problem there.

The propblem comes in when we try to use document field lazy loading in  
the case where we want to return managed objects. In particulat when  
someone uses a TwoWayFieldBridge. Potentially this bridge can add  
arbitrary field names which are then not properly loaded at query time. Is  
this correct?

I am not sure if I like lazy field loading in the second case. The  
proposed metadata to FieldBridge (FieldBridge.fieldNameStrategy() EXACT,  
IN_NAMESPACE, NON_SAFE) seems very artificial. If we extend the  
FieldBridge interface why not just add a new methods getFieldNames() which  
returns a array of String listing all field names this bridge is using?

--Hardy





More information about the hibernate-dev mailing list