return associationSet;
}
private EntitySet readEntitySet(final XMLStreamReader reader) throws XMLStreamException, EntityProviderException {
reader.require(XMLStreamConstants.START_ELEMENT, edmNamespace, XmlMetadataConstants.EDM_ENTITY_SET);
EntitySet entitySet = new EntitySet();
List<AnnotationElement> annotationElements = new ArrayList<AnnotationElement>();
entitySet.setName(reader.getAttributeValue(null, XmlMetadataConstants.EDM_NAME));
String entityType = reader.getAttributeValue(null, XmlMetadataConstants.EDM_ENTITY_TYPE);
if (entityType != null) {
FullQualifiedName fqName = extractFQName(entityType);
entitySet.setEntityType(fqName);
} else {
throw new EntityProviderException(EntityProviderException.MISSING_ATTRIBUTE
.addContent(XmlMetadataConstants.EDM_ENTITY_TYPE).addContent(XmlMetadataConstants.EDM_ENTITY_SET));
}
entitySet.setAnnotationAttributes(readAnnotationAttribute(reader));
while (reader.hasNext()
&& !(reader.isEndElement() && edmNamespace.equals(reader.getNamespaceURI())
&& XmlMetadataConstants.EDM_ENTITY_SET.equals(reader.getLocalName()))) {
reader.next();
if (reader.isStartElement()) {
extractNamespaces(reader);
annotationElements.add(readAnnotationElement(reader));
}
}
if (!annotationElements.isEmpty()) {
entitySet.setAnnotationElements(annotationElements);
}
return entitySet;
}