@Override public String getToRole() throws EdmException { return navigationProperty.getToRole(); }
@Override public String getToRole() throws EdmException { return navigationProperty.getToRole(); }
@Override public String getToRole() throws EdmException { return navigationProperty.getToRole(); }
@Override public EdmMultiplicity getMultiplicity() throws EdmException { return ((EdmAssociationImplProv) getRelationship()).getEndMultiplicity(navigationProperty.getToRole()); }
@Override public EdmMultiplicity getMultiplicity() throws EdmException { return ((EdmAssociationImplProv) getRelationship()).getEndMultiplicity(navigationProperty.getToRole()); }
@Override public EdmMultiplicity getMultiplicity() throws EdmException { return ((EdmAssociationImplProv) getRelationship()).getEndMultiplicity(navigationProperty.getToRole()); }
@Override public EdmType getType() throws EdmException { return getRelationship().getEnd(navigationProperty.getToRole()).getEntityType(); }
@Override public EdmType getType() throws EdmException { return getRelationship().getEnd(navigationProperty.getToRole()).getEntityType(); }
@Override public EdmType getType() throws EdmException { return getRelationship().getEnd(navigationProperty.getToRole()).getEntityType(); }
private void validateRelationship() throws EntityProviderException { for (NavigationProperty navProperty : navProperties) { if (associationsMap.containsKey(navProperty.getRelationship())) { Association assoc = associationsMap.get(navProperty.getRelationship()); if (!(assoc.getEnd1().getRole().equals(navProperty.getFromRole()) ^ assoc.getEnd1().getRole().equals(navProperty.getToRole()) && (assoc.getEnd2().getRole().equals(navProperty.getFromRole()) ^ assoc.getEnd2().getRole().equals( navProperty.getToRole())))) { throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT .addContent("Invalid end of association")); } if (!entityTypesMap.containsKey(assoc.getEnd1().getType())) { validateEntityTypeWithAlias(assoc.getEnd1().getType()); } if (!entityTypesMap.containsKey(assoc.getEnd2().getType())) { validateEntityTypeWithAlias(assoc.getEnd2().getType()); } } else { throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT.addContent("Invalid Relationship")); } } }
private void validateRelationship() throws EntityProviderException { for (NavigationProperty navProperty : navProperties) { if (associationsMap.containsKey(navProperty.getRelationship())) { Association assoc = associationsMap.get(navProperty.getRelationship()); if (!(assoc.getEnd1().getRole().equals(navProperty.getFromRole()) ^ assoc.getEnd1().getRole().equals(navProperty.getToRole()) && (assoc.getEnd2().getRole().equals(navProperty.getFromRole()) ^ assoc.getEnd2().getRole().equals( navProperty.getToRole())))) { throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT .addContent("Invalid end of association")); } if (!entityTypesMap.containsKey(assoc.getEnd1().getType())) { validateEntityTypeWithAlias(assoc.getEnd1().getType()); } if (!entityTypesMap.containsKey(assoc.getEnd2().getType())) { validateEntityTypeWithAlias(assoc.getEnd2().getType()); } } else { throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT.addContent("Invalid Relationship")); } } }
private void validateRelationship() throws EntityProviderException { for (NavigationProperty navProperty : navProperties) { if (associationsMap.containsKey(navProperty.getRelationship())) { Association assoc = associationsMap.get(navProperty.getRelationship()); if (!(assoc.getEnd1().getRole().equals(navProperty.getFromRole()) ^ assoc.getEnd1().getRole().equals(navProperty.getToRole()) && (assoc.getEnd2().getRole().equals(navProperty.getFromRole()) ^ assoc.getEnd2().getRole().equals( navProperty.getToRole())))) { throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT .addContent("Invalid end of association")); } if (!entityTypesMap.containsKey(assoc.getEnd1().getType())) { validateEntityTypeWithAlias(assoc.getEnd1().getType()); } if (!entityTypesMap.containsKey(assoc.getEnd2().getType())) { validateEntityTypeWithAlias(assoc.getEnd2().getType()); } } else { throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT.addContent("Invalid Relationship")); } } }
.getFromRole()); xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_NAVIGATION_TO_ROLE, navigationProperty .getToRole());
.getFromRole()); xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_NAVIGATION_TO_ROLE, navigationProperty .getToRole());
.getFromRole()); xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_NAVIGATION_TO_ROLE, navigationProperty .getToRole());
private Association createAssociation(final Field field, final NavigationProperty navProperty) { Association association = new Association(); EdmNavigationProperty navigation = field.getAnnotation(EdmNavigationProperty.class); AssociationEnd fromEnd = new AssociationEnd(); fromEnd.setRole(navProperty.getFromRole()); String typeName = ANNOTATION_HELPER.extractEntityTypeName(field.getDeclaringClass()); fromEnd.setType(new FullQualifiedName(namespace, typeName)); fromEnd.setMultiplicity(EdmMultiplicity.ONE); association.setEnd1(fromEnd); AssociationEnd toEnd = new AssociationEnd(); toEnd.setRole(navProperty.getToRole()); String toTypeName = ANNOTATION_HELPER.extractEntitTypeName(navigation, field); toEnd.setType(new FullQualifiedName(namespace, toTypeName)); toEnd.setMultiplicity(ANNOTATION_HELPER.getMultiplicity(navigation, field)); association.setEnd2(toEnd); String associationName = navProperty.getRelationship().getName(); association.setName(associationName); return association; }
private NavigationProperty clone(NavigationProperty property) { if (property == null) { return null; } NavigationProperty newProperty = new NavigationProperty(); newProperty.setAnnotationAttributes(property.getAnnotationAttributes()); newProperty.setAnnotationElements(property.getAnnotationElements()); newProperty.setDocumentation(property.getDocumentation()); newProperty.setFromRole(property.getFromRole()); newProperty.setMapping(property.getMapping()); newProperty.setName(property.getName()); newProperty.setRelationship(property.getRelationship()); newProperty.setToRole(property.getToRole()); return newProperty; }