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

Hardy Ferentschik hibernate at ferentschik.de
Mon Jun 16 04:20:43 EDT 2008


On Sun, 15 Jun 2008 18:22:22 +0200, Emmanuel Bernard  
<emmanuel at hibernate.org> wrote:

>> 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?
>
> I thought about that but you don't always know :) Thing Maps mapped with  
> the key as the field name.

True, but that is really an exceptional case. In most cases the added  
field names will be constant, otherwise it is damn hard to write a query.  
getFieldNames(String name) could return null in case the field names are  
dynamic. The API is not 100% intuative this way, but I think I still would  
prefer a explicit list of field names over a enum type like EXACT,  
IN_NAMESPACE or NON_SAFE.

--Hardy



More information about the hibernate-dev mailing list