private void writeComplexProperty(EdmComplexType type, Property property) throws SerializerException { if (this.collection) { this.response.setContent(this.serializer.complexCollection(this.metadata, type, property, this.complexOptions).getContent()); } else { this.response.setContent(this.serializer.complex(this.metadata, type, property, this.complexOptions).getContent()); } writeOK(responseContentType); close(); }
@Override public SerializerResult serialize(Annotatable result, EdmType complexType) throws SerializerException, ODataJPASerializerException { final ContextURL contextUrl = ContextURL.with().build(); final ComplexSerializerOptions options = ComplexSerializerOptions.with().contextURL(contextUrl).build(); return serializer.complex(serviceMetadata, (EdmComplexType) complexType, (Property) result, options); }
private void writeComplexProperty(EdmComplexType type, Property property) throws SerializerException { if (this.collection) { this.response.setContent(this.serializer.complexCollection(this.metadata, type, property, this.complexOptions).getContent()); } else { this.response.setContent(this.serializer.complex(this.metadata, type, property, this.complexOptions).getContent()); } writeOK(responseContentType); close(); }
@Override public SerializerResult serialize(final ODataRequest request, final EntityCollection result) throws SerializerException { final EdmEntitySet targetEdmEntitySet = Util.determineTargetEntitySet(uriInfo.getUriResourceParts()); final List<UriResource> resourceParts = uriInfo.getUriResourceParts(); final UriResourceProperty uriProperty = (UriResourceProperty) resourceParts.get(resourceParts.size() - 1); final EdmComplexType edmPropertyType = (EdmComplexType) uriProperty.getProperty().getType(); final String selectList = uriHelper.buildContextURLSelectList(targetEdmEntitySet.getEntityType(), uriInfo.getExpandOption(), uriInfo.getSelectOption()); final ContextURL contextUrl = ContextURL.with() .entitySet(targetEdmEntitySet) .navOrPropertyPath(Util.determineProptertyNavigationPath(uriInfo.getUriResourceParts())) .selectList(selectList) .build(); final ComplexSerializerOptions options = ComplexSerializerOptions.with() .contextURL(contextUrl) .select(uriInfo.getSelectOption()) .expand(uriInfo.getExpandOption()) .build(); if (uriProperty.getProperty().isCollection()) { return serializer.complexCollection(serviceMetadata, edmPropertyType, determineProperty(targetEdmEntitySet, result), options); } else { return serializer.complex(serviceMetadata, edmPropertyType, determineProperty(targetEdmEntitySet, result), options); } }