protected void writeOEntity(UriInfo uriInfo, JsonWriter jw, OEntity oe, EdmEntitySet ees, boolean isResponse) { jw.startObject(); { String baseUri = null; // TODO: I'm keeping this pattern of writing the __metadata if we have a non-null type..it seems like we could still // write the uri even if we don't have a type. Also, are there any scenarios where the entity type would be null? Not sure. if (isResponse && oe.getEntityType() != null) { baseUri = uriInfo.getBaseUri().toString(); jw.writeName("__metadata"); jw.startObject(); { String absId = baseUri + InternalUtil.getEntityRelId(oe); jw.writeName("uri"); jw.writeString(absId); jw.writeSeparator(); jw.writeName("type"); jw.writeString(oe.getEntityType().getFullyQualifiedTypeName()); } jw.endObject(); jw.writeSeparator(); } writeOProperties(jw, oe.getProperties()); writeLinks(jw, oe, uriInfo, isResponse); } jw.endObject(); }
protected void writeOEntity(UriInfo uriInfo, JsonWriter jw, OEntity oe, EdmEntitySet ees, boolean isResponse) { jw.startObject(); { String baseUri = null; // TODO: I'm keeping this pattern of writing the __metadata if we have a non-null type..it seems like we could still // write the uri even if we don't have a type. Also, are there any scenarios where the entity type would be null? Not sure. if (isResponse && oe.getEntityType() != null) { baseUri = uriInfo.getBaseUri().toString(); jw.writeName("__metadata"); jw.startObject(); { String absId = baseUri + InternalUtil.getEntityRelId(oe); jw.writeName("uri"); jw.writeString(absId); jw.writeSeparator(); jw.writeName("type"); jw.writeString(oe.getEntityType().getFullyQualifiedTypeName()); } jw.endObject(); jw.writeSeparator(); } writeOProperties(jw, oe.getProperties()); writeLinks(jw, oe, uriInfo, isResponse); } jw.endObject(); }
"term", oe == null ? ees.getType().getFullyQualifiedTypeName() : oe.getEntityType().getFullyQualifiedTypeName(), "scheme", scheme);
"term", oe == null ? ees.getType().getFullyQualifiedTypeName() : oe.getEntityType().getFullyQualifiedTypeName(), "scheme", scheme);