@Override public boolean isCollection() { return keyPredicates == null && function.getReturnType().isCollection(); }
@Override public boolean isCollection() { return keyPredicates == null && function.getReturnType().isCollection(); }
@Override public boolean isCollection() { return getFunction().getReturnType().isCollection(); }
@Override public boolean isCollection() { return action.getReturnType() != null && action.getReturnType().isCollection(); }
@Override public boolean isCollection() { return action.getReturnType() != null && action.getReturnType().isCollection(); }
@Override public boolean isCollection() { return getFunction().getReturnType().isCollection(); }
@SuppressWarnings("unchecked") protected <RES extends ClientInvokeResult> Class<RES> getResultReference(final EdmReturnType returnType) { Class<RES> result; if (returnType == null) { result = (Class<RES>) ClientNoContent.class; } else { if (returnType.isCollection() && returnType.getType().getKind() == EdmTypeKind.ENTITY) { result = (Class<RES>) ClientEntitySet.class; } else if (!returnType.isCollection() && returnType.getType().getKind() == EdmTypeKind.ENTITY) { result = (Class<RES>) ClientEntity.class; } else { result = (Class<RES>) ClientProperty.class; } } return result; } }
@SuppressWarnings("unchecked") private <RES extends ClientInvokeResult> Class<RES> getResultReference(final EdmReturnType returnType) { Class<RES> result; if (returnType == null) { result = (Class<RES>) ClientNoContent.class; } else { if (returnType.isCollection() && returnType.getType().getKind() == EdmTypeKind.ENTITY) { result = (Class<RES>) ClientEntitySet.class; } else if (!returnType.isCollection() && returnType.getType().getKind() == EdmTypeKind.ENTITY) { result = (Class<RES>) ClientEntity.class; } else { result = (Class<RES>) ClientProperty.class; } } return result; }
@SuppressWarnings("unchecked") private <RES extends ClientInvokeResult> Class<RES> getResultReference(final EdmReturnType returnType) { Class<RES> result; if (returnType == null) { result = (Class<RES>) ClientNoContent.class; } else { if (returnType.isCollection() && returnType.getType().getKind() == EdmTypeKind.ENTITY) { result = (Class<RES>) ClientEntitySet.class; } else if (!returnType.isCollection() && returnType.getType().getKind() == EdmTypeKind.ENTITY) { result = (Class<RES>) ClientEntity.class; } else { result = (Class<RES>) ClientProperty.class; } } return result; }
@SuppressWarnings("unchecked") protected <RES extends ClientInvokeResult> Class<RES> getResultReference(final EdmReturnType returnType) { Class<RES> result; if (returnType == null) { result = (Class<RES>) ClientNoContent.class; } else { if (returnType.isCollection() && returnType.getType().getKind() == EdmTypeKind.ENTITY) { result = (Class<RES>) ClientEntitySet.class; } else if (!returnType.isCollection() && returnType.getType().getKind() == EdmTypeKind.ENTITY) { result = (Class<RES>) ClientEntity.class; } else { result = (Class<RES>) ClientProperty.class; } } return result; } }
@Override public boolean isCollection() { assert (hasReturnType()); return getAction().getReturnType().isCollection(); }
@Override public boolean isCollection() { assert (hasReturnType()); return getAction().getReturnType().isCollection(); }
@Override public void setReturnValue(Object returnValue) throws SQLException { try { EdmReturnType returnType = this.procedureReturn.getReturnType(); this.returnValue = EntityCollectionResponse.buildPropery("return", //$NON-NLS-1$ (SingletonPrimitiveType) returnType.getType(), returnType.getPrecision(), returnType.getScale(), returnType.isCollection(), returnValue); } catch (TeiidProcessingException e) { throw new SQLException(e); } catch (IOException e) { throw new SQLException(e); } }
private void appendOperationReturnType(final XMLStreamWriter writer, final EdmOperation operation) throws XMLStreamException { EdmReturnType returnType = operation.getReturnType(); if (returnType != null) { writer.writeEmptyElement(XML_RETURN_TYPE); String returnTypeFqnString; if (EdmTypeKind.PRIMITIVE.equals(returnType.getType().getKind())) { returnTypeFqnString = getFullQualifiedName(returnType.getType(), returnType.isCollection()); } else { returnTypeFqnString = getAliasedFullQualifiedName(returnType.getType(), returnType.isCollection()); } writer.writeAttribute(XML_TYPE, returnTypeFqnString); appendReturnTypeFacets(writer, returnType); } }
private void appendOperationReturnType(final XMLStreamWriter writer, final EdmOperation operation) throws XMLStreamException { EdmReturnType returnType = operation.getReturnType(); if (returnType != null) { writer.writeEmptyElement(XML_RETURN_TYPE); String returnTypeFqnString; if (EdmTypeKind.PRIMITIVE.equals(returnType.getType().getKind())) { returnTypeFqnString = getFullQualifiedName(returnType.getType(), returnType.isCollection()); } else { returnTypeFqnString = getAliasedFullQualifiedName(returnType.getType(), returnType.isCollection()); } writer.writeAttribute(XML_TYPE, returnTypeFqnString); appendReturnTypeFacets(writer, returnType); } }
private UriType getUriTypeForAction(final UriResource lastPathSegment) throws UriValidationException { final EdmReturnType rt = ((UriResourceAction) lastPathSegment).getAction().getReturnType(); if (rt == null) { return UriType.none; } UriType uriType; switch (rt.getType().getKind()) { case ENTITY: uriType = rt.isCollection() ? UriType.entitySet : UriType.entity; break; case PRIMITIVE: case ENUM: case DEFINITION: uriType = rt.isCollection() ? UriType.propertyPrimitiveCollection : UriType.propertyPrimitive; break; case COMPLEX: uriType = rt.isCollection() ? UriType.propertyComplexCollection : UriType.propertyComplex; break; default: throw new UriValidationException("Unsupported action return type: " + rt.getType().getKind(), UriValidationException.MessageKeys.UNSUPPORTED_ACTION_RETURN_TYPE, rt.getType().getKind().toString()); } return uriType; }
private void appendOperationReturnType(final JsonGenerator json, final EdmOperation operation) throws SerializerException, IOException { EdmReturnType returnType = operation.getReturnType(); if (returnType != null) { json.writeObjectFieldStart(RETURN_TYPE); String returnTypeFqnString; if (EdmTypeKind.PRIMITIVE.equals(returnType.getType().getKind())) { returnTypeFqnString = getFullQualifiedName(returnType.getType()); } else { returnTypeFqnString = getAliasedFullQualifiedName(returnType.getType()); } json.writeStringField(TYPE, returnTypeFqnString); if (returnType.isCollection()) { json.writeBooleanField(COLLECTION, returnType.isCollection()); } appendReturnTypeFacets(json, returnType); json.writeEndObject(); } }
private void appendOperationReturnType(final JsonGenerator json, final EdmOperation operation) throws SerializerException, IOException { EdmReturnType returnType = operation.getReturnType(); if (returnType != null) { json.writeObjectFieldStart(RETURN_TYPE); String returnTypeFqnString; if (EdmTypeKind.PRIMITIVE.equals(returnType.getType().getKind())) { returnTypeFqnString = getFullQualifiedName(returnType.getType()); } else { returnTypeFqnString = getAliasedFullQualifiedName(returnType.getType()); } json.writeStringField(TYPE, returnTypeFqnString); if (returnType.isCollection()) { json.writeBooleanField(COLLECTION, returnType.isCollection()); } appendReturnTypeFacets(json, returnType); json.writeEndObject(); } }
public StructuredComposableInvokerInvocationHandler( final URI uri, final Map<String, ClientValue> parameters, final Operation operation, final EdmOperation edmOperation, final Type[] references, final EdmTypeInfo returnType, final AbstractService<?> service) { super(uri, parameters, operation, edmOperation, references, service); if (!edmOperation.getReturnType().isCollection()) { if (returnType.isEntityType()) { this.structuredHandler = EntityInvocationHandler.getInstance( uri, targetRef, service); } if (returnType.isComplexType()) { this.structuredHandler = ComplexInvocationHandler.getInstance( targetRef, service, service.getClient().newURIBuilder(uri.toASCIIString())); } } }
public StructuredComposableInvokerInvocationHandler( final URI uri, final Map<String, ClientValue> parameters, final Operation operation, final EdmOperation edmOperation, final Type[] references, final EdmTypeInfo returnType, final AbstractService<?> service) { super(uri, parameters, operation, edmOperation, references, service); if (!edmOperation.getReturnType().isCollection()) { if (returnType.isEntityType()) { this.structuredHandler = EntityInvocationHandler.getInstance( uri, targetRef, service); } if (returnType.isComplexType()) { this.structuredHandler = ComplexInvocationHandler.getInstance( targetRef, service, service.getClient().newURIBuilder(uri.toASCIIString())); } } }