boolean disableOptimizations,
TypeMetadata.Builder typeMetadataBuilder,
ConfigContext configContext,
PathsContext pathsContext,
ParseContext parseContext) {
IndexedEmbedded indexedEmbeddedAnnotation = member.getAnnotation( IndexedEmbedded.class );
if ( indexedEmbeddedAnnotation != null ) {
//collection role in Hibernate is made of the actual hosting class of the member (see HSEARCH-780)
typeMetadataBuilder.addCollectionRole(
StringHelper.qualify(
parseContext.getCurrentClass().getName(), member.getName()
)
);
int oldMaxLevel = parseContext.getMaxLevel();
int potentialLevel = depth( indexedEmbeddedAnnotation ) + parseContext.getLevel();
if ( potentialLevel < 0 ) {
potentialLevel = Integer.MAX_VALUE;
}
parseContext.setMaxLevel( potentialLevel );
parseContext.incrementLevel();
XClass elementClass;
if ( void.class == indexedEmbeddedAnnotation.targetElement() ) {
elementClass = member.getElementClass();
}
else {
elementClass = reflectionManager.toXClass( indexedEmbeddedAnnotation.targetElement() );
}
if ( parseContext.getMaxLevel() == Integer.MAX_VALUE //infinite
&& parseContext.hasBeenProcessed( elementClass ) ) {
throw new SearchException(