public EdmAssociationSetEndImplProv(final AssociationSetEnd end, final EdmEntitySet entitySet) throws EdmException { this.end = end; this.entitySet = entitySet; role = end.getRole(); }
public EdmAssociationSetEndImplProv(final AssociationSetEnd end, final EdmEntitySet entitySet) throws EdmException { this.end = end; this.entitySet = entitySet; role = end.getRole(); }
public EdmAssociationSetEndImplProv(final AssociationSetEnd end, final EdmEntitySet entitySet) throws EdmException { this.end = end; this.entitySet = entitySet; role = end.getRole(); }
private static void writeAssociationSetEnd(final AssociationSetEnd end, final Map<String, String> predefinedNamespaces, final XMLStreamWriter xmlStreamWriter) throws XMLStreamException { xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_ASSOCIATION_END); xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ENTITY_SET, end.getEntitySet().toString()); if (end.getRole() != null) { xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ROLE, end.getRole()); } writeAnnotationAttributes(end.getAnnotationAttributes(), predefinedNamespaces, null, xmlStreamWriter); writeDocumentation(end.getDocumentation(), predefinedNamespaces, xmlStreamWriter); writeAnnotationElements(end.getAnnotationElements(), predefinedNamespaces, xmlStreamWriter); xmlStreamWriter.writeEndElement(); }
private static void writeAssociationSetEnd(final AssociationSetEnd end, final Map<String, String> predefinedNamespaces, final XMLStreamWriter xmlStreamWriter) throws XMLStreamException { xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_ASSOCIATION_END); xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ENTITY_SET, end.getEntitySet().toString()); if (end.getRole() != null) { xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ROLE, end.getRole()); } writeAnnotationAttributes(end.getAnnotationAttributes(), predefinedNamespaces, null, xmlStreamWriter); writeDocumentation(end.getDocumentation(), predefinedNamespaces, xmlStreamWriter); writeAnnotationElements(end.getAnnotationElements(), predefinedNamespaces, xmlStreamWriter); xmlStreamWriter.writeEndElement(); }
private static void writeAssociationSetEnd(final AssociationSetEnd end, final Map<String, String> predefinedNamespaces, final XMLStreamWriter xmlStreamWriter) throws XMLStreamException { xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_ASSOCIATION_END); xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ENTITY_SET, end.getEntitySet().toString()); if (end.getRole() != null) { xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ROLE, end.getRole()); } writeAnnotationAttributes(end.getAnnotationAttributes(), predefinedNamespaces, null, xmlStreamWriter); writeDocumentation(end.getDocumentation(), predefinedNamespaces, xmlStreamWriter); writeAnnotationElements(end.getAnnotationElements(), predefinedNamespaces, xmlStreamWriter); xmlStreamWriter.writeEndElement(); }
private void validateAssociationEnd(final AssociationSetEnd end, final Association association) throws EntityProviderException { if (!(association.getEnd1().getRole().equals(end.getRole()) ^ association .getEnd2().getRole().equals(end.getRole()))) { throw new EntityProviderException(EntityProviderException.COMMON.addContent("Invalid Association")); } }
private void validateAssociationEnd(final AssociationSetEnd end, final Association association) throws EntityProviderException { if (!(association.getEnd1().getRole().equals(end.getRole()) ^ association .getEnd2().getRole().equals(end.getRole()))) { throw new EntityProviderException(EntityProviderException.COMMON.addContent("Invalid Association")); } }
private void validateAssociationEnd(final AssociationSetEnd end, final Association association) throws EntityProviderException { if (!(association.getEnd1().getRole().equals(end.getRole()) ^ association .getEnd2().getRole().equals(end.getRole()))) { throw new EntityProviderException(EntityProviderException.COMMON.addContent("Invalid Association")); } }
@Override public AssociationSet getAssociationSet(final String entityContainer, final FullQualifiedName association, final String sourceEntitySetName, final String sourceEntitySetRole) throws ODataException { EntityContainer container = name2Container.get(entityContainer); if (container != null) { List<AssociationSet> associations = container.getAssociationSets(); for (AssociationSet associationSet : associations) { if (associationSet.getAssociation().equals(association)) { final AssociationSetEnd endOne = associationSet.getEnd1(); if (endOne.getRole().equals(sourceEntitySetRole) && endOne.getEntitySet().equals(sourceEntitySetName)) { return associationSet; } final AssociationSetEnd endTwo = associationSet.getEnd2(); if (endTwo.getRole().equals(sourceEntitySetRole) && endTwo.getEntitySet().equals(sourceEntitySetName)) { return associationSet; } } } } return null; }
@Override public AssociationSet getAssociationSet(final String entityContainer, final FullQualifiedName association, final String sourceEntitySetName, final String sourceEntitySetRole) throws ODataException { EntityContainer container = name2Container.get(entityContainer); if (container != null) { List<AssociationSet> associations = container.getAssociationSets(); for (AssociationSet associationSet : associations) { if (associationSet.getAssociation().equals(association)) { final AssociationSetEnd endOne = associationSet.getEnd1(); if (endOne.getRole().equals(sourceEntitySetRole) && endOne.getEntitySet().equals(sourceEntitySetName)) { return associationSet; } final AssociationSetEnd endTwo = associationSet.getEnd2(); if (endTwo.getRole().equals(sourceEntitySetRole) && endTwo.getEntitySet().equals(sourceEntitySetName)) { return associationSet; } } } } return null; }
@Override public AssociationSet getAssociationSet(final String entityContainer, final FullQualifiedName association, final String sourceEntitySetName, final String sourceEntitySetRole) throws ODataException { EntityContainer container = name2Container.get(entityContainer); if (container != null) { List<AssociationSet> associations = container.getAssociationSets(); for (AssociationSet associationSet : associations) { if (associationSet.getAssociation().equals(association)) { final AssociationSetEnd endOne = associationSet.getEnd1(); if (endOne.getRole().equals(sourceEntitySetRole) && endOne.getEntitySet().equals(sourceEntitySetName)) { return associationSet; } final AssociationSetEnd endTwo = associationSet.getEnd2(); if (endTwo.getRole().equals(sourceEntitySetRole) && endTwo.getEntitySet().equals(sourceEntitySetName)) { return associationSet; } } } } return null; }
@Override public EdmAssociationSetEnd getEnd(final String role) throws EdmException { AssociationSetEnd end; if (associationSet.getEnd1().getRole().equals(role)) { end = associationSet.getEnd1(); } else if (associationSet.getEnd2().getRole().equals(role)) { end = associationSet.getEnd2(); } else { return null; } EdmEntitySet entitySet = edmEntityContainer.getEntitySet(end.getEntitySet()); if (entitySet == null) { throw new EdmException(EdmException.COMMON); } return new EdmAssociationSetEndImplProv(end, entitySet); }
@Override public EdmAssociationSetEnd getEnd(final String role) throws EdmException { AssociationSetEnd end; if (associationSet.getEnd1().getRole().equals(role)) { end = associationSet.getEnd1(); } else if (associationSet.getEnd2().getRole().equals(role)) { end = associationSet.getEnd2(); } else { return null; } EdmEntitySet entitySet = edmEntityContainer.getEntitySet(end.getEntitySet()); if (entitySet == null) { throw new EdmException(EdmException.COMMON); } return new EdmAssociationSetEndImplProv(end, entitySet); }
@Override public AssociationSet getAssociationSet(final String entityContainer, final FullQualifiedName association, final String sourceEntitySetName, final String sourceEntitySetRole) throws ODataException { for (Schema schema : dataServices.getSchemas()) { for (EntityContainer container : schema.getEntityContainers()) { if (container.getName().equals(entityContainer)) { for (AssociationSet associationSet : container.getAssociationSets()) { if (associationSet.getAssociation().equals(association) && ((associationSet.getEnd1().getEntitySet().equals(sourceEntitySetName) && associationSet.getEnd1() .getRole().equals(sourceEntitySetRole)) || (associationSet.getEnd2().getEntitySet().equals(sourceEntitySetName) && associationSet.getEnd2() .getRole().equals(sourceEntitySetRole)))) { return associationSet; } } } } } return null; }
@Override public EdmAssociationSetEnd getEnd(final String role) throws EdmException { AssociationSetEnd end; if (associationSet.getEnd1().getRole().equals(role)) { end = associationSet.getEnd1(); } else if (associationSet.getEnd2().getRole().equals(role)) { end = associationSet.getEnd2(); } else { return null; } EdmEntitySet entitySet = edmEntityContainer.getEntitySet(end.getEntitySet()); if (entitySet == null) { throw new EdmException(EdmException.COMMON); } return new EdmAssociationSetEndImplProv(end, entitySet); }
@Override public AssociationSet getAssociationSet(final String entityContainer, final FullQualifiedName association, final String sourceEntitySetName, final String sourceEntitySetRole) throws ODataException { EntityContainer container = null; if (!entityContainerInfos.containsKey(entityContainer)) { container = (EntityContainer) getEntityContainerInfo(entityContainer); } else { container = (EntityContainer) entityContainerInfos.get(entityContainer); } if (container != null && association != null && container.getAssociationSets() != null) { for (AssociationSet as : container.getAssociationSets()) { if (association.equals(as.getAssociation())) { AssociationSetEnd end = as.getEnd1(); if (sourceEntitySetName.equals(end.getEntitySet()) && sourceEntitySetRole.equals(end.getRole())) { return as; } else { end = as.getEnd2(); if (sourceEntitySetName.equals(end.getEntitySet()) && sourceEntitySetRole.equals(end.getRole())) { return as; } } } } } return null; }
@Override public AssociationSet getAssociationSet(final String entityContainer, final FullQualifiedName association, final String sourceEntitySetName, final String sourceEntitySetRole) throws ODataException { for (Schema schema : dataServices.getSchemas()) { for (EntityContainer container : schema.getEntityContainers()) { if (container.getName().equals(entityContainer)) { for (AssociationSet associationSet : container.getAssociationSets()) { if (associationSet.getAssociation().equals(association) && ((associationSet.getEnd1().getEntitySet().equals(sourceEntitySetName) && associationSet.getEnd1() .getRole().equals(sourceEntitySetRole)) || (associationSet.getEnd2().getEntitySet().equals(sourceEntitySetName) && associationSet.getEnd2() .getRole().equals(sourceEntitySetRole)))) { return associationSet; } } } } } return null; }
@Override public AssociationSet getAssociationSet(final String entityContainer, final FullQualifiedName association, final String sourceEntitySetName, final String sourceEntitySetRole) throws ODataException { for (Schema schema : dataServices.getSchemas()) { for (EntityContainer container : schema.getEntityContainers()) { if (container.getName().equals(entityContainer)) { for (AssociationSet associationSet : container.getAssociationSets()) { if (associationSet.getAssociation().equals(association) && ((associationSet.getEnd1().getEntitySet().equals(sourceEntitySetName) && associationSet.getEnd1() .getRole().equals(sourceEntitySetRole)) || (associationSet.getEnd2().getEntitySet().equals(sourceEntitySetName) && associationSet.getEnd2() .getRole().equals(sourceEntitySetRole)))) { return associationSet; } } } } } return null; }
private AssociationSetEnd clone(AssociationSetEnd setEnd) { if (setEnd == null) { return null; } AssociationSetEnd newSetEnd = new AssociationSetEnd(); newSetEnd.setAnnotationAttributes(setEnd.getAnnotationAttributes()); newSetEnd.setAnnotationElements(setEnd.getAnnotationElements()); newSetEnd.setDocumentation(setEnd.getDocumentation()); newSetEnd.setEntitySet(setEnd.getEntitySet()); newSetEnd.setRole(setEnd.getRole()); return newSetEnd; }