Source:
private void initializeProvidedIdMetadata(String prefix, ProvidedId providedId, XClass clazz, TypeMetadata.Builder typeMetadataBuilder, boolean isRoot, PathsContext pathsContext, ParseContext parseContext) { PropertyMetadata propertyMetadata; FieldBridge providedIdFieldBridge = null; String providedIdFieldPath; if ( providedId != null ) { providedIdFieldPath = prefix + providedId.name(); } else { providedIdFieldPath = prefix + ProvidedId.defaultFieldName; } if ( !parseContext.includeEmbeddedObjectId() && pathsContext != null && !pathsContext.containsPath( providedIdFieldPath ) ) { return; } if ( isRoot || !parseContext.skipFieldBridges() ) { if ( providedId != null ) { providedIdFieldBridge = bridgeFactory.extractTwoWayType( providedId.bridge(), clazz, reflectionManager ); } else { providedIdFieldBridge = new TwoWayString2FieldBridgeAdaptor( org.hibernate.search.bridge.builtin.StringBridge.INSTANCE ); } } PropertyMetadata.Builder propertyMetadataBuilder = new PropertyMetadata.Builder( typeMetadataBuilder.getResultReference(), null, null ); DocumentFieldMetadata.Builder fieldMetadataBuilder = new DocumentFieldMetadata.Builder( typeMetadataBuilder.getResultReference(), propertyMetadataBuilder.getResultReference(), providedIdFieldPath, Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO ) .fieldBridge( providedIdFieldBridge ) .boost( 1.0f ); if ( !isRoot ) { fieldMetadataBuilder.idInEmbedded(); } DocumentFieldMetadata fieldMetadata = fieldMetadataBuilder.build(); propertyMetadataBuilder.addDocumentField( fieldMetadata ); propertyMetadata = propertyMetadataBuilder.build(); if ( isRoot ) { typeMetadataBuilder.idProperty( propertyMetadata ); } }

Target:
private void initializeProvidedIdMetadata(String prefix, ProvidedId providedId, XClass clazz, TypeMetadata.Builder typeMetadataBuilder, boolean isRoot, PathsContext pathsContext, ParseContext parseContext) { FieldBridge providedIdFieldBridge = null; String providedIdFieldPath; if ( providedId != null ) { providedIdFieldPath = prefix + providedId.name(); } else { providedIdFieldPath = prefix + ProvidedId.defaultFieldName; } if ( !parseContext.includeEmbeddedObjectId() && pathsContext != null && !pathsContext.containsPath( providedIdFieldPath ) ) { return; } if ( isRoot || !parseContext.skipFieldBridges() ) { if ( providedId != null ) { providedIdFieldBridge = bridgeFactory.extractTwoWayType( providedId.bridge(), clazz, reflectionManager ); } else { providedIdFieldBridge = new TwoWayString2FieldBridgeAdaptor( org.hibernate.search.bridge.builtin.StringBridge.INSTANCE ); } } PropertyMetadata.Builder propertyMetadataBuilder = new PropertyMetadata.Builder( typeMetadataBuilder.getResultReference(), null, null ); DocumentFieldMetadata.Builder fieldMetadataBuilder = new DocumentFieldMetadata.Builder( typeMetadataBuilder.getResultReference(), propertyMetadataBuilder.getResultReference(), providedIdFieldPath, Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO ) .fieldBridge( providedIdFieldBridge ) .boost( 1.0f ); if ( !isRoot ) { fieldMetadataBuilder.idInEmbedded(); } DocumentFieldMetadata fieldMetadata = fieldMetadataBuilder.build(); propertyMetadataBuilder.addDocumentField( fieldMetadata ); PropertyMetadata propertyMetadata = propertyMetadataBuilder.build(); if ( isRoot ) { typeMetadataBuilder.idProperty( propertyMetadata ); } else { typeMetadataBuilder.addProperty( propertyMetadata ); } }