// needed for field access: I cannot work in the proxied version
Object unproxiedInstance = HibernateHelper.unproxy( instance );
// process the class bridges
for ( int i = 0; i < propertiesMetadata.classBridges.size(); i++ ) {
FieldBridge fb = propertiesMetadata.classBridges.get( i );
final String fieldName = propertiesMetadata.classNames.get( i );
contextualBridge
.setFieldBridge( fb )
.setFieldName( fieldName )
.set(
fieldName, unproxiedInstance,
doc, propertiesMetadata.getClassLuceneOptions( i )
);
}
// process the indexed fields
for ( int i = 0; i < propertiesMetadata.fieldNames.size(); i++ ) {
XMember member = propertiesMetadata.fieldGetters.get( i );
Object value = ReflectionHelper.getMemberValue( unproxiedInstance, member );
final FieldBridge fieldBridge = propertiesMetadata.fieldBridges.get( i );
final String fieldName = propertiesMetadata.fieldNames.get( i );
contextualBridge
.setFieldBridge( fieldBridge )
.pushMethod( member.getName() )
.setFieldName( fieldName )