/**
* Creates the response for batch.
*
* @param httpHeaders the http headers
* @param producerResolver the producer resolver
* @param baseUri the base uri
* @param requestedEntity the requested entity
* @return the response
* @throws Exception the exception
*/
public Response createResponseForBatch(HttpHeaders httpHeaders, ContextResolver<ODataProducer> producerResolver, URI baseUri, String requestedEntity) throws Exception {
ODataProducer producer = producerResolver.getContext(ODataProducer.class);
OEntityKey entityKey = null;
//setting isResponse to true, since the entity we get from the response contain not only name and value pairs, but also metadata, relations,etc
//so that Json parser will parse it and give you back OEntity.
Boolean isResponse = true;
BatchRequestResource batchRequestResource = new BatchRequestResource();
OEntity entity = batchRequestResource.getRequestEntity(httpHeaders, getResourceHeaders(), getUriInfo(), requestedEntity, producer.getMetadata(), entitySetName, entityKey, isResponse);
return batchRequestResource.createResponseForBatch(httpHeaders, getUriInfo(), producer, getEnitySetName(), entity, getMediaTypeListForBatch());
}
ODataBatchSingleUnit.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:oreva
作者:
评论列表
文章目录