String attributeName = attributeDef.getName(); AtlasType attributeType = typeRegistry.getType(attributeDef.getTypeName()); AtlasEntityType attributeEntityType = getReferencedEntityType(attributeType);
@Override public void resolveReferencesPhase3(AtlasTypeRegistry typeRegistry) throws AtlasBaseException { for (AtlasAttributeDef attributeDef : getStructDef().getAttributeDefs()) { String attributeName = attributeDef.getName(); AtlasType attributeType = typeRegistry.getType(attributeDef.getTypeName()); AtlasEntityType attributeEntityType = getReferencedEntityType(attributeType); // validate if RelationshipDefs is defined for all entityDefs if (attributeEntityType != null && !hasRelationshipAttribute(attributeName)) { LOG.warn("No RelationshipDef defined between {} and {} on attribute: {}.{}", getTypeName(), attributeEntityType.getTypeName(), getTypeName(), attributeName); } } for (String superTypeName : allSuperTypes) { AtlasEntityType superType = typeRegistry.getEntityTypeByName(superTypeName); Map<String, AtlasAttribute> superTypeRelationshipAttributes = superType.getRelationshipAttributes(); if (MapUtils.isNotEmpty(superTypeRelationshipAttributes)) { relationshipAttributes.putAll(superTypeRelationshipAttributes); } Map<String, List<AtlasRelationshipType>> superTypeRelationshipAttributesType = superType.getRelationshipAttributesType(); if (MapUtils.isNotEmpty(superTypeRelationshipAttributesType)) { relationshipAttributesType.putAll(superTypeRelationshipAttributesType); } } allSubTypes = Collections.unmodifiableSet(allSubTypes); typeAndAllSubTypes = Collections.unmodifiableSet(typeAndAllSubTypes); typeAndAllSubTypesQryStr = ""; // will be computed on next access relationshipAttributes = Collections.unmodifiableMap(relationshipAttributes); relationshipAttributesType = Collections.unmodifiableMap(relationshipAttributesType); }