private boolean hasAttributeThatReferences ( EntityType candidate , String entityTypeId ) { Iterable < Attribute > attributes = candidate . getOwnAtomicAttributes ( ) ; return stream ( attributes ) . filter ( Attribute :: hasRefEntity ) . map ( attribute -> attribute . getRefEntity ( ) . getId ( ) ) . anyMatch ( entityTypeId :: equals ) ; }
Determines if an entityType has an attribute that references another entity