private ValueBuilder < ? , ? , ? > marshalWithImplodedStrategy ( EmbeddedMetadata embeddedMetadata , Object target ) { try { Object embeddedObject = embeddedMetadata . getReadMethod ( ) . invoke ( target ) ; if ( embeddedObject == null ) { if ( embeddedMetadata . isOptional ( ) ) { return null ; } NullValue . Builder nullValueBuilder = NullValue . newBuilder ( ) ; nullValueBuilder . setExcludeFromIndexes ( ! embeddedMetadata . isIndexed ( ) ) ; return nullValueBuilder ; } FullEntity . Builder < IncompleteKey > embeddedEntityBuilder = FullEntity . newBuilder ( ) ; for ( PropertyMetadata propertyMetadata : embeddedMetadata . getPropertyMetadataCollection ( ) ) { marshalField ( propertyMetadata , embeddedObject , embeddedEntityBuilder ) ; } for ( EmbeddedMetadata embeddedMetadata2 : embeddedMetadata . getEmbeddedMetadataCollection ( ) ) { ValueBuilder < ? , ? , ? > embeddedEntityBuilder2 = marshalWithImplodedStrategy ( embeddedMetadata2 , embeddedObject ) ; if ( embeddedEntityBuilder2 != null ) { embeddedEntityBuilder . set ( embeddedMetadata2 . getMappedName ( ) , embeddedEntityBuilder2 . build ( ) ) ; } } EntityValue . Builder valueBuilder = EntityValue . newBuilder ( embeddedEntityBuilder . build ( ) ) ; valueBuilder . setExcludeFromIndexes ( ! embeddedMetadata . isIndexed ( ) ) ; return valueBuilder ; } catch ( Throwable t ) { throw new EntityManagerException ( t ) ; } }
Marshals the embedded field represented by the given metadata .