public boolean exists(Class<?> type, List<String> propertyPath) {
return exists( type, propertyPath.toArray( new String[propertyPath.size()] ) );
}
public boolean exists(Class<?> type, String... propertyPath) {
EntityIndexBinding entityIndexBinding = getIndexBinding( type );
if ( isIdentifierProperty( entityIndexBinding, propertyPath ) ) {
return true;
}
TypeMetadata metadata = entityIndexBinding.getDocumentBuilder().getMetadata();
for ( int i = 0; i < propertyPath.length - 1; i++ ) {
Set<EmbeddedTypeMetadata> embeddedTypeMetadata = metadata.getEmbeddedTypeMetadata();
metadata = getEmbeddedTypeMetadata( embeddedTypeMetadata, propertyPath[i] );
if ( metadata == null ) {