OLINGO-911: small correction to show the count based requests with functions/actions
This commit is contained in:
parent
0d37336eba
commit
300316db8d
|
@ -57,6 +57,7 @@ import org.apache.olingo.server.core.requests.DataRequest;
|
|||
import org.apache.olingo.server.core.requests.FunctionRequest;
|
||||
import org.apache.olingo.server.core.requests.MediaRequest;
|
||||
import org.apache.olingo.server.core.requests.MetadataRequest;
|
||||
import org.apache.olingo.server.core.requests.OperationRequest;
|
||||
import org.apache.olingo.server.core.requests.ServiceDocumentRequest;
|
||||
import org.apache.olingo.server.core.uri.parser.Parser;
|
||||
import org.apache.olingo.server.core.uri.validator.UriValidator;
|
||||
|
@ -178,8 +179,13 @@ public class ServiceDispatcher extends RequestURLHierarchyVisitor {
|
|||
|
||||
@Override
|
||||
public void visit(UriResourceCount option) {
|
||||
DataRequest dataRequest = (DataRequest) this.request;
|
||||
dataRequest.setCountRequest(option != null);
|
||||
if (this.request instanceof DataRequest) {
|
||||
DataRequest dataRequest = (DataRequest) this.request;
|
||||
dataRequest.setCountRequest(option != null);
|
||||
} else if (this.request instanceof OperationRequest) {
|
||||
OperationRequest opRequest = (OperationRequest) this.request;
|
||||
opRequest.setCountRequest(option != null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -33,6 +33,8 @@ import org.apache.olingo.server.core.ServiceRequest;
|
|||
|
||||
public abstract class OperationRequest extends ServiceRequest {
|
||||
|
||||
private boolean countRequest;
|
||||
|
||||
public OperationRequest(OData odata, ServiceMetadata serviceMetadata) {
|
||||
super(odata, serviceMetadata);
|
||||
}
|
||||
|
@ -114,4 +116,12 @@ public abstract class OperationRequest extends ServiceRequest {
|
|||
public boolean isReturnTypeComplex() {
|
||||
return getReturnType().getType().getKind() == EdmTypeKind.COMPLEX;
|
||||
}
|
||||
|
||||
public boolean isCountRequest() {
|
||||
return countRequest;
|
||||
}
|
||||
|
||||
public void setCountRequest(boolean countRequest) {
|
||||
this.countRequest = countRequest;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue