xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_ASSOCIATION_CONSTRAINT);
writeAnnotationAttributes(referentialConstraint.getAnnotationAttributes(), predefinedNamespaces, null,
xmlStreamWriter);
writeDocumentation(referentialConstraint.getDocumentation(), predefinedNamespaces, xmlStreamWriter);
ReferentialConstraintRole principal = referentialConstraint.getPrincipal();
xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_ASSOCIATION_PRINCIPAL);
xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ROLE, principal.getRole());
writeAnnotationAttributes(principal.getAnnotationAttributes(), predefinedNamespaces, null,
xmlStreamWriter);
for (PropertyRef propertyRef : principal.getPropertyRefs()) {
xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_PROPERTY_REF);
xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_NAME, propertyRef.getName());
xmlStreamWriter.writeEndElement();
}
writeAnnotationElements(principal.getAnnotationElements(), predefinedNamespaces, xmlStreamWriter);
xmlStreamWriter.writeEndElement();
ReferentialConstraintRole dependent = referentialConstraint.getDependent();
xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_ASSOCIATION_DEPENDENT);
xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ROLE, dependent.getRole());
writeAnnotationAttributes(dependent.getAnnotationAttributes(), predefinedNamespaces, null,
xmlStreamWriter);
for (PropertyRef propertyRef : dependent.getPropertyRefs()) {
xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_PROPERTY_REF);
xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_NAME, propertyRef.getName());
xmlStreamWriter.writeEndElement();
}
writeAnnotationElements(dependent.getAnnotationElements(), predefinedNamespaces, xmlStreamWriter);
xmlStreamWriter.writeEndElement();
writeAnnotationElements(referentialConstraint.getAnnotationElements(), predefinedNamespaces,
xmlStreamWriter);
xmlStreamWriter.writeEndElement();