/** * Gets the multiplicity for a given name. * @param literal * @return {@link EdmMultiplicity} */ public static EdmMultiplicity fromLiteral(final String literal) { for (final EdmMultiplicity edmMultiplicity : EdmMultiplicity.values()) { if (edmMultiplicity.toString().equals(literal)) { return edmMultiplicity; } } throw new IllegalArgumentException("Invalid literal " + literal); }
EdmEntityType targetType = navigationProperty.getRelationship().getEnd(navigationProperty.getToRole()) .getEntityType(); if (navigationProperty.getMultiplicity().equals(EdmMultiplicity.MANY)) { List<Map<String, Object>> childEntities = null; if (properties.get(propertyName) instanceof List)
private static void writeAssociationEnd(final AssociationEnd end, final Map<String, String> predefinedNamespaces, final XMLStreamWriter xmlStreamWriter) throws XMLStreamException { xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_ASSOCIATION_END); xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_TYPE, end.getType().toString()); xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ASSOCIATION_MULTIPLICITY, end.getMultiplicity().toString()); if (end.getRole() != null) { xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ROLE, end.getRole()); } writeAnnotationAttributes(end.getAnnotationAttributes(), predefinedNamespaces, null, xmlStreamWriter); writeDocumentation(end.getDocumentation(), predefinedNamespaces, xmlStreamWriter); OnDelete onDelete = end.getOnDelete(); if (onDelete != null) { xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_ASSOCIATION_ONDELETE); xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ONDELETE_ACTION, onDelete.getAction().toString()); writeAnnotationAttributes(onDelete.getAnnotationAttributes(), predefinedNamespaces, null, xmlStreamWriter); writeDocumentation(onDelete.getDocumentation(), predefinedNamespaces, xmlStreamWriter); writeAnnotationElements(onDelete.getAnnotationElements(), predefinedNamespaces, xmlStreamWriter); xmlStreamWriter.writeEndElement(); } writeAnnotationElements(end.getAnnotationElements(), predefinedNamespaces, xmlStreamWriter); xmlStreamWriter.writeEndElement(); }
List<AnnotationElement> annotationElements = new ArrayList<AnnotationElement>(); associationEnd.setRole(reader.getAttributeValue(null, XmlMetadataConstants.EDM_ROLE)); associationEnd.setMultiplicity(EdmMultiplicity.fromLiteral(reader.getAttributeValue(null, XmlMetadataConstants.EDM_ASSOCIATION_MULTIPLICITY))); String type = reader.getAttributeValue(null, XmlMetadataConstants.EDM_TYPE);
if(entity instanceof List<?> && multiplicity.name().equalsIgnoreCase("MANY") && functionImport.getReturnType().getType().getKind()==EdmTypeKind.ENTITY){ EntityProviderWriteProperties writeProperties = getEntityProviderWriteProperties((UriInfo) uriInfo, dataProviderResponse);
Map<String, Object> targetEntityValues = null; if (navigationProperty.getMultiplicity().equals(EdmMultiplicity.MANY)) { providerResponse = readEntitySet(gwUriInfo, context); targetEntitySetValues = providerResponse.getResultEntities();
private static void writeAssociationEnd(final AssociationEnd end, final Map<String, String> predefinedNamespaces, final XMLStreamWriter xmlStreamWriter) throws XMLStreamException { xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_ASSOCIATION_END); xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_TYPE, end.getType().toString()); xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ASSOCIATION_MULTIPLICITY, end.getMultiplicity().toString()); if (end.getRole() != null) { xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ROLE, end.getRole()); } writeAnnotationAttributes(end.getAnnotationAttributes(), predefinedNamespaces, null, xmlStreamWriter); writeDocumentation(end.getDocumentation(), predefinedNamespaces, xmlStreamWriter); OnDelete onDelete = end.getOnDelete(); if (onDelete != null) { xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_ASSOCIATION_ONDELETE); xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ONDELETE_ACTION, onDelete.getAction().toString()); writeAnnotationAttributes(onDelete.getAnnotationAttributes(), predefinedNamespaces, null, xmlStreamWriter); writeDocumentation(onDelete.getDocumentation(), predefinedNamespaces, xmlStreamWriter); writeAnnotationElements(onDelete.getAnnotationElements(), predefinedNamespaces, xmlStreamWriter); xmlStreamWriter.writeEndElement(); } writeAnnotationElements(end.getAnnotationElements(), predefinedNamespaces, xmlStreamWriter); xmlStreamWriter.writeEndElement(); }
List<AnnotationElement> annotationElements = new ArrayList<AnnotationElement>(); associationEnd.setRole(reader.getAttributeValue(null, XmlMetadataConstants.EDM_ROLE)); associationEnd.setMultiplicity(EdmMultiplicity.fromLiteral(reader.getAttributeValue(null, XmlMetadataConstants.EDM_ASSOCIATION_MULTIPLICITY))); String type = reader.getAttributeValue(null, XmlMetadataConstants.EDM_TYPE);
/** * Gets the multiplicity for a given name. * @param literal * @return {@link EdmMultiplicity} */ public static EdmMultiplicity fromLiteral(final String literal) { for (final EdmMultiplicity edmMultiplicity : EdmMultiplicity.values()) { if (edmMultiplicity.toString().equals(literal)) { return edmMultiplicity; } } throw new IllegalArgumentException("Invalid literal " + literal); }
.getMultiplicity().equals(EdmMultiplicity.MANY)) {
private static void writeAssociationEnd(final AssociationEnd end, final Map<String, String> predefinedNamespaces, final XMLStreamWriter xmlStreamWriter) throws XMLStreamException { xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_ASSOCIATION_END); xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_TYPE, end.getType().toString()); xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ASSOCIATION_MULTIPLICITY, end.getMultiplicity().toString()); if (end.getRole() != null) { xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ROLE, end.getRole()); } writeAnnotationAttributes(end.getAnnotationAttributes(), predefinedNamespaces, null, xmlStreamWriter); writeDocumentation(end.getDocumentation(), predefinedNamespaces, xmlStreamWriter); OnDelete onDelete = end.getOnDelete(); if (onDelete != null) { xmlStreamWriter.writeStartElement(XmlMetadataConstants.EDM_ASSOCIATION_ONDELETE); xmlStreamWriter.writeAttribute(XmlMetadataConstants.EDM_ONDELETE_ACTION, onDelete.getAction().toString()); writeAnnotationAttributes(onDelete.getAnnotationAttributes(), predefinedNamespaces, null, xmlStreamWriter); writeDocumentation(onDelete.getDocumentation(), predefinedNamespaces, xmlStreamWriter); writeAnnotationElements(onDelete.getAnnotationElements(), predefinedNamespaces, xmlStreamWriter); xmlStreamWriter.writeEndElement(); } writeAnnotationElements(end.getAnnotationElements(), predefinedNamespaces, xmlStreamWriter); xmlStreamWriter.writeEndElement(); }
List<AnnotationElement> annotationElements = new ArrayList<AnnotationElement>(); associationEnd.setRole(reader.getAttributeValue(null, XmlMetadataConstants.EDM_ROLE)); associationEnd.setMultiplicity(EdmMultiplicity.fromLiteral(reader.getAttributeValue(null, XmlMetadataConstants.EDM_ASSOCIATION_MULTIPLICITY))); String type = reader.getAttributeValue(null, XmlMetadataConstants.EDM_TYPE);
/** * Gets the multiplicity for a given name. * @param literal * @return {@link EdmMultiplicity} */ public static EdmMultiplicity fromLiteral(final String literal) { for (final EdmMultiplicity edmMultiplicity : EdmMultiplicity.values()) { if (edmMultiplicity.toString().equals(literal)) { return edmMultiplicity; } } throw new IllegalArgumentException("Invalid literal " + literal); }
.getMultiplicity().equals(EdmMultiplicity.MANY)) {
List<EdmAnnotationElement> annotationElements = new ArrayList<EdmAnnotationElement>(); associationEnd.setRole(reader.getAttributeValue(null, XmlMetadataConstants.EDM_ROLE)); associationEnd.setMultiplicity(EdmMultiplicity.fromLiteral(reader.getAttributeValue(null, XmlMetadataConstants.EDM_ASSOCIATION_MULTIPLICITY))); String type = reader.getAttributeValue(null, XmlMetadataConstants.EDM_TYPE);
/** * Gets the multiplicity for a given name. * @param literal * @return {@link EdmMultiplicity} */ public static EdmMultiplicity fromLiteral(final String literal) { for (final EdmMultiplicity edmMultiplicity : EdmMultiplicity.values()) { if (edmMultiplicity.toString().equals(literal)) { return edmMultiplicity; } } throw new IllegalArgumentException("Invalid literal " + literal); }
boolean end1eqCurEnd1 = end1.getMultiplicity().equals(currentAssociationEnd1.getMultiplicity()); boolean end2eqCurEnd2 = end2.getMultiplicity().equals(currentAssociationEnd2.getMultiplicity()); if(end1Type.equals(currentAssociationEnd1Type) && end2Type.equals(currentAssociationEnd2Type) && end1eqCurEnd1 && end2eqCurEnd2) { boolean end1EqCurEnd2 = end1.getMultiplicity().equals(currentAssociationEnd2.getMultiplicity()); boolean end2EqCurEnd1 = end2.getMultiplicity().equals(currentAssociationEnd1.getMultiplicity()); if(end1Type.equals(currentAssociationEnd2Type) && end2Type.equals(currentAssociationEnd1Type) && end1EqCurEnd2 && end2EqCurEnd1) {
boolean end1eqCurEnd1 = end1.getMultiplicity().equals(currentAssociationEnd1.getMultiplicity()); boolean end2eqCurEnd2 = end2.getMultiplicity().equals(currentAssociationEnd2.getMultiplicity()); if(end1Type.equals(currentAssociationEnd1Type) && end2Type.equals(currentAssociationEnd2Type) && end1eqCurEnd1 && end2eqCurEnd2) { boolean end1EqCurEnd2 = end1.getMultiplicity().equals(currentAssociationEnd2.getMultiplicity()); boolean end2EqCurEnd1 = end2.getMultiplicity().equals(currentAssociationEnd1.getMultiplicity()); if(end1Type.equals(currentAssociationEnd2Type) && end2Type.equals(currentAssociationEnd1Type) && end1EqCurEnd2 && end2EqCurEnd1) {
if (functionImport.getReturnType().getMultiplicity().equals(EdmMultiplicity.MANY)) { edmEntityList = new ArrayList<Map<String, Object>>(); for (Object jpaEntity : resultList) {
if (functionImport.getReturnType().getMultiplicity().equals(EdmMultiplicity.MANY)) { edmEntityList = new ArrayList<Map<String, Object>>(); for (Object jpaEntity : resultList) {