[OLINGO-266] Merge remote-tracking branch 'origin/master' into olingo-266-tecsvc

This commit is contained in:
Stephan Klevenz 2014-05-22 12:35:13 +02:00
commit 92a4404dd4
211 changed files with 3726 additions and 1804 deletions

View File

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>olingo-client-proxy-android</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<parent>
<groupId>org.apache.olingo</groupId>
<artifactId>olingo-ext</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.apache.olingo</groupId>
<artifactId>olingo-client-proxy</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>jarjar-maven-plugin</artifactId>
<inherited>true</inherited>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jarjar</goal>
</goals>
<configuration>
<includes>
<include>org.apache.olingo:olingo-client-proxy-android</include>
<include>org.apache.olingo:olingo-client-proxy</include>
<include>org.apache.olingo:olingo-client-core-android</include>
<include>org.apache.olingo:olingo-client-core</include>
<include>org.apache.olingo:olingo-client-api</include>
<include>org.apache.olingo:olingo-commons-api</include>
<include>org.apache.commons:commons-lang3</include>
<include>org.slf4j:slf4j-api</include>
<include>commons-io:commons-io</include>
<include>commons-beanutils:commons-beanutils</include>
<include>org.apache.httpcomponents:httpclient</include>
<include>org.apache.httpcomponents:httpcore</include>
<include>commons-logging:commons-logging</include>
<include>org.apache.olingo:olingo-commons-core</include>
<include>commons-codec:commons-codec</include>
<include>com.fasterxml.jackson.core:jackson-core</include>
<include>com.fasterxml.jackson.core:jackson-databind</include>
<include>com.fasterxml.jackson.core:jackson-annotations</include>
<include>com.fasterxml.jackson.dataformat:jackson-dataformat-xml</include>
<include>com.fasterxml.jackson.module:jackson-module-jaxb-annotations</include>
<include>org.codehaus.woodstox:stax2-api</include>
<include>javax.xml.stream:stax-api</include>
<include>com.fasterxml:aalto-xml</include>
</includes>
<rules>
<rule>
<pattern>javax.xml.stream.**</pattern>
<result>org.apache.olingo.javax.xml.stream.@1</result>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -51,7 +51,7 @@
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils-core</artifactId>
<artifactId>commons-beanutils</artifactId>
</dependency>
<dependency>
<groupId>commons-logging</groupId>

View File

@ -21,7 +21,7 @@ package org.apache.olingo.ext.proxy.api;
import java.io.Serializable;
import java.util.Collection;
public interface AbstractAnnotatable extends Serializable {
public interface Annotatable extends Serializable {
void addAnnotation(Class<? extends AbstractTerm> term, Object value);

View File

@ -16,19 +16,19 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.communication.request.batch.v4;
package org.apache.olingo.ext.proxy.api.annotations;
/**
* Batch request payload management.
*/
public interface BatchStreamManager
extends org.apache.olingo.client.api.communication.request.batch.BatchStreamManager {
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface AnnotationsForNavigationProperty {
String name();
String type();
/**
* Gets an outside update batch item instance. An outside update item can be submitted embedded into a batch request
* only.
*
* @return ODataOutsideUpdate instance.
*/
ODataOutsideUpdate addOutsideUpdate();
}

View File

@ -16,11 +16,19 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.client.api.communication.request.batch.v3;
package org.apache.olingo.ext.proxy.api.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface AnnotationsForProperty {
String name();
String type();
/**
* Batch request payload management.
*/
public interface BatchStreamManager
extends org.apache.olingo.client.api.communication.request.batch.BatchStreamManager {
}

View File

@ -35,12 +35,17 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.olingo.client.api.CommonEdmEnabledODataClient;
import org.apache.olingo.client.api.communication.request.invoke.ODataNoContent;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.commons.api.domain.CommonODataEntity;
import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
import org.apache.olingo.commons.api.domain.CommonODataProperty;
import org.apache.olingo.commons.api.domain.ODataInvokeResult;
import org.apache.olingo.commons.api.domain.ODataValue;
import org.apache.olingo.commons.api.edm.EdmFunction;
import org.apache.olingo.commons.api.edm.EdmOperation;
import org.apache.olingo.commons.api.edm.EdmReturnType;
import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;
import org.apache.olingo.ext.proxy.EntityContainerFactory;
import org.apache.olingo.ext.proxy.api.OperationType;
@ -156,6 +161,25 @@ abstract class AbstractInvocationHandler implements InvocationHandler {
handler);
}
@SuppressWarnings("unchecked")
private <RES extends ODataInvokeResult> Class<RES> getResultReference(final EdmReturnType returnType) {
Class<RES> result;
if (returnType == null) {
result = (Class<RES>) ODataNoContent.class;
} else {
if (returnType.isCollection() && returnType.getType().getKind() == EdmTypeKind.ENTITY) {
result = (Class<RES>) CommonODataEntitySet.class;
} else if (!returnType.isCollection() && returnType.getType().getKind() == EdmTypeKind.ENTITY) {
result = (Class<RES>) CommonODataEntity.class;
} else {
result = (Class<RES>) CommonODataProperty.class;
}
}
return result;
}
protected Object invokeOperation(
final Operation annotation,
final Method method,
@ -193,7 +217,11 @@ abstract class AbstractInvocationHandler implements InvocationHandler {
// 3. invoke
final ODataInvokeResult result = client.getInvokeRequestFactory().getInvokeRequest(
target, edmOperation, parameterValues).execute().getBody();
edmOperation instanceof EdmFunction ? HttpMethod.GET : HttpMethod.POST,
target,
getResultReference(edmOperation.getReturnType()),
parameterValues).
execute().getBody();
// 4. process invoke result
if (StringUtils.isBlank(annotation.returnType())) {

View File

@ -26,6 +26,8 @@ import java.lang.reflect.Type;
import java.net.URI;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.olingo.client.api.CommonEdmEnabledODataClient;
import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest;
@ -66,6 +68,12 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
protected Object internal;
private final Map<String, AnnotatableInvocationHandler> propAnnotatableHandlers =
new HashMap<String, AnnotatableInvocationHandler>();
private final Map<String, AnnotatableInvocationHandler> navPropAnnotatableHandlers =
new HashMap<String, AnnotatableInvocationHandler>();
protected AbstractStructuredInvocationHandler(
final CommonEdmEnabledODataClient<?> client,
final Class<?> typeRef,
@ -91,6 +99,10 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
this.entityHandler = entityHandler == this ? null : entityHandler;
}
public Object getInternal() {
return internal;
}
public EntityInvocationHandler getEntityHandler() {
return entityHandler == null
? this instanceof EntityInvocationHandler
@ -126,6 +138,13 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {returnType},
ComplexFactoryInvocationHandler.getInstance(getEntityHandler(), this));
} else if ("annotations".equals(method.getName()) && ArrayUtils.isEmpty(args)) {
final Class<?> returnType = method.getReturnType();
return Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {returnType},
AnnotatationsInvocationHandler.getInstance(getEntityHandler(), this));
} else if (method.getName().startsWith("get")) {
// Assumption: for each getter will always exist a setter and viceversa.
// get method annotation and check if it exists as expected
@ -222,7 +241,7 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
null,
((ODataInlineEntity) link).getEntity(),
property.targetContainer(),
client.getURIBuilder(serviceRoot).appendEntitySetSegment(property.targetEntitySet()).build(),
client.newURIBuilder(serviceRoot).appendEntitySetSegment(property.targetEntitySet()).build(),
type,
false);
} else if (link instanceof ODataInlineEntitySet) {
@ -259,7 +278,7 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
uri,
res.getBody(),
property.targetContainer(),
client.getURIBuilder(serviceRoot).appendEntitySetSegment(property.targetEntitySet()).build(),
client.newURIBuilder(serviceRoot).appendEntitySetSegment(property.targetEntitySet()).build(),
type,
res.getETag(),
true);
@ -269,18 +288,6 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
return navPropValue;
}
protected abstract Object getPropertyValue(final String name, final Type type);
public void addAdditionalProperty(final String name, final Object value) {
addPropertyChanges(name, value);
attach(AttachedEntityStatus.CHANGED);
}
public void removeAdditionalProperty(final String name) {
removePropertyChanges(name);
attach(AttachedEntityStatus.CHANGED);
}
public Object getAdditionalProperty(final String name) {
return getPropertyValue(name, null);
}
@ -316,13 +323,31 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
addLinkChanges(property, value);
}
public Map<String, AnnotatableInvocationHandler> getPropAnnotatableHandlers() {
return propAnnotatableHandlers;
}
public void putPropAnnotatableHandler(final String propName, final AnnotatableInvocationHandler handler) {
propAnnotatableHandlers.put(propName, handler);
}
public Map<String, AnnotatableInvocationHandler> getNavPropAnnotatableHandlers() {
return navPropAnnotatableHandlers;
}
public void putNavPropAnnotatableHandler(final String navPropName, final AnnotatableInvocationHandler handler) {
navPropAnnotatableHandlers.put(navPropName, handler);
}
protected abstract void setPropertyValue(final Property property, final Object value);
protected abstract void addPropertyChanges(final String name, final Object value);
protected abstract void removePropertyChanges(final String name);
protected abstract void addLinkChanges(final NavigationProperty navProp, final Object value);
protected abstract Object getPropertyValue(final String name, final Type type);
public abstract void addAdditionalProperty(final String name, final Object value);
public abstract void removeAdditionalProperty(final String name);
public abstract boolean isChanged();
}

View File

@ -0,0 +1,180 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.ext.proxy.commons;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.olingo.client.api.CommonEdmEnabledODataClient;
import org.apache.olingo.commons.api.domain.v4.ODataAnnotation;
import org.apache.olingo.commons.api.domain.v4.ODataEntity;
import org.apache.olingo.commons.api.domain.v4.ODataLinkedComplexValue;
import org.apache.olingo.ext.proxy.api.AbstractTerm;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.Term;
import org.apache.olingo.ext.proxy.context.AttachedEntityStatus;
import org.apache.olingo.ext.proxy.utils.CoreUtils;
public class AnnotatableInvocationHandler extends AbstractInvocationHandler implements Annotatable {
private static final long serialVersionUID = 3111228269617223332L;
private final String propName;
private final String navPropName;
private final EntityInvocationHandler entityHandler;
private final AbstractStructuredInvocationHandler targetHandler;
private final Map<Class<? extends AbstractTerm>, Object> annotations =
new HashMap<Class<? extends AbstractTerm>, Object>();
public AnnotatableInvocationHandler(
final CommonEdmEnabledODataClient<?> client,
final EntityContainerInvocationHandler containerHandler,
final String propName,
final String navPropName,
final EntityInvocationHandler entityHandler,
final AbstractStructuredInvocationHandler targetHandler) {
super(client, containerHandler);
this.propName = propName;
this.navPropName = navPropName;
this.entityHandler = entityHandler;
this.targetHandler = targetHandler;
}
@Override
public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
return invokeSelfMethod(method, args);
}
public Map<Class<? extends AbstractTerm>, Object> getAnnotations() {
return annotations;
}
private List<ODataAnnotation> internalAnnotations() {
List<ODataAnnotation> result = Collections.<ODataAnnotation>emptyList();
if (entityHandler.getEntity() instanceof ODataEntity) {
if (targetHandler.getInternal() instanceof ODataEntity) {
result = propName == null
? ((org.apache.olingo.commons.api.domain.v4.ODataLink) ((ODataEntity) targetHandler.getInternal()).
getNavigationLink(navPropName)).getAnnotations()
: ((ODataEntity) targetHandler.getInternal()).getProperty(propName).getAnnotations();
} else if (targetHandler.getInternal() instanceof ODataLinkedComplexValue) {
result = propName == null
? ((org.apache.olingo.commons.api.domain.v4.ODataLink) ((ODataLinkedComplexValue) targetHandler.
getInternal()).getNavigationLink(navPropName)).getAnnotations()
: ((ODataLinkedComplexValue) targetHandler.getInternal()).get(propName).getAnnotations();
}
}
return result;
}
@Override
public void addAnnotation(final Class<? extends AbstractTerm> term, final Object value) {
this.annotations.put(term, value);
if (value != null) {
Collection<?> coll;
if (Collection.class.isAssignableFrom(value.getClass())) {
coll = Collection.class.cast(value);
} else {
coll = Collections.singleton(value);
}
for (Object item : coll) {
if (item instanceof Proxy) {
final InvocationHandler handler = Proxy.getInvocationHandler(item);
if ((handler instanceof ComplexInvocationHandler)
&& ((ComplexInvocationHandler) handler).getEntityHandler() == null) {
((ComplexInvocationHandler) handler).setEntityHandler(entityHandler);
}
}
}
}
entityHandler.attach(AttachedEntityStatus.CHANGED);
if (navPropName == null) {
targetHandler.putPropAnnotatableHandler(propName, this);
} else {
targetHandler.putNavPropAnnotatableHandler(navPropName, this);
}
}
@Override
public void removeAnnotation(final Class<? extends AbstractTerm> term) {
this.annotations.remove(term);
entityHandler.attach(AttachedEntityStatus.CHANGED);
if (navPropName == null) {
targetHandler.putPropAnnotatableHandler(propName, this);
} else {
targetHandler.putNavPropAnnotatableHandler(navPropName, this);
}
}
@Override
public Object getAnnotation(final Class<? extends AbstractTerm> term) {
Object res = null;
if (annotations.containsKey(term)) {
res = annotations.get(term);
} else if (entityHandler.getEntity() instanceof ODataEntity) {
try {
final Term termAnn = term.getAnnotation(Term.class);
final Namespace namespaceAnn = term.getAnnotation(Namespace.class);
ODataAnnotation annotation = null;
for (ODataAnnotation _annotation : internalAnnotations()) {
if ((namespaceAnn.value() + "." + termAnn.name()).equals(_annotation.getTerm())) {
annotation = _annotation;
}
}
res = annotation == null || annotation.hasNullValue()
? null
: CoreUtils.getObjectFromODataValue(
client, annotation.getValue(), null, targetHandler.getEntityHandler());
if (res != null) {
annotations.put(term, res);
}
} catch (Exception e) {
throw new IllegalArgumentException("Error getting annotation for term '" + term.getName() + "'", e);
}
}
return res;
}
@Override
public Collection<Class<? extends AbstractTerm>> getAnnotationTerms() {
return entityHandler.getEntity() instanceof ODataEntity
? CoreUtils.getAnnotationTerms(internalAnnotations())
: Collections.<Class<? extends AbstractTerm>>emptyList();
}
}

View File

@ -0,0 +1,91 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.ext.proxy.commons;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import org.apache.olingo.client.api.CommonEdmEnabledODataClient;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.utils.ClassUtils;
public class AnnotatationsInvocationHandler extends AbstractInvocationHandler {
private static final long serialVersionUID = -1993362719908718985L;
private final EntityInvocationHandler entityHandler;
private final AbstractStructuredInvocationHandler targetHandler;
static AnnotatationsInvocationHandler getInstance(
final EntityInvocationHandler entityHandler,
final AbstractStructuredInvocationHandler targetHandler) {
return new AnnotatationsInvocationHandler(
entityHandler == null ? null : entityHandler.containerHandler.client,
targetHandler == null
? entityHandler == null ? null : entityHandler.containerHandler : targetHandler.containerHandler,
entityHandler,
targetHandler);
}
private AnnotatationsInvocationHandler(
final CommonEdmEnabledODataClient<?> client,
final EntityContainerInvocationHandler containerHandler,
final EntityInvocationHandler entityHandler,
final AbstractStructuredInvocationHandler targetHandler) {
super(client, containerHandler);
this.targetHandler = targetHandler;
this.entityHandler = entityHandler;
}
@Override
public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
if (isSelfMethod(method, args)) {
return invokeSelfMethod(method, args);
} else if (method.getName().startsWith("get") && method.getName().endsWith("Annotations")) {
final Method getter = proxy.getClass().getInterfaces()[0].getMethod(method.getName());
String propName = null;
String navPropName = null;
final AnnotationsForProperty annForProp = ClassUtils.getAnnotation(AnnotationsForProperty.class, getter);
if (annForProp == null) {
final AnnotationsForNavigationProperty annForNavProp =
ClassUtils.getAnnotation(AnnotationsForNavigationProperty.class, getter);
if (annForNavProp == null) {
throw new UnsupportedOperationException("Unsupported method " + method.getName());
}
navPropName = annForNavProp.name();
} else {
propName = annForProp.name();
}
return Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {method.getReturnType()},
new AnnotatableInvocationHandler(
client, containerHandler, propName, navPropName, entityHandler, targetHandler));
} else {
throw new NoSuchMethodException(method.getName());
}
}
}

View File

@ -45,6 +45,7 @@ class ComplexFactoryInvocationHandler extends AbstractInvocationHandler implemen
static ComplexFactoryInvocationHandler getInstance(
final EntityInvocationHandler entityHandler,
final AbstractStructuredInvocationHandler targetHandler) {
return new ComplexFactoryInvocationHandler(
entityHandler == null ? null : entityHandler.containerHandler.client,
targetHandler == null

View File

@ -131,13 +131,21 @@ public class ComplexInvocationHandler extends AbstractStructuredInvocationHandle
}
@Override
@SuppressWarnings("unchecked")
protected void setPropertyValue(final Property property, final Object value) {
final FullQualifiedName fqn =
new FullQualifiedName(ClassUtils.getNamespace(typeRef), typeRef.getAnnotation(ComplexType.class).name());
final EdmElement edmProperty = client.getCachedEdm().getComplexType(fqn).getProperty(property.name());
final EdmTypeInfo type = new EdmTypeInfo.Builder().setEdm(client.getCachedEdm()).setTypeExpression(
edmProperty.isCollection() ? "Collection(" + property.type() + ")" : property.type()).build();
setPropertyValue(property.name(), type, value);
}
@SuppressWarnings("unchecked")
private void setPropertyValue(final String name, final EdmTypeInfo type, final Object value) {
final Object toBeAdded;
if (value == null) {
@ -145,7 +153,7 @@ public class ComplexInvocationHandler extends AbstractStructuredInvocationHandle
} else if (Collection.class.isAssignableFrom(value.getClass())) {
toBeAdded = new ArrayList<Object>();
for (Object obj : (Collection) value) {
((Collection) toBeAdded).add(obj instanceof Proxy ? Proxy.getInvocationHandler(obj) : obj);
Collection.class.cast(toBeAdded).add(obj instanceof Proxy ? Proxy.getInvocationHandler(obj) : obj);
}
} else if (value instanceof Proxy) {
toBeAdded = Proxy.getInvocationHandler(value);
@ -153,10 +161,7 @@ public class ComplexInvocationHandler extends AbstractStructuredInvocationHandle
toBeAdded = value;
}
final EdmTypeInfo type = new EdmTypeInfo.Builder().setEdm(client.getCachedEdm()).setTypeExpression(
edmProperty.isCollection() ? "Collection(" + property.type() + ")" : property.type()).build();
client.getBinder().add(getComplex(), CoreUtils.getODataProperty(client, property.name(), type, toBeAdded));
client.getBinder().add(getComplex(), CoreUtils.getODataProperty(client, name, type, toBeAdded));
if (getEntityHandler() != null && !entityContext.isAttached(getEntityHandler())) {
entityContext.attach(getEntityHandler(), AttachedEntityStatus.CHANGED);
@ -173,13 +178,18 @@ public class ComplexInvocationHandler extends AbstractStructuredInvocationHandle
}
@Override
protected void addPropertyChanges(final String name, final Object value) {
// do nothing ....
public void addAdditionalProperty(final String name, final Object value) {
setPropertyValue(name, null, value);
attach(AttachedEntityStatus.CHANGED);
}
@Override
protected void removePropertyChanges(final String name) {
// do nothing ....
public void removeAdditionalProperty(final String name) {
final CommonODataProperty property = getComplex().get(name);
if(property !=null && !property.hasNullValue()){
setPropertyValue(name, null, null);
attach(AttachedEntityStatus.CHANGED);
}
}
@Override

View File

@ -34,7 +34,7 @@ import org.apache.olingo.client.api.CommonEdmEnabledODataClient;
import org.apache.olingo.client.api.communication.header.ODataPreferences;
import org.apache.olingo.client.api.communication.request.ODataRequest;
import org.apache.olingo.client.api.communication.request.ODataStreamedRequest;
import org.apache.olingo.client.api.communication.request.batch.BatchStreamManager;
import org.apache.olingo.client.api.communication.request.batch.BatchManager;
import org.apache.olingo.client.api.communication.request.batch.CommonODataBatchRequest;
import org.apache.olingo.client.api.communication.request.batch.ODataBatchResponseItem;
import org.apache.olingo.client.api.communication.request.batch.ODataChangeset;
@ -90,7 +90,7 @@ class ContainerImpl implements Container {
final CommonODataBatchRequest request = client.getBatchRequestFactory().getBatchRequest(client.getServiceRoot());
((ODataRequest) request).setAccept(client.getConfiguration().getDefaultBatchAcceptFormat());
final BatchStreamManager streamManager = (BatchStreamManager) ((ODataStreamedRequest) request).execute();
final BatchManager streamManager = (BatchManager) ((ODataStreamedRequest) request).payloadManager();
final ODataChangeset changeset = streamManager.addChangeset();
@ -113,8 +113,9 @@ class ContainerImpl implements Container {
final ODataBatchResponse response = streamManager.getResponse();
if ((client.getServiceVersion().compareTo(ODataServiceVersion.V30) <= 0 && response.getStatusCode() != 202)
|| (client.getServiceVersion().compareTo(ODataServiceVersion.V30) > 0 && response.getStatusCode() != 200)) {
// This should be 202 for service version <= 3.0 and 200 for service version >= 4.0 but it seems that
// many service implementations are not fully compliant with this respect.
if (response.getStatusCode() != 202 && response.getStatusCode() != 200) {
throw new IllegalStateException("Operation failed");
}
@ -200,7 +201,7 @@ class ContainerImpl implements Container {
LOG.debug("Update media entity '{}'", uri);
final ODataMediaEntityUpdateRequest<?> req =
client.getStreamedRequestFactory().getMediaEntityUpdateRequest(uri, input);
client.getCUDRequestFactory().getMediaEntityUpdateRequest(uri, input);
req.setContentType(StringUtils.isBlank(handler.getEntity().getMediaContentType())
? ODataMediaFormat.WILDCARD.toString()
@ -221,7 +222,7 @@ class ContainerImpl implements Container {
LOG.debug("Update media entity '{}'", uri);
final ODataStreamUpdateRequest req = client.getStreamedRequestFactory().getStreamUpdateRequest(uri, input);
final ODataStreamUpdateRequest req = client.getCUDRequestFactory().getStreamUpdateRequest(uri, input);
if (StringUtils.isNotBlank(handler.getETag())) {
req.setIfMatch(handler.getETag());
@ -321,6 +322,11 @@ class ContainerImpl implements Container {
if (entity instanceof ODataEntity) {
((ODataEntity) entity).getAnnotations().clear();
CoreUtils.addAnnotations(client, handler.getAnnotations(), (ODataEntity) entity);
for (Map.Entry<String, AnnotatableInvocationHandler> entry : handler.getPropAnnotatableHandlers().entrySet()) {
CoreUtils.addAnnotations(client,
entry.getValue().getAnnotations(), ((ODataEntity) entity).getProperty(entry.getKey()));
}
}
}
@ -376,6 +382,16 @@ class ContainerImpl implements Container {
}
}
if (entity instanceof ODataEntity) {
for (Map.Entry<String, AnnotatableInvocationHandler> entry
: handler.getNavPropAnnotatableHandlers().entrySet()) {
CoreUtils.addAnnotations(client,
entry.getValue().getAnnotations(),
(org.apache.olingo.commons.api.domain.v4.ODataLink) entity.getNavigationLink(entry.getKey()));
}
}
// insert into the batch
LOG.debug("{}: Insert '{}' into the batch", pos, handler);
final AttachedEntityStatus processedStatus = batch(handler, entity, changeset);

View File

@ -44,6 +44,7 @@ import org.apache.olingo.commons.api.domain.v4.ODataEntity;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.format.ODataMediaFormat;
import org.apache.olingo.ext.proxy.api.AbstractTerm;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
@ -53,7 +54,7 @@ import org.apache.olingo.ext.proxy.context.AttachedEntityStatus;
import org.apache.olingo.ext.proxy.context.EntityUUID;
import org.apache.olingo.ext.proxy.utils.CoreUtils;
public class EntityInvocationHandler extends AbstractStructuredInvocationHandler {
public class EntityInvocationHandler extends AbstractStructuredInvocationHandler implements Annotatable {
private static final long serialVersionUID = 2629912294765040037L;
@ -180,6 +181,12 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
return propertyChanges;
}
@Override
public void addAdditionalProperty(final String name, final Object value) {
propertyChanges.put(name, value);
attach(AttachedEntityStatus.CHANGED);
}
public Map<NavigationProperty, Object> getLinkChanges() {
return linkChanges;
}
@ -257,7 +264,7 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
if (EdmPrimitiveTypeKind.Stream.getFullQualifiedName().toString().equalsIgnoreCase(property.type())) {
setStreamedProperty(property, (InputStream) value);
} else {
addPropertyChanges(property.name(), value);
propertyChanges.put(property.name(), value);
if (value != null) {
Collection<?> coll;
@ -316,7 +323,7 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
final String contentType =
StringUtils.isBlank(getEntity().getMediaContentType()) ? "*/*" : getEntity().getMediaContentType();
final ODataMediaRequest retrieveReq = client.getRetrieveRequestFactory().getMediaRequest(contentSource);
final ODataMediaRequest retrieveReq = client.getRetrieveRequestFactory().getMediaEntityRequest(contentSource);
retrieveReq.setFormat(ODataMediaFormat.fromFormat(contentType));
this.stream = retrieveReq.execute().getBody();
@ -326,7 +333,6 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
}
public Object getStreamedProperty(final String name) {
InputStream res = streamedPropertyChanges.get(name);
try {
@ -374,13 +380,9 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
}
@Override
protected void addPropertyChanges(final String name, final Object value) {
propertyChanges.put(name, value);
}
@Override
protected void removePropertyChanges(final String name) {
public void removeAdditionalProperty(final String name) {
propertyChanges.remove(name);
attach(AttachedEntityStatus.CHANGED);
}
protected void cacheProperty(final String name, final Object value) {
@ -400,6 +402,7 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
updateLinksTag(checkpoint);
}
@Override
public void addAnnotation(final Class<? extends AbstractTerm> term, final Object value) {
this.annotations.put(term, value);
@ -425,10 +428,13 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
attach(AttachedEntityStatus.CHANGED);
}
@Override
public void removeAnnotation(final Class<? extends AbstractTerm> term) {
this.annotations.remove(term);
attach(AttachedEntityStatus.CHANGED);
}
@Override
public Object getAnnotation(final Class<? extends AbstractTerm> term) {
Object res = null;
@ -458,6 +464,7 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
return res;
}
@Override
public Collection<Class<? extends AbstractTerm>> getAnnotationTerms() {
return getEntity() instanceof ODataEntity
? CoreUtils.getAnnotationTerms(((ODataEntity) getEntity()).getAnnotations())

View File

@ -90,8 +90,7 @@ class EntitySetInvocationHandler<
static EntitySetInvocationHandler getInstance(
final Class<?> ref, final EntityContainerInvocationHandler containerHandler, final String entitySetName) {
final CommonURIBuilder<?> uriBuilder = containerHandler.getClient().
getURIBuilder(containerHandler.getFactory().getServiceRoot());
final CommonURIBuilder<?> uriBuilder = containerHandler.getClient().newURIBuilder();
final StringBuilder entitySetSegment = new StringBuilder();
if (!containerHandler.isDefaultEntityContainer()) {
@ -184,7 +183,7 @@ class EntitySetInvocationHandler<
@Override
public Long count() {
final ODataValueRequest req = client.getRetrieveRequestFactory().
getValueRequest(client.getURIBuilder(this.uri.toASCIIString()).count().build());
getValueRequest(client.newURIBuilder(this.uri.toASCIIString()).count().build());
req.setFormat(ODataValueFormat.TEXT);
return Long.valueOf(req.execute().getBody().asPrimitive().toString());
}
@ -247,7 +246,7 @@ class EntitySetInvocationHandler<
// not yet attached: search against the service
try {
LOG.debug("Search for '{}({})' into the service", typeRef.getSimpleName(), key);
final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(this.uri.toASCIIString());
final CommonURIBuilder<?> uriBuilder = client.newURIBuilder(this.uri.toASCIIString());
if (key.getClass().getAnnotation(CompoundKey.class) == null) {
LOG.debug("Append key segment '{}'", key);
@ -376,7 +375,7 @@ class EntitySetInvocationHandler<
final Class<S> ref = (Class<S>) ClassUtils.extractTypeArg(collTypeRef);
final Class<S> oref = (Class<S>) ClassUtils.extractTypeArg(this.collTypeRef);
final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(this.uri.toASCIIString());
final CommonURIBuilder<?> uriBuilder = client.newURIBuilder(this.uri.toASCIIString());
final URI entitySetURI;
if (oref.equals(ref)) {
@ -463,6 +462,6 @@ class EntitySetInvocationHandler<
@Override
public EntitySetIterator<T, KEY, EC> iterator() {
return new EntitySetIterator<T, KEY, EC>(client.getURIBuilder(this.uri.toASCIIString()).build(), this);
return new EntitySetIterator<T, KEY, EC>(client.newURIBuilder(this.uri.toASCIIString()).build(), this);
}
}

View File

@ -150,7 +150,7 @@ public class FilterImpl<T extends Serializable, EC extends AbstractEntityCollect
@Override
public EC getResult() {
final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(this.baseURI.toASCIIString()).
final CommonURIBuilder<?> uriBuilder = client.newURIBuilder(this.baseURI.toASCIIString()).
appendDerivedEntityTypeSegment(new FullQualifiedName(
ClassUtils.getNamespace(typeRef), ClassUtils.getEntityTypeName(typeRef)).toString());

View File

@ -28,7 +28,6 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.olingo.client.api.uri.CommonURIBuilder;
import org.apache.olingo.client.core.uri.URIUtils;
import org.apache.olingo.commons.api.domain.CommonODataEntity;
import org.apache.olingo.commons.api.domain.ODataOperation;
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
@ -41,7 +40,7 @@ import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.utils.ClassUtils;
class OperationInvocationHandler extends AbstractInvocationHandler implements OperationExecutor {
final class OperationInvocationHandler extends AbstractInvocationHandler implements OperationExecutor {
private static final long serialVersionUID = 2629912294765040027L;
@ -154,8 +153,8 @@ class OperationInvocationHandler extends AbstractInvocationHandler implements Op
edmOperation = container.getActionImport(operation.name()).getUnboundAction();
}
final CommonURIBuilder<?> uriBuilder = getClient().getURIBuilder(this.serviceRoot).
appendOperationCallSegment(URIUtils.operationImportURISegment(container, edmOperation.getName()));
final CommonURIBuilder<?> uriBuilder = getClient().newURIBuilder(this.serviceRoot).
appendOperationCallSegment(edmOperation.getName());
return new AbstractMap.SimpleEntry<URI, EdmOperation>(uriBuilder.build(), edmOperation);
}

View File

@ -75,7 +75,7 @@ public class SearchImpl<T extends Serializable, EC extends AbstractEntityCollect
@Override
public EC getResult() {
final URIBuilder uriBuilder = client.getURIBuilder(this.baseURI.toASCIIString()).
final URIBuilder uriBuilder = client.newURIBuilder(this.baseURI.toASCIIString()).
appendDerivedEntityTypeSegment(new FullQualifiedName(
ClassUtils.getNamespace(typeRef), ClassUtils.getEntityTypeName(typeRef)).toString());

View File

@ -178,7 +178,8 @@ public class EntityContext implements Iterable<AttachedEntity> {
* @return <tt>true</tt> if is attached; <tt>false</tt> otherwise.
*/
public boolean isAttached(final EntityInvocationHandler entity) {
return allAttachedEntities.containsKey(entity)
return entity == null // avoid attach for null entities (coming from complexes created from container ...)
|| allAttachedEntities.containsKey(entity)
|| (entity.getUUID().getKey() != null && searchableEntities.containsKey(entity.getUUID()));
}

View File

@ -43,6 +43,7 @@ import org.apache.olingo.commons.api.domain.CommonODataProperty;
import org.apache.olingo.commons.api.domain.ODataLink;
import org.apache.olingo.commons.api.domain.ODataPrimitiveValue;
import org.apache.olingo.commons.api.domain.ODataValue;
import org.apache.olingo.commons.api.domain.v4.ODataAnnotatable;
import org.apache.olingo.commons.api.domain.v4.ODataAnnotation;
import org.apache.olingo.commons.api.domain.v4.ODataEntity;
import org.apache.olingo.commons.api.domain.v4.ODataEnumValue;
@ -312,7 +313,7 @@ public final class CoreUtils {
public static void addAnnotations(
final CommonEdmEnabledODataClient<?> client,
final Map<Class<? extends AbstractTerm>, Object> annotations,
final ODataEntity entity) {
final ODataAnnotatable annotatable) {
for (Map.Entry<Class<? extends AbstractTerm>, Object> entry : annotations.entrySet()) {
final Namespace nsAnn = entry.getKey().getAnnotation(Namespace.class);
@ -322,7 +323,7 @@ public final class CoreUtils {
if (term == null) {
LOG.error("Could not find term for class {}", entry.getKey().getName());
} else {
entity.getAnnotations().add(getODataAnnotation(
annotatable.getAnnotations().add(getODataAnnotation(
client, term.getFullQualifiedName().toString(), term.getType(), entry.getValue()));
}
}

View File

@ -18,10 +18,14 @@
*#
package ${package};
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.ComplexType;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.Annotatable;
#foreach($ns in $namespaces)
import ${basePackage}.${ns}.*;
import ${basePackage}.${ns}.types.*;

View File

@ -20,6 +20,8 @@
package ${package};
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -28,7 +30,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -63,7 +65,7 @@ import javax.xml.datatype.Duration;
isAbstract = $entityType.Abstract#if($entityType.getBaseType()),
baseType = "$entityType.getBaseType().getFullQualifiedName().toString()"#end)
public interface $utility.capitalize($entityType.Name)
extends AbstractAnnotatable,#if( $entityType.getBaseType() )$utility.getJavaType($entityType.getBaseType())#{elseif}( $entityType.isOpenType() )AbstractOpenType#{else}Serializable#end {
extends Annotatable,#if( $entityType.getBaseType() )$utility.getJavaType($entityType.getBaseType())#{elseif}( $entityType.isOpenType() )AbstractOpenType#{else}Serializable#end {
#set( $keys = [] )
#foreach($key in $entityType.KeyPropertyRefs)
@ -198,5 +200,31 @@ public interface $utility.capitalize($entityType.Name)
#end
}
#end
#end
#if( $entityType.baseType )
@Override
#end
Annotations annotations();
interface Annotations #if( $entityType.baseType )
extends ${utility.getJavaType($entityType.getBaseType())}.Annotations#end{
#foreach($propertyName in $entityType.PropertyNames)
#set($property = $entityType.getProperty($propertyName))
@AnnotationsForProperty(name = "$property.Name",
type = "$property.Type.FullQualifiedName.toString()")
Annotatable get$utility.capitalize($property.Name)Annotations();
#end
#foreach($propertyName in $entityType.NavigationPropertyNames)
#set($property = $entityType.getNavigationProperty($propertyName))
#set($type = $utility.getNavigationType($property))
@AnnotationsForNavigationProperty(name = "$property.Name",
type = "$type")
Annotatable get$utility.capitalize($property.Name)Annotations();
#end
}
}

View File

@ -22,7 +22,7 @@
isAbstract = $complexType.Abstract#if($complexType.getBaseType()),
baseType = "$complexType.getBaseType().getFullQualifiedName().toString()"#end)
public interface $utility.capitalize($complexType.Name)
extends #if($complexType.getBaseType())$utility.getJavaType($complexType.getBaseType().getFullQualifiedName().toString())#{else}Serializable#end {
extends #if($complexType.getBaseType())$utility.getJavaType($complexType.getBaseType().getFullQualifiedName().toString()),#{end}#if( $complexType.isOpenType() )AbstractOpenType,#{end}Serializable {
#set( $complexProps = [] )
#foreach($propertyName in $complexType.PropertyNames)
@ -81,3 +81,29 @@ public interface $utility.capitalize($complexType.Name)
#end
}
#end
#if( $complexType.baseType )
@Override
#end
Annotations annotations();
interface Annotations #if( $complexType.baseType )
extends ${utility.getJavaType($complexType.getBaseType())}.Annotations#end{
#foreach($propertyName in $complexType.PropertyNames)
#set($property = $complexType.getProperty($propertyName))
@AnnotationsForProperty(name = "$property.Name",
type = "$property.Type.FullQualifiedName.toString()")
Annotatable get$utility.capitalize($property.Name)Annotations();
#end
#foreach($propertyName in $complexType.NavigationPropertyNames)
#set($property = $complexType.getNavigationProperty($propertyName))
#set($type = $utility.getNavigationType($property))
@AnnotationsForNavigationProperty(name = "$property.Name",
type = "$type")
Annotatable get$utility.capitalize($property.Name)Annotations();
#end
}

View File

@ -39,5 +39,6 @@
<module>client-core-android</module>
<module>pojogen-maven-plugin</module>
<module>client-proxy</module>
<module>client-proxy-android</module>
</modules>
</project>

View File

@ -188,7 +188,7 @@ public abstract class AbstractServices {
protected Response getMetadata(final String filename) {
try {
return xml.createResponse(null, FSManager.instance(version).readFile(filename, Accept.XML), null, Accept.XML);
return xml.createResponse(null, FSManager.instance(version).readRes(filename, Accept.XML), null, Accept.XML);
} catch (Exception e) {
return xml.createFaultResponse(Accept.XML.toString(version), e);
}
@ -1306,10 +1306,9 @@ public abstract class AbstractServices {
@PathParam("entityId") String entityId) {
try {
final String basePath =
entitySetName + File.separatorChar + Commons.getEntityKey(entityId) + File.separatorChar;
final String basePath = entitySetName + File.separatorChar + Commons.getEntityKey(entityId);
FSManager.instance(version).deleteFile(basePath + Constants.get(version, ConstantKey.ENTITY));
FSManager.instance(version).deleteEntity(basePath);
return xml.createResponse(null, null, null, null, Response.Status.NO_CONTENT);
} catch (Exception e) {

View File

@ -51,7 +51,7 @@ import org.springframework.stereotype.Service;
public class V3ActionOverloading extends V3Services {
public V3ActionOverloading() throws Exception {
super(new Metadata(FSManager.instance(ODataServiceVersion.V30).readFile(
super(new Metadata(FSManager.instance(ODataServiceVersion.V30).readRes(
"actionOverloading" + StringUtils.capitalize(Constants.get(ODataServiceVersion.V30, ConstantKey.METADATA)),
Accept.XML), ODataServiceVersion.V30));
}

View File

@ -55,7 +55,7 @@ public class V3OpenType extends V3Services {
public V3OpenType() throws Exception {
super(new Metadata(FSManager.instance(ODataServiceVersion.V30).
readFile("openType" + StringUtils.capitalize(Constants.get(ODataServiceVersion.V30, ConstantKey.METADATA)),
readRes("openType" + StringUtils.capitalize(Constants.get(ODataServiceVersion.V30, ConstantKey.METADATA)),
Accept.XML), ODataServiceVersion.V30));
}

View File

@ -47,7 +47,7 @@ public class V3PrimitiveKeys extends V3Services {
public Response getMetadata() {
try {
return xml.createResponse(
null, FSManager.instance(version).readFile("primitiveKeysMetadata", Accept.XML), null, Accept.XML);
null, FSManager.instance(version).readRes("primitiveKeysMetadata", Accept.XML), null, Accept.XML);
} catch (Exception e) {
return xml.createFaultResponse(Accept.XML.toString(version), e);
}

View File

@ -52,7 +52,7 @@ public class V4Demo extends V4Services {
public V4Demo() throws Exception {
super(new Metadata(FSManager.instance(ODataServiceVersion.V40).
readFile("demo" + StringUtils.capitalize(Constants.get(ODataServiceVersion.V40, ConstantKey.METADATA)),
readRes("demo" + StringUtils.capitalize(Constants.get(ODataServiceVersion.V40, ConstantKey.METADATA)),
Accept.XML), ODataServiceVersion.V40));
}

View File

@ -51,7 +51,7 @@ public class V4OpenType extends V4Services {
public V4OpenType() throws Exception {
super(new Metadata(FSManager.instance(ODataServiceVersion.V40).
readFile("openType" + StringUtils.capitalize(Constants.get(ODataServiceVersion.V40, ConstantKey.METADATA)),
readRes("openType" + StringUtils.capitalize(Constants.get(ODataServiceVersion.V40, ConstantKey.METADATA)),
Accept.XML), ODataServiceVersion.V40));
}

View File

@ -293,7 +293,7 @@ public class V4Services extends AbstractServices {
addChangesetItemIntro(chbos, lastContebtID, cboundary);
res = bodyPartRequest(new MimeBodyPart(part.getInputStream()), references);
if (res==null || res.getStatus() >= 400) {
if (res == null || res.getStatus() >= 400) {
throw new Exception("Failure processing changeset");
}
@ -457,7 +457,7 @@ public class V4Services extends AbstractServices {
}
@GET
@Path("/Company/Microsoft.Test.OData.Services.ODataWCFService.GetEmployeesCount")
@Path("/Company/Microsoft.Test.OData.Services.ODataWCFService.GetEmployeesCount{paren:[\\(\\)]*}")
public Response functionGetEmployeesCount(
@HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
@QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
@ -488,7 +488,7 @@ public class V4Services extends AbstractServices {
}
@POST
@Path("/Company/Microsoft.Test.OData.Services.ODataWCFService.IncreaseRevenue")
@Path("/Company/Microsoft.Test.OData.Services.ODataWCFService.IncreaseRevenue{paren:[\\(\\)]*}")
public Response actionIncreaseRevenue(
@HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
@HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
@ -562,7 +562,7 @@ public class V4Services extends AbstractServices {
}
@POST
@Path("/Products({entityId})/Microsoft.Test.OData.Services.ODataWCFService.AddAccessRight")
@Path("/Products({entityId})/Microsoft.Test.OData.Services.ODataWCFService.AddAccessRight{paren:[\\(\\)]*}")
public Response actionAddAccessRight(
@HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
@HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
@ -583,11 +583,16 @@ public class V4Services extends AbstractServices {
assert 1 == entry.getProperties().size();
assert entry.getProperty("accessRight") != null;
entry.getProperty("accessRight").setType("Microsoft.Test.OData.Services.ODataWCFService.AccessLevel");
final Property property = entry.getProperty("accessRight");
property.setType("Microsoft.Test.OData.Services.ODataWCFService.AccessLevel");
final ResWrap<AtomPropertyImpl> result = new ResWrap<AtomPropertyImpl>(
URI.create(Constants.get(version, ConstantKey.ODATA_METADATA_PREFIX) + property.getType()),
null, (AtomPropertyImpl) property);
return xml.createResponse(
null,
xml.writeProperty(acceptType, entry.getProperty("accessRight")),
xml.writeProperty(acceptType, result),
null,
acceptType);
} catch (Exception e) {
@ -596,7 +601,7 @@ public class V4Services extends AbstractServices {
}
@POST
@Path("/Customers(PersonID={personId})/Microsoft.Test.OData.Services.ODataWCFService.ResetAddress")
@Path("/Customers(PersonID={personId})/Microsoft.Test.OData.Services.ODataWCFService.ResetAddress{paren:[\\(\\)]*}")
public Response actionResetAddress(
@Context UriInfo uriInfo,
@HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
@ -622,7 +627,7 @@ public class V4Services extends AbstractServices {
@GET
@Path("/ProductDetails(ProductID={productId},ProductDetailID={productDetailId})"
+ "/Microsoft.Test.OData.Services.ODataWCFService.GetRelatedProduct")
+ "/Microsoft.Test.OData.Services.ODataWCFService.GetRelatedProduct{paren:[\\(\\)]*}")
public Response functionGetRelatedProduct(
@Context UriInfo uriInfo,
@HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
@ -634,11 +639,12 @@ public class V4Services extends AbstractServices {
}
@POST
@Path("/Accounts(101)/Microsoft.Test.OData.Services.ODataWCFService.RefreshDefaultPI")
@Path("/Accounts({entityId})/Microsoft.Test.OData.Services.ODataWCFService.RefreshDefaultPI{paren:[\\(\\)]*}")
public Response actionRefreshDefaultPI(
@Context UriInfo uriInfo,
@HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
@HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
@PathParam("entityId") String entityId,
@QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
final String param) {
@ -649,23 +655,24 @@ public class V4Services extends AbstractServices {
assert 1 == entry.getProperties().size();
assert entry.getProperty("newDate") != null;
return functionGetDefaultPI(accept, format);
return functionGetDefaultPI(accept, entityId, format);
} catch (Exception e) {
return xml.createFaultResponse(accept, e);
}
}
@GET
@Path("/Accounts(101)/Microsoft.Test.OData.Services.ODataWCFService.GetDefaultPI")
@Path("/Accounts({entityId})/Microsoft.Test.OData.Services.ODataWCFService.GetDefaultPI{paren:[\\(\\)]*}")
public Response functionGetDefaultPI(
@HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
@PathParam("entityId") String entityId,
@QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
return getContainedEntity(accept, "101", "MyPaymentInstruments", "101901", format);
return getContainedEntity(accept, entityId, "MyPaymentInstruments", entityId+ "901", format);
}
@GET
@Path("/Accounts({entityId})/Microsoft.Test.OData.Services.ODataWCFService.GetAccountInfo")
@Path("/Accounts({entityId})/Microsoft.Test.OData.Services.ODataWCFService.GetAccountInfo{paren:[\\(\\)]*}")
public Response functionGetAccountInfo(
@HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
@PathParam("entityId") String entityId,
@ -1317,4 +1324,26 @@ public class V4Services extends AbstractServices {
return xml.createFaultResponse(accept, e);
}
}
@POST
@Path("/Products({productId})/Categories/$ref")
public Response createLinked(
@HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
@HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
@QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
final String entity) {
return xml.createResponse(null, null, null, Status.NO_CONTENT);
}
@DELETE
@Path("/Products({productId})/Categories({categoryId})/$ref")
public Response deleteLinked(
@HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
@HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
@QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
final String entity) {
return xml.createResponse(null, null, null, Status.NO_CONTENT);
}
}

View File

@ -42,7 +42,7 @@ public class V4Vocabularies {
private final XMLUtilities xml;
public V4Vocabularies() throws Exception {
this.metadata = new Metadata(FSManager.instance(ODataServiceVersion.V40).readFile(
this.metadata = new Metadata(FSManager.instance(ODataServiceVersion.V40).readRes(
"vocabularies-" + Constants.get(ODataServiceVersion.V40, ConstantKey.METADATA), Accept.XML),
ODataServiceVersion.V40);
this.xml = new XMLUtilities(ODataServiceVersion.V40, metadata);
@ -55,7 +55,7 @@ public class V4Vocabularies {
try {
return xml.createResponse(
null,
FSManager.instance(ODataServiceVersion.V40).readFile(
FSManager.instance(ODataServiceVersion.V40).readRes(
"vocabularies-" + Constants.get(ODataServiceVersion.V40, ConstantKey.METADATA), Accept.XML),
null,
Accept.XML);

View File

@ -89,6 +89,7 @@ public class DataBinder {
public JSONEntityImpl toJSONEntity(final AtomEntityImpl atomEntity) {
final JSONEntityImpl jsonEntity = new JSONEntityImpl();
jsonEntity.getAnnotations().addAll(atomEntity.getAnnotations());
BeanUtils.copyProperties(atomEntity, jsonEntity, "baseURI", "properties", "links");
// This shouldn't ever happen, but...
@ -126,6 +127,7 @@ public class DataBinder {
jlink.setTitle(link.getTitle());
jlink.setType(link.getType());
jlink.setRel(link.getRel());
jlink.getAnnotations().addAll(link.getAnnotations());
if (link.getInlineEntity() instanceof AtomEntityImpl) {
final Entity inlineEntity = link.getInlineEntity();
@ -184,6 +186,7 @@ public class DataBinder {
final Link alink = new LinkImpl();
alink.setHref(link.getHref());
alink.setTitle(link.getTitle());
alink.getAnnotations().addAll(link.getAnnotations());
final NavigationProperty navPropDetails =
metadata.getEntityOrComplexType(jsonEntity.getType()).getNavigationProperty(link.getTitle());
@ -218,6 +221,7 @@ public class DataBinder {
if (navProperties.containsKey(property.getName())) {
final Link alink = new LinkImpl();
alink.setTitle(property.getName());
alink.getAnnotations().addAll(property.getAnnotations());
alink.setType(navProperties.get(property.getName()).isEntitySet()
? Constants.get(version, ConstantKey.ATOM_LINK_FEED)
@ -256,22 +260,23 @@ public class DataBinder {
return atomEntity;
}
public JSONPropertyImpl toJSONProperty(final AtomPropertyImpl atomproperty) {
final JSONPropertyImpl jsonproperty = new JSONPropertyImpl();
BeanUtils.copyProperties(atomproperty, jsonproperty, "value");
public JSONPropertyImpl toJSONProperty(final AtomPropertyImpl atomProperty) {
final JSONPropertyImpl jsonProperty = new JSONPropertyImpl();
BeanUtils.copyProperties(atomProperty, jsonProperty, "value");
jsonProperty.getAnnotations().addAll(atomProperty.getAnnotations());
if (atomproperty.getValue().isComplex()) {
if (atomProperty.getValue().isComplex()) {
final ComplexValueImpl complex = new ComplexValueImpl();
jsonproperty.setValue(complex);
jsonProperty.setValue(complex);
for (Property field : atomproperty.getValue().asComplex().get()) {
for (Property field : atomProperty.getValue().asComplex().get()) {
complex.get().add(toJSONProperty((AtomPropertyImpl) field));
}
} else if (atomproperty.getValue().isCollection()) {
} else if (atomProperty.getValue().isCollection()) {
final CollectionValueImpl collection = new CollectionValueImpl();
jsonproperty.setValue(collection);
jsonProperty.setValue(collection);
for (Value element : atomproperty.getValue().asCollection().get()) {
for (Value element : atomProperty.getValue().asCollection().get()) {
if (element.isComplex()) {
final ComplexValueImpl complex = new ComplexValueImpl();
collection.get().add(complex);
@ -284,15 +289,16 @@ public class DataBinder {
}
}
} else {
jsonproperty.setValue(atomproperty.getValue());
jsonProperty.setValue(atomProperty.getValue());
}
return jsonproperty;
return jsonProperty;
}
public AtomPropertyImpl toAtomProperty(final JSONPropertyImpl jsonProperty, final String entryType) {
final AtomPropertyImpl atomproperty = new AtomPropertyImpl();
atomproperty.setName(jsonProperty.getName());
final AtomPropertyImpl atomProperty = new AtomPropertyImpl();
atomProperty.setName(jsonProperty.getName());
atomProperty.getAnnotations().addAll(jsonProperty.getAnnotations());
final EntityType entityType = entryType == null
? null
@ -304,21 +310,21 @@ public class DataBinder {
|| jsonProperty.getName() == null
|| !jsonProperty.getType().startsWith(EdmPrimitiveType.EDM_NAMESPACE))) {
atomproperty.setType(jsonProperty.getType());
atomProperty.setType(jsonProperty.getType());
} else if (entityType != null) {
atomproperty.setType(entityType.getProperty(jsonProperty.getName()).getType());
atomProperty.setType(entityType.getProperty(jsonProperty.getName()).getType());
}
if (jsonProperty.getValue().isComplex()) {
final ComplexValueImpl complex = new ComplexValueImpl();
atomproperty.setValue(complex);
atomProperty.setValue(complex);
for (Property field : jsonProperty.getValue().asComplex().get()) {
complex.get().add(toAtomProperty((JSONPropertyImpl) field, atomproperty.getType()));
complex.get().add(toAtomProperty((JSONPropertyImpl) field, atomProperty.getType()));
}
} else if (jsonProperty.getValue().isCollection()) {
final CollectionValueImpl collection = new CollectionValueImpl();
atomproperty.setValue(collection);
atomProperty.setValue(collection);
for (Value element : jsonProperty.getValue().asCollection().get()) {
if (element instanceof ComplexValueImpl) {
@ -326,16 +332,16 @@ public class DataBinder {
collection.get().add(complex);
for (Property field : element.asComplex().get()) {
complex.get().add(toAtomProperty((JSONPropertyImpl) field, atomproperty.getType()));
complex.get().add(toAtomProperty((JSONPropertyImpl) field, atomProperty.getType()));
}
} else {
collection.get().add(element);
}
}
} else {
atomproperty.setValue(jsonProperty.getValue());
atomProperty.setValue(jsonProperty.getValue());
}
return atomproperty;
return atomProperty;
}
}

View File

@ -35,6 +35,7 @@ import org.apache.commons.vfs2.FileSelectInfo;
import org.apache.commons.vfs2.FileSelector;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.commons.vfs2.FileSystemManager;
import org.apache.commons.vfs2.FileType;
import org.apache.commons.vfs2.VFS;
import org.apache.olingo.commons.api.data.ResWrap;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
@ -72,6 +73,18 @@ public class FSManager {
private FSManager(final ODataServiceVersion version) throws Exception {
this.version = version;
fsManager = VFS.getManager();
final FileObject basePath = fsManager.resolveFile(RES_PREFIX + File.separatorChar + version.name());
final String absoluteBaseFolder = basePath.getURL().getPath();
for (FileObject fo : find(basePath, null)) {
if (fo.getType() == FileType.FILE
&& !fo.getName().getBaseName().contains("Metadata")
&& !fo.getName().getBaseName().contains("metadata")) {
final String path = fo.getURL().getPath().replace(absoluteBaseFolder, "//" + version.name());
putInMemory(fo.getContent().getInputStream(), path);
}
}
}
public String getAbsolutePath(final String relativePath, final Accept accept) {
@ -79,7 +92,7 @@ public class FSManager {
+ (accept == null ? "" : accept.getExtension());
}
public FileObject putInMemory(final InputStream is, final String path) throws IOException {
public final FileObject putInMemory(final InputStream is, final String path) throws IOException {
LOG.info("Write in memory {}", path);
final FileObject memObject = fsManager.resolveFile(MEM_PREFIX + path);
@ -116,9 +129,9 @@ public class FSManager {
final ObjectMapper mapper = Commons.getJSONMapper(version);
mapper.writeValue(
writer, new JSONEntryContainer(
container.getContextURL(),
container.getMetadataETag(),
dataBinder.toJSONEntity(container.getPayload())));
container.getContextURL(),
container.getMetadataETag(),
dataBinder.toJSONEntity(container.getPayload())));
putInMemory(new ByteArrayInputStream(content.toByteArray()), getAbsolutePath(relativePath, Accept.JSON_FULLMETA));
} catch (Exception e) {
@ -126,29 +139,27 @@ public class FSManager {
}
}
public InputStream readFile(final String relativePath) {
return readFile(relativePath, null);
public InputStream readRes(final String relativePath, final Accept accept) {
return readFile(relativePath, accept, RES_PREFIX);
}
public InputStream readFile(final String relativePath, final Accept accept) {
return readFile(relativePath, accept, MEM_PREFIX);
}
public InputStream readFile(final String relativePath) {
return readFile(relativePath, null, MEM_PREFIX);
}
private InputStream readFile(final String relativePath, final Accept accept, final String fs) {
final String path = getAbsolutePath(relativePath, accept);
LOG.info("Read {}", path);
LOG.info("Read {}{}", fs, path);
try {
FileObject fileObject = fsManager.resolveFile(MEM_PREFIX + path);
final FileObject fileObject = fsManager.resolveFile(fs + path);
if (!fileObject.exists()) {
LOG.warn("In-memory path '{}' not found", path);
try {
fileObject = fsManager.resolveFile(RES_PREFIX + path);
fileObject = putInMemory(fileObject.getContent().getInputStream(), path);
} catch (FileSystemException fse) {
LOG.warn("Resource path '{}' not found", path, fse);
}
}
if (!fileObject.exists()) {
throw new NotFoundException();
}
@ -176,12 +187,33 @@ public class FSManager {
}
}
public FileObject resolve(final String path) throws FileSystemException {
FileObject res = fsManager.resolveFile(MEM_PREFIX + path);
public void deleteEntity(final String relativePath) {
final String path = getAbsolutePath(relativePath, null);
LOG.info("Delete {}", path);
if (!res.exists()) {
res = fsManager.resolveFile(RES_PREFIX + path);
try {
final FileObject fileObject = fsManager.resolveFile(MEM_PREFIX + path);
if (fileObject.exists()) {
fileObject.delete(new FileSelector() {
@Override
public boolean includeFile(final FileSelectInfo fileInfo) throws Exception {
return true;
}
@Override
public boolean traverseDescendents(final FileSelectInfo fileInfo) throws Exception {
return true;
}
});
}
} catch (IOException ignore) {
// ignore exception
}
}
public FileObject resolve(final String path) throws FileSystemException {
final FileObject res = fsManager.resolveFile(MEM_PREFIX + path);
if (!res.exists()) {
throw new FileSystemException("Unresolved path " + path);
@ -190,11 +222,11 @@ public class FSManager {
return res;
}
public FileObject[] findByExtension(final FileObject fo, final String ext) throws FileSystemException {
public final FileObject[] find(final FileObject fo, final String ext) throws FileSystemException {
return fo.findFiles(new FileSelector() {
@Override
public boolean includeFile(final FileSelectInfo fileInfo) throws Exception {
return fileInfo.getFile().getName().getExtension().equals(ext);
return ext == null ? true : fileInfo.getFile().getName().getExtension().equals(ext);
}
@Override

View File

@ -598,7 +598,7 @@ public class XMLUtilities extends AbstractUtilities {
try {
final FileObject skipToken = fsManager.resolve(skipTokenDirPath);
final FileObject[] files = fsManager.findByExtension(skipToken, Accept.XML.getExtension().substring(1));
final FileObject[] files = fsManager.find(skipToken, Accept.XML.getExtension().substring(1));
for (FileObject file : files) {
count += countFeedElements(fsManager.readFile(

View File

@ -0,0 +1,34 @@
{
"@odata.context": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#Accounts/$entity",
"@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.Account",
"@odata.id": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)",
"@odata.editLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)",
"AccountID": 102,
"Country": "US",
"AccountInfo": {
"@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.AccountInfo",
"FirstName": "Alex",
"LastName": "Green",
"MiddleName": "Hood"
},
"MyGiftCard@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyGiftCard/$ref",
"MyGiftCard@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyGiftCard",
"MyPaymentInstruments@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments/$ref",
"MyPaymentInstruments@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments",
"ActiveSubscriptions@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/ActiveSubscriptions/$ref",
"ActiveSubscriptions@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/ActiveSubscriptions",
"AvailableSubscriptionTemplatess@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/AvailableSubscriptionTemplatess/$ref",
"AvailableSubscriptionTemplatess@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/AvailableSubscriptionTemplatess",
"#Microsoft.Test.OData.Services.ODataWCFService.RefreshDefaultPI": {
"title": "Microsoft.Test.OData.Services.ODataWCFService.RefreshDefaultPI",
"target": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/Microsoft.Test.OData.Services.ODataWCFService.RefreshDefaultPI"
},
"#Microsoft.Test.OData.Services.ODataWCFService.GetDefaultPI": {
"title": "Microsoft.Test.OData.Services.ODataWCFService.GetDefaultPI",
"target": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/Microsoft.Test.OData.Services.ODataWCFService.GetDefaultPI"
},
"#Microsoft.Test.OData.Services.ODataWCFService.GetAccountInfo": {
"title": "Microsoft.Test.OData.Services.ODataWCFService.GetAccountInfo",
"target": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/Microsoft.Test.OData.Services.ODataWCFService.GetAccountInfo"
}
}

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<entry xml:base="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://docs.oasis-open.org/odata/ns/data" xmlns:m="http://docs.oasis-open.org/odata/ns/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:context="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#Accounts/$entity">
<id>http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)</id>
<category term="#Microsoft.Test.OData.Services.ODataWCFService.Account" scheme="http://docs.oasis-open.org/odata/ns/scheme"/>
<link rel="edit" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/MyGiftCard" type="application/atom+xml;type=entry" title="MyGiftCard" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyGiftCard"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/MyPaymentInstruments" type="application/atom+xml;type=feed" title="MyPaymentInstruments" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/ActiveSubscriptions" type="application/atom+xml;type=feed" title="ActiveSubscriptions" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/ActiveSubscriptions"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/AvailableSubscriptionTemplatess" type="application/atom+xml;type=feed" title="AvailableSubscriptionTemplatess" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/AvailableSubscriptionTemplatess"/>
<title/>
<updated>2014-04-14T12:45:00Z</updated>
<author>
<name/>
</author>
<m:action metadata="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#Microsoft.Test.OData.Services.ODataWCFService.RefreshDefaultPI"
title="Microsoft.Test.OData.Services.ODataWCFService.RefreshDefaultPI"
target="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/Microsoft.Test.OData.Services.ODataWCFService.RefreshDefaultPI"/>
<m:action metadata="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#Microsoft.Test.OData.Services.ODataWCFService.GetDefaultPI"
title="Microsoft.Test.OData.Services.ODataWCFService.GetDefaultPI"
target="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/Microsoft.Test.OData.Services.ODataWCFService.GetDefaultPI"/>
<m:action metadata="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#Microsoft.Test.OData.Services.ODataWCFService.GetAccountInfo"
title="Microsoft.Test.OData.Services.ODataWCFService.GetAccountInfo"
target="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/Microsoft.Test.OData.Services.ODataWCFService.GetAccountInfo"/>
<content type="application/xml">
<m:properties>
<d:AccountID m:type="Int32">102</d:AccountID>
<d:Country>US</d:Country>
<d:AccountInfo m:type="#Microsoft.Test.OData.Services.ODataWCFService.AccountInfo">
<d:FirstName>Alex</d:FirstName>
<d:LastName>Green</d:LastName>
<d:MiddleName>Hood</d:MiddleName>
</d:AccountInfo>
</m:properties>
</content>
</entry>

View File

@ -0,0 +1,15 @@
{
"@odata.context": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#Accounts(102)/MyGiftCard/$entity",
"@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.GiftCard",
"@odata.id": "Accounts(102)/MyGiftCard",
"@odata.editLink": "Accounts(102)/MyGiftCard",
"GiftCardID": 301,
"GiftCardNO": "AAA123A",
"Amount": 19.9,
"ExperationDate@odata.type": "#DateTimeOffset",
"ExperationDate": "2013-12-30T00:00:00Z",
"#Microsoft.Test.OData.Services.ODataWCFService.GetActualAmount": {
"title": "Microsoft.Test.OData.Services.ODataWCFService.GetActualAmount",
"target": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyGiftCard/Microsoft.Test.OData.Services.ODataWCFService.GetActualAmount"
}
}

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<entry xml:base="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://docs.oasis-open.org/odata/ns/data" xmlns:m="http://docs.oasis-open.org/odata/ns/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:context="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#Accounts(102)/MyGiftCard/$entity">
<category term="#Microsoft.Test.OData.Services.ODataWCFService.GiftCard" scheme="http://docs.oasis-open.org/odata/ns/scheme" />
<id />
<title />
<updated>2014-04-23T13:48:48Z</updated>
<author>
<name />
</author>
<m:action metadata="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#Microsoft.Test.OData.Services.ODataWCFService.GetActualAmount"
title="Microsoft.Test.OData.Services.ODataWCFService.GetActualAmount"
target="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyGiftCard/Microsoft.Test.OData.Services.ODataWCFService.GetActualAmount"/>
<content type="application/xml">
<m:properties>
<d:GiftCardID m:type="Int32">301</d:GiftCardID>
<d:GiftCardNO>AAA123A</d:GiftCardNO>
<d:Amount m:type="Double">19.9</d:Amount>
<d:ExperationDate m:type="DateTimeOffset">2013-12-30T00:00:00Z</d:ExperationDate>
</m:properties>
</content>
</entry>

View File

@ -0,0 +1,16 @@
{
"@odata.context": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#Accounts(102)/MyPaymentInstruments/$entity",
"@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument",
"@odata.id": "Accounts(102)/MyPaymentInstruments(102901)",
"@odata.editLink": "Accounts(102)/MyPaymentInstruments(102901)",
"PaymentInstrumentID": 102901,
"FriendlyName": "102 first PI",
"CreatedDate@odata.type": "#DateTimeOffset",
"CreatedDate": "2014-04-09T00:00:00Z",
"TheStoredPI@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/TheStoredPI/$ref",
"TheStoredPI@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/TheStoredPI",
"BillingStatements@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/BillingStatements/$ref",
"BillingStatements@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/BillingStatements",
"BackupStoredPI@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/BackupStoredPI/$ref",
"BackupStoredPI@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/BackupStoredPI"
}

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<entry xml:base="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://docs.oasis-open.org/odata/ns/data" xmlns:m="http://docs.oasis-open.org/odata/ns/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:context="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#Accounts(102)/MyPaymentInstruments/$entity">
<category term="#Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument" scheme="http://docs.oasis-open.org/odata/ns/scheme"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/TheStoredPI" type="application/atom+xml;type=entry" title="TheStoredPI" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/TheStoredPI"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/BillingStatements" type="application/atom+xml;type=feed" title="BillingStatements" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/BillingStatements"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/BackupStoredPI" type="application/atom+xml;type=entry" title="BackupStoredPI" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/BackupStoredPI"/>
<id/>
<title/>
<updated>2014-04-14T12:47:37Z</updated>
<author>
<name/>
</author>
<content type="application/xml">
<m:properties>
<d:PaymentInstrumentID m:type="Int32">102901</d:PaymentInstrumentID>
<d:FriendlyName>102 first PI</d:FriendlyName>
<d:CreatedDate m:type="DateTimeOffset">2014-04-09T00:00:00Z</d:CreatedDate>
</m:properties>
</content>
</entry>

View File

@ -0,0 +1,16 @@
{
"@odata.context": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#Accounts(102)/MyPaymentInstruments/$entity",
"@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument",
"@odata.id": "Accounts(102)/MyPaymentInstruments(102902)",
"@odata.editLink": "Accounts(102)/MyPaymentInstruments(102902)",
"PaymentInstrumentID": 102902,
"FriendlyName": "102 first PI",
"CreatedDate@odata.type": "#DateTimeOffset",
"CreatedDate": "2014-04-09T00:00:00Z",
"TheStoredPI@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/TheStoredPI/$ref",
"TheStoredPI@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/TheStoredPI",
"BillingStatements@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/BillingStatements/$ref",
"BillingStatements@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/BillingStatements",
"BackupStoredPI@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/BackupStoredPI/$ref",
"BackupStoredPI@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/BackupStoredPI"
}

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<entry xml:base="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://docs.oasis-open.org/odata/ns/data" xmlns:m="http://docs.oasis-open.org/odata/ns/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:context="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#Accounts(102)/MyPaymentInstruments/$entity">
<category term="#Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument" scheme="http://docs.oasis-open.org/odata/ns/scheme"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/TheStoredPI" type="application/atom+xml;type=entry" title="TheStoredPI" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/TheStoredPI"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/BillingStatements" type="application/atom+xml;type=feed" title="BillingStatements" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/BillingStatements"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/BackupStoredPI" type="application/atom+xml;type=entry" title="BackupStoredPI" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/BackupStoredPI"/>
<id/>
<title/>
<updated>2014-04-14T12:47:37Z</updated>
<author>
<name/>
</author>
<content type="application/xml">
<m:properties>
<d:PaymentInstrumentID m:type="Int32">102902</d:PaymentInstrumentID>
<d:FriendlyName>102 first PI</d:FriendlyName>
<d:CreatedDate m:type="DateTimeOffset">2014-04-09T00:00:00Z</d:CreatedDate>
</m:properties>
</content>
</entry>

View File

@ -0,0 +1,62 @@
{
"@odata.context": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#Accounts(102)/MyPaymentInstruments",
"value": [{
"@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument",
"@odata.id": "Accounts(102)/MyPaymentInstruments(102901)",
"@odata.editLink": "Accounts(102)/MyPaymentInstruments(102901)",
"PaymentInstrumentID": 102901,
"FriendlyName": "102 first PI",
"CreatedDate@odata.type": "#DateTimeOffset",
"CreatedDate": "2014-04-09T00:00:00Z",
"TheStoredPI@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/TheStoredPI/$ref",
"TheStoredPI@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/TheStoredPI",
"BillingStatements@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/BillingStatements/$ref",
"BillingStatements@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/BillingStatements",
"BackupStoredPI@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/BackupStoredPI/$ref",
"BackupStoredPI@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/BackupStoredPI"
}, {
"@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI",
"@odata.id": "Accounts(102)/MyPaymentInstruments(102902)",
"@odata.editLink": "Accounts(102)/MyPaymentInstruments(102902)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI",
"PaymentInstrumentID": 102902,
"FriendlyName": "102 frist credit PI",
"CreatedDate@odata.type": "#DateTimeOffset",
"CreatedDate": "2012-11-01T00:00:00Z",
"CardNumber": "6000000000000000",
"CVV": "234",
"HolderName": "Alex",
"Balance": 100.0,
"ExperationDate@odata.type": "#DateTimeOffset",
"ExperationDate": "2022-11-01T00:00:00Z",
"TheStoredPI@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/TheStoredPI/$ref",
"TheStoredPI@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/TheStoredPI",
"BillingStatements@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/BillingStatements/$ref",
"BillingStatements@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/BillingStatements",
"BackupStoredPI@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/BackupStoredPI/$ref",
"BackupStoredPI@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/BackupStoredPI",
"CreditRecords@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/CreditRecords/$ref",
"CreditRecords@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/CreditRecords"
}, {
"@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI",
"@odata.id": "Accounts(102)/MyPaymentInstruments(102903)",
"@odata.editLink": "Accounts(102)/MyPaymentInstruments(102903)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI",
"PaymentInstrumentID": 102903,
"FriendlyName": "102 second credit PI",
"CreatedDate@odata.type": "#DateTimeOffset",
"CreatedDate": "2012-11-01T00:00:00Z",
"CardNumber": "8000000000000000",
"CVV": "012",
"HolderName": "James",
"Balance": 300.0,
"ExperationDate@odata.type": "#DateTimeOffset",
"ExperationDate": "2022-10-02T00:00:00Z",
"TheStoredPI@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102903)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/TheStoredPI/$ref",
"TheStoredPI@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102903)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/TheStoredPI",
"BillingStatements@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102903)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/BillingStatements/$ref",
"BillingStatements@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102903)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/BillingStatements",
"BackupStoredPI@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102903)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/BackupStoredPI/$ref",
"BackupStoredPI@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102903)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/BackupStoredPI",
"CreditRecords@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102903)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/CreditRecords/$ref",
"CreditRecords@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102903)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/CreditRecords"
}]
}

View File

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<feed xml:base="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://docs.oasis-open.org/odata/ns/data" xmlns:m="http://docs.oasis-open.org/odata/ns/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:context="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#Accounts(102)/MyPaymentInstruments">
<id>http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/MyPaymentInstruments</id>
<title/>
<updated>2014-04-14T12:45:33Z</updated>
<entry>
<category term="#Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument" scheme="http://docs.oasis-open.org/odata/ns/scheme"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/TheStoredPI" type="application/atom+xml;type=entry" title="TheStoredPI" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/TheStoredPI"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/BillingStatements" type="application/atom+xml;type=feed" title="BillingStatements" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/BillingStatements"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/BackupStoredPI" type="application/atom+xml;type=entry" title="BackupStoredPI" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102901)/BackupStoredPI"/>
<id/>
<title/>
<updated>2014-04-14T12:45:33Z</updated>
<author>
<name/>
</author>
<content type="application/xml">
<m:properties>
<d:PaymentInstrumentID m:type="Int32">102901</d:PaymentInstrumentID>
<d:FriendlyName>102 first PI</d:FriendlyName>
<d:CreatedDate m:type="DateTimeOffset">2014-04-09T00:00:00Z</d:CreatedDate>
</m:properties>
</content>
</entry>
<entry>
<category term="#Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI" scheme="http://docs.oasis-open.org/odata/ns/scheme"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/TheStoredPI" type="application/atom+xml;type=entry" title="TheStoredPI" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/TheStoredPI"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/BillingStatements" type="application/atom+xml;type=feed" title="BillingStatements" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/BillingStatements"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/BackupStoredPI" type="application/atom+xml;type=entry" title="BackupStoredPI" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/BackupStoredPI"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/CreditRecords" type="application/atom+xml;type=feed" title="CreditRecords" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102902)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/CreditRecords"/>
<id/>
<title/>
<updated>2014-04-14T12:45:33Z</updated>
<author>
<name/>
</author>
<content type="application/xml">
<m:properties>
<d:PaymentInstrumentID m:type="Int32">102902</d:PaymentInstrumentID>
<d:FriendlyName>102 frist credit PI</d:FriendlyName>
<d:CreatedDate m:type="DateTimeOffset">2012-11-01T00:00:00Z</d:CreatedDate>
<d:CardNumber>6000000000000000</d:CardNumber>
<d:CVV>234</d:CVV>
<d:HolderName>Alex</d:HolderName>
<d:Balance m:type="Double">100</d:Balance>
<d:ExperationDate m:type="DateTimeOffset">2022-11-01T00:00:00Z</d:ExperationDate>
</m:properties>
</content>
</entry>
<entry>
<category term="#Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI" scheme="http://docs.oasis-open.org/odata/ns/scheme"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/TheStoredPI" type="application/atom+xml;type=entry" title="TheStoredPI" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102903)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/TheStoredPI"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/BillingStatements" type="application/atom+xml;type=feed" title="BillingStatements" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102903)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/BillingStatements"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/BackupStoredPI" type="application/atom+xml;type=entry" title="BackupStoredPI" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102903)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/BackupStoredPI"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/CreditRecords" type="application/atom+xml;type=feed" title="CreditRecords" href="http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Accounts(102)/MyPaymentInstruments(102903)/Microsoft.Test.OData.Services.ODataWCFService.CreditCardPI/CreditRecords"/>
<id/>
<title/>
<updated>2014-04-14T12:45:33Z</updated>
<author>
<name/>
</author>
<content type="application/xml">
<m:properties>
<d:PaymentInstrumentID m:type="Int32">102903</d:PaymentInstrumentID>
<d:FriendlyName>102 second credit PI</d:FriendlyName>
<d:CreatedDate m:type="DateTimeOffset">2012-11-01T00:00:00Z</d:CreatedDate>
<d:CardNumber>8000000000000000</d:CardNumber>
<d:CVV>012</d:CVV>
<d:HolderName>James</d:HolderName>
<d:Balance m:type="Double">300</d:Balance>
<d:ExperationDate m:type="DateTimeOffset">2022-10-02T00:00:00Z</d:ExperationDate>
</m:properties>
</content>
</entry>
</feed>

View File

@ -6,6 +6,7 @@
"@Microsoft.Test.OData.Services.ODataWCFService.IsBoss": true,
"PersonID": 2,
"FirstName": "Jill",
"LastName@Microsoft.Test.OData.Services.ODataWCFService.IsBoss": false,
"LastName": "Jones",
"MiddleName": null,
"HomeAddress": null,
@ -31,6 +32,7 @@
"TimeBetweenLastTwoOrders": "PT0.0000002S",
"Parent@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Parent/$ref",
"Parent@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Parent",
"Orders@Microsoft.Test.OData.Services.ODataWCFService.IsBoss": false,
"Orders@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Orders/$ref",
"Orders@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Orders",
"Company@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Company/$ref",

View File

@ -25,7 +25,9 @@
<link rel="http://docs.oasis-open.org/odata/ns/relatedlinks/Parent" title="Parent" href="http://localhost:9080/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Parent/$ref" type="application/xml"/>
<link rel="http://docs.oasis-open.org/odata/ns/relatedlinks/Orders" title="Orders" href="http://localhost:9080/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Orders/$ref" type="application/xml"/>
<link rel="http://docs.oasis-open.org/odata/ns/relatedlinks/Company" title="Company" href="http://localhost:9080/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Company/$ref" type="application/xml"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/Parent" title="Parent" href="http://localhost:9080/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Parent" type="application/atom+xml;type=entry"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/Parent" title="Parent" href="http://localhost:9080/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Parent" type="application/atom+xml;type=entry">
<m:annotation term="Microsoft.Test.OData.Services.ODataWCFService.IsBoss" m:type="Boolean">false</m:annotation>
</link>
<link rel="http://docs.oasis-open.org/odata/ns/related/Orders" title="Orders" href="http://localhost:9080/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Orders" type="application/atom+xml;type=entry"/>
<link rel="http://docs.oasis-open.org/odata/ns/related/Company" title="Company" href="http://localhost:9080/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Company" type="application/atom+xml;type=entry"/>
<content type="application/xml">
@ -33,6 +35,7 @@
<d:PersonID m:type="Int32">2</d:PersonID>
<d:FirstName>Jill</d:FirstName>
<d:LastName>Jones</d:LastName>
<m:annotation term="Microsoft.Test.OData.Services.ODataWCFService.IsBoss" target="LastName" m:type="Boolean">false</m:annotation>
<d:MiddleName m:null="true"/>
<d:HomeAddress m:null="true"/>
<d:Home m:type="GeographyPoint">

View File

@ -41,6 +41,10 @@
<Property Name="Int" Type="Edm.Int32" Nullable="false"/>
<Property Name="Long" Type="Edm.Int64" Nullable="false"/>
</ComplexType>
<ComplexType Name="AccountInfo" OpenType="true">
<Property Name="FirstName" Type="Edm.String" Nullable="false"/>
<Property Name="LastName" Type="Edm.String" Nullable="false"/>
</ComplexType>
<EntityType Name="Row" OpenType="true">
<Key>
<PropertyRef Name="Id"/>

View File

@ -63,8 +63,6 @@ public abstract class AbstractTestITCase {
protected static String testLargeModelServiceRootURL;
protected static String testAuthServiceRootURL;
protected final EntityContext entityContext = EntityContainerFactory.getContext().entityContext();
protected static EntityContainerFactory<EdmEnabledODataClient> containerFactory;
@ -79,7 +77,6 @@ public abstract class AbstractTestITCase {
testActionOverloadingServiceRootURL = "http://localhost:9080/stub/StaticService/V30/ActionOverloading.svc";
testOpenTypeServiceRootURL = "http://localhost:9080/stub/StaticService/V30/OpenType.svc";
testLargeModelServiceRootURL = "http://localhost:9080/stub/StaticService/V30/Static.svc/large";
testAuthServiceRootURL = "http://localhost:9080/stub/DefaultService.svc";
containerFactory = EntityContainerFactory.getV3(testStaticServiceRootURL);
containerFactory.getClient().getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3;
package org.apache.olingo.fit.proxy.v4;
import static org.junit.Assert.assertNotNull;
@ -24,25 +24,27 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.apache.olingo.client.core.http.BasicAuthHttpClientFactory;
import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.ext.proxy.EntityContainerFactory;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
DefaultContainer;
import static org.apache.olingo.fit.proxy.v4.AbstractTestITCase.containerFactory;
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.InMemoryEntities;
public class AuthEntityRetrieveTestITCase extends EntityRetrieveTestITCase {
public class AuthEntityCreateTestITCase extends EntityCreateTestITCase {
@BeforeClass
public static void setupContaner() {
containerFactory = EntityContainerFactory.getV3(testAuthServiceRootURL);
containerFactory = EntityContainerFactory.getV4(testAuthServiceRootURL);
containerFactory.getClient().getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
containerFactory.getClient().getConfiguration().
setHttpClientFactory(new BasicAuthHttpClientFactory("odatajclient", "odatajclient"));
container = containerFactory.getEntityContainer(DefaultContainer.class);
container = containerFactory.getEntityContainer(InMemoryEntities.class);
assertNotNull(container);
}
@AfterClass
public static void disableBasicAuth() {
containerFactory = EntityContainerFactory.getV3(testStaticServiceRootURL);
container = containerFactory.getEntityContainer(DefaultContainer.class);
containerFactory = EntityContainerFactory.getV4(testStaticServiceRootURL);
container = containerFactory.getEntityContainer(InMemoryEntities.class);
assertNotNull(container);
}
}

View File

@ -18,8 +18,6 @@
*/
package org.apache.olingo.fit.proxy.v4;
import static org.apache.olingo.fit.proxy.v4.AbstractTestITCase.testKeyAsSegmentServiceRootURL;
import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
import org.apache.olingo.client.core.http.BasicAuthHttpClientFactory;
@ -32,7 +30,7 @@ public class AuthEntityRetrieveTestITCase extends EntityRetrieveTestITCase {
@Override
protected InMemoryEntities getContainer() {
final EntityContainerFactory<EdmEnabledODataClient> ecf =
EntityContainerFactory.getV4(testKeyAsSegmentServiceRootURL);
EntityContainerFactory.getV4(testAuthServiceRootURL);
ecf.getClient().getConfiguration().setKeyAsSegment(true);
ecf.getClient().getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
ecf.getClient().getConfiguration().

View File

@ -29,6 +29,8 @@ import java.util.Calendar;
import java.util.Collections;
import java.util.TimeZone;
import org.apache.commons.lang3.RandomUtils;
import static org.apache.olingo.fit.proxy.v4.AbstractTestITCase.container;
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.AccessLevel;
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Address;
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Color;
@ -71,7 +73,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
date.clear();
date.set(2011, 3, 4, 9, 0, 0);
employee.setDateHired(date);
Address homeAddress = employee.factory().newHomeAddress();
final Address homeAddress = employee.factory().newHomeAddress();
homeAddress.setCity("Pescara");
homeAddress.setPostalCode("65100");
homeAddress.setStreet("viale Gabriele D'Annunzio 256");
@ -94,7 +96,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
container.getPeople().delete(actual.getPersonID());
container.flush();
actual = container.getPeople().get(id, Employee.class);;
actual = container.getPeople().get(id, Employee.class);
assertNull(actual);
entityContext.detachAll();
@ -130,7 +132,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
assertEquals(homeAddress.getCity(), actual.getHomeAddress().getCity());
assertEquals(1, actual.getOrders().size());
assertEquals(8, actual.getOrders().iterator().next().getOrderID(), 0);
container.getCustomers().delete(actual.getPersonID());
container.flush();

View File

@ -33,6 +33,7 @@ import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.ext.proxy.EntityContainerFactory;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.DefaultContainer;
import org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.AccountInfo;
import org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.Color;
import org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.ContactDetails;
import org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.Row;
@ -115,6 +116,12 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
rowIndex.addAdditionalProperty("aContact", contact);
rowIndex.addAdditionalProperty("aColor", Color.Green);
final AccountInfo ai = otcontainer.complexFactory().newAccountInfo();
ai.setFirstName("Fabio");
ai.setLastName("Martelli");
ai.addAdditionalProperty("email", "fabio.martelli@tirasa.net");
rowIndex.addAdditionalProperty("info", ai);
otcontainer.flush();
rowIndex = otcontainer.getRowIndex().get(id);
@ -127,6 +134,10 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
assertEquals(ContactDetails.class, rowIndex.getAdditionalProperty("aContact").getClass().getInterfaces()[0]);
assertEquals(Color.class, rowIndex.getAdditionalProperty("aColor").getClass());
assertEquals(Color.Green, rowIndex.getAdditionalProperty("aColor"));
assertEquals("Fabio", AccountInfo.class.cast(rowIndex.getAdditionalProperty("info")).getFirstName());
assertEquals("Martelli", AccountInfo.class.cast(rowIndex.getAdditionalProperty("info")).getLastName());
assertEquals("fabio.martelli@tirasa.net", AccountInfo.class.cast(rowIndex.getAdditionalProperty("info")).
getAdditionalProperty("email"));
entityContext.detachAll();

View File

@ -19,9 +19,10 @@
package org.apache.olingo.fit.proxy.v4;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company;
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.CompanyCategory;
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.IsBoss;
@ -51,13 +52,26 @@ public class SingletonTestITCase extends AbstractTestITCase {
public void readWithAnnotations() {
final Company company = container.getCompany().get();
assertTrue(company.getAnnotationTerms().isEmpty());
final Person boss = container.getBoss().get();
assertEquals(2, boss.getPersonID(), 0);
assertEquals(1, boss.getAnnotationTerms().size());
final Object isBoss = boss.getAnnotation(IsBoss.class);
Object isBoss = boss.getAnnotation(IsBoss.class);
assertTrue(isBoss instanceof Boolean);
assertTrue((Boolean) isBoss);
Annotatable annotations = boss.annotations().getFirstNameAnnotations();
assertTrue(annotations.getAnnotationTerms().isEmpty());
annotations = boss.annotations().getLastNameAnnotations();
isBoss = annotations.getAnnotation(IsBoss.class);
assertTrue(isBoss instanceof Boolean);
assertFalse((Boolean) isBoss);
annotations = boss.annotations().getParentAnnotations();
isBoss = annotations.getAnnotation(IsBoss.class);
assertTrue(isBoss instanceof Boolean);
assertFalse((Boolean) isBoss);
}
}

View File

@ -53,12 +53,10 @@ import javax.xml.datatype.Duration;
public interface DefaultContainer extends Container {
Row getRow();
RowIndex getRowIndex();
Operations operations();
public interface Operations {
@ -72,5 +70,9 @@ public interface DefaultContainer extends Container {
type = "Microsoft.Test.OData.Services.OpenTypesServiceV4.ContactDetails")
org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.ContactDetails newContactDetails();
@Property(name = "AccountInfo",
type = "Microsoft.Test.OData.Services.OpenTypesServiceV4.AccountInfo")
org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.AccountInfo newAccountInfo();
}
}

View File

@ -43,7 +43,6 @@ import java.util.Calendar;
import javax.xml.datatype.Duration;
@EntitySet(name = "Row")
public interface Row
extends AbstractEntitySet<org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.Row, UUID, org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.RowCollection> {

View File

@ -43,7 +43,6 @@ import java.util.Calendar;
import javax.xml.datatype.Duration;
@EntitySet(name = "RowIndex")
public interface RowIndex
extends AbstractEntitySet<org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.RowIndex, Integer, org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.RowIndexCollection> {

View File

@ -0,0 +1,90 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.ComplexType;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.*;
import org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.*;
import org.apache.olingo.commons.api.edm.geo.Geospatial;
import org.apache.olingo.commons.api.edm.geo.GeospatialCollection;
import org.apache.olingo.commons.api.edm.geo.LineString;
import org.apache.olingo.commons.api.edm.geo.MultiLineString;
import org.apache.olingo.commons.api.edm.geo.MultiPoint;
import org.apache.olingo.commons.api.edm.geo.MultiPolygon;
import org.apache.olingo.commons.api.edm.geo.Point;
import org.apache.olingo.commons.api.edm.geo.Polygon;
import java.math.BigDecimal;
import java.net.URI;
import java.util.UUID;
import java.io.Serializable;
import java.util.Collection;
import java.util.Calendar;
import javax.xml.datatype.Duration;
@Namespace("Microsoft.Test.OData.Services.OpenTypesServiceV4")
@ComplexType(name = "AccountInfo",
isOpenType = true,
isAbstract = false)
public interface AccountInfo
extends AbstractOpenType,Serializable {
@Property(name = "FirstName",
type = "Edm.String",
nullable = false,
defaultValue = "",
maxLenght = Integer.MAX_VALUE,
fixedLenght = false,
precision = 0,
scale = 0,
unicode = true,
collation = "",
srid = "")
String getFirstName();
void setFirstName(String _firstName);
@Property(name = "LastName",
type = "Edm.String",
nullable = false,
defaultValue = "",
maxLenght = Integer.MAX_VALUE,
fixedLenght = false,
precision = 0,
scale = 0,
unicode = true,
collation = "",
srid = "")
String getLastName();
void setLastName(String _lastName);
}

View File

@ -23,6 +23,7 @@ import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.ComplexType;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.*;
import org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.*;
@ -64,7 +65,7 @@ public interface ContactDetails
srid = "")
byte[] getFirstContacted();
void setFirstContacted(final byte[] _firstContacted);
void setFirstContacted(byte[] _firstContacted);
@ -81,7 +82,7 @@ public interface ContactDetails
srid = "")
Calendar getLastContacted();
void setLastContacted(final Calendar _lastContacted);
void setLastContacted(Calendar _lastContacted);
@ -98,7 +99,7 @@ public interface ContactDetails
srid = "")
Calendar getContacted();
void setContacted(final Calendar _contacted);
void setContacted(Calendar _contacted);
@ -115,7 +116,7 @@ public interface ContactDetails
srid = "")
UUID getGUID();
void setGUID(final UUID _gUID);
void setGUID(UUID _gUID);
@ -132,7 +133,7 @@ public interface ContactDetails
srid = "")
Calendar getPreferedContactTime();
void setPreferedContactTime(final Calendar _preferedContactTime);
void setPreferedContactTime(Calendar _preferedContactTime);
@ -149,7 +150,7 @@ public interface ContactDetails
srid = "")
Short getByte();
void setByte(final Short _byte);
void setByte(Short _byte);
@ -166,7 +167,7 @@ public interface ContactDetails
srid = "")
Byte getSignedByte();
void setSignedByte(final Byte _signedByte);
void setSignedByte(Byte _signedByte);
@ -183,7 +184,7 @@ public interface ContactDetails
srid = "")
Double getDouble();
void setDouble(final Double _double);
void setDouble(Double _double);
@ -200,7 +201,7 @@ public interface ContactDetails
srid = "")
Float getSingle();
void setSingle(final Float _single);
void setSingle(Float _single);
@ -217,7 +218,7 @@ public interface ContactDetails
srid = "")
Short getShort();
void setShort(final Short _short);
void setShort(Short _short);
@ -234,7 +235,7 @@ public interface ContactDetails
srid = "")
Integer getInt();
void setInt(final Integer _int);
void setInt(Integer _int);
@ -251,7 +252,7 @@ public interface ContactDetails
srid = "")
Long getLong();
void setLong(final Long _long);
void setLong(Long _long);

View File

@ -28,6 +28,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -59,7 +60,7 @@ import javax.xml.datatype.Duration;
isAbstract = false,
baseType = "Microsoft.Test.OData.Services.OpenTypesServiceV4.Row")
public interface IndexedRow
extends org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.Row {
extends Annotatable,org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.Row {
@Key
@ -83,7 +84,7 @@ public interface IndexedRow
fcKeepInContent = false)
UUID getId();
void setId(final UUID _id);
void setId(UUID _id);

View File

@ -21,6 +21,7 @@ package org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.op
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
import org.apache.olingo.ext.proxy.api.AbstractTerm;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
@ -44,4 +45,8 @@ import java.util.Calendar;
import javax.xml.datatype.Duration;
public interface IndexedRowCollection extends AbstractEntityCollection<IndexedRow> {
Object getAnnotation(Class<? extends AbstractTerm> term);
Collection<Class<? extends AbstractTerm>> getAnnotationTerms();
}

View File

@ -28,6 +28,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +59,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface Row
extends AbstractOpenType {
extends Annotatable,AbstractOpenType {
@Key
@ -82,7 +83,7 @@ public interface Row
fcKeepInContent = false)
UUID getId();
void setId(final UUID _id);
void setId(UUID _id);

View File

@ -21,6 +21,7 @@ package org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.op
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
import org.apache.olingo.ext.proxy.api.AbstractTerm;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
@ -44,4 +45,8 @@ import java.util.Calendar;
import javax.xml.datatype.Duration;
public interface RowCollection extends AbstractEntityCollection<Row> {
Object getAnnotation(Class<? extends AbstractTerm> term);
Collection<Class<? extends AbstractTerm>> getAnnotationTerms();
}

View File

@ -28,6 +28,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +59,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface RowIndex
extends AbstractOpenType {
extends Annotatable,AbstractOpenType {
@Key
@ -82,7 +83,7 @@ public interface RowIndex
fcKeepInContent = false)
Integer getId();
void setId(final Integer _id);
void setId(Integer _id);
@ -90,12 +91,12 @@ public interface RowIndex
type = "Microsoft.Test.OData.Services.OpenTypesServiceV4.Row",
targetSchema = "Microsoft.Test.OData.Services.OpenTypesServiceV4",
targetContainer = "DefaultContainer",
targetEntitySet = "Row")
targetEntitySet = "Row",
containsTarget = false)
org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.Row getRows();
void setRows(final org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.Row _rows);
void setRows(org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.Row _rows);
}

View File

@ -21,6 +21,7 @@ package org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.op
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
import org.apache.olingo.ext.proxy.api.AbstractTerm;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
@ -44,4 +45,8 @@ import java.util.Calendar;
import javax.xml.datatype.Duration;
public interface RowIndexCollection extends AbstractEntityCollection<RowIndex> {
Object getAnnotation(Class<? extends AbstractTerm> term);
Collection<Class<? extends AbstractTerm>> getAnnotationTerms();
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface Account
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -208,4 +210,39 @@ public interface Account
org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.AccountInfo newAccountInfo();
}
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "AccountID",
type = "Edm.Int32")
Annotatable getAccountIDAnnotations();
@AnnotationsForProperty(name = "Country",
type = "Edm.String")
Annotatable getCountryAnnotations();
@AnnotationsForProperty(name = "AccountInfo",
type = "Microsoft.Test.OData.Services.ODataWCFService.AccountInfo")
Annotatable getAccountInfoAnnotations();
@AnnotationsForNavigationProperty(name = "MyGiftCard",
type = "Microsoft.Test.OData.Services.ODataWCFService.GiftCard")
Annotatable getMyGiftCardAnnotations();
@AnnotationsForNavigationProperty(name = "MyPaymentInstruments",
type = "Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument")
Annotatable getMyPaymentInstrumentsAnnotations();
@AnnotationsForNavigationProperty(name = "ActiveSubscriptions",
type = "Microsoft.Test.OData.Services.ODataWCFService.Subscription")
Annotatable getActiveSubscriptionsAnnotations();
@AnnotationsForNavigationProperty(name = "AvailableSubscriptionTemplatess",
type = "Microsoft.Test.OData.Services.ODataWCFService.Subscription")
Annotatable getAvailableSubscriptionTemplatessAnnotations();
}
}

View File

@ -18,10 +18,14 @@
*/
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.ComplexType;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.*;
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.*;
@ -47,7 +51,7 @@ import javax.xml.datatype.Duration;
isOpenType = true,
isAbstract = false)
public interface AccountInfo
extends Serializable {
extends AbstractOpenType,Serializable {
@Property(name = "FirstName",
@ -85,4 +89,19 @@ public interface AccountInfo
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "FirstName",
type = "Edm.String")
Annotatable getFirstNameAnnotations();
@AnnotationsForProperty(name = "LastName",
type = "Edm.String")
Annotatable getLastNameAnnotations();
}
}

View File

@ -18,10 +18,14 @@
*/
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.ComplexType;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.*;
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.*;
@ -102,4 +106,23 @@ public interface Address
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "Street",
type = "Edm.String")
Annotatable getStreetAnnotations();
@AnnotationsForProperty(name = "City",
type = "Edm.String")
Annotatable getCityAnnotations();
@AnnotationsForProperty(name = "PostalCode",
type = "Edm.String")
Annotatable getPostalCodeAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface Asset
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -134,4 +136,23 @@ public interface Asset
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "AssetID",
type = "Edm.Int32")
Annotatable getAssetIDAnnotations();
@AnnotationsForProperty(name = "Name",
type = "Edm.String")
Annotatable getNameAnnotations();
@AnnotationsForProperty(name = "Number",
type = "Edm.Int32")
Annotatable getNumberAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface Club
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -111,4 +113,19 @@ public interface Club
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "ClubID",
type = "Edm.Int32")
Annotatable getClubIDAnnotations();
@AnnotationsForProperty(name = "Name",
type = "Edm.String")
Annotatable getNameAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface Company
extends AbstractAnnotatable,AbstractOpenType {
extends Annotatable,AbstractOpenType {
@Key
@ -247,4 +249,47 @@ public interface Company
org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Address newAddress();
}
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "CompanyID",
type = "Edm.Int32")
Annotatable getCompanyIDAnnotations();
@AnnotationsForProperty(name = "CompanyCategory",
type = "Microsoft.Test.OData.Services.ODataWCFService.CompanyCategory")
Annotatable getCompanyCategoryAnnotations();
@AnnotationsForProperty(name = "Revenue",
type = "Edm.Int64")
Annotatable getRevenueAnnotations();
@AnnotationsForProperty(name = "Name",
type = "Edm.String")
Annotatable getNameAnnotations();
@AnnotationsForProperty(name = "Address",
type = "Microsoft.Test.OData.Services.ODataWCFService.Address")
Annotatable getAddressAnnotations();
@AnnotationsForNavigationProperty(name = "Employees",
type = "Microsoft.Test.OData.Services.ODataWCFService.Employee")
Annotatable getEmployeesAnnotations();
@AnnotationsForNavigationProperty(name = "VipCustomer",
type = "Microsoft.Test.OData.Services.ODataWCFService.Customer")
Annotatable getVipCustomerAnnotations();
@AnnotationsForNavigationProperty(name = "Departments",
type = "Microsoft.Test.OData.Services.ODataWCFService.Department")
Annotatable getDepartmentsAnnotations();
@AnnotationsForNavigationProperty(name = "CoreDepartment",
type = "Microsoft.Test.OData.Services.ODataWCFService.Department")
Annotatable getCoreDepartmentAnnotations();
}
}

View File

@ -18,10 +18,14 @@
*/
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.ComplexType;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.*;
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.*;
@ -48,7 +52,7 @@ import javax.xml.datatype.Duration;
isAbstract = false,
baseType = "Microsoft.Test.OData.Services.ODataWCFService.Address")
public interface CompanyAddress
extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Address {
extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Address,Serializable {
@Property(name = "Street",
@ -120,4 +124,28 @@ public interface CompanyAddress
@Override
Annotations annotations();
interface Annotations extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Address.Annotations{
@AnnotationsForProperty(name = "Street",
type = "Edm.String")
Annotatable getStreetAnnotations();
@AnnotationsForProperty(name = "City",
type = "Edm.String")
Annotatable getCityAnnotations();
@AnnotationsForProperty(name = "PostalCode",
type = "Edm.String")
Annotatable getPostalCodeAnnotations();
@AnnotationsForProperty(name = "CompanyName",
type = "Edm.String")
Annotatable getCompanyNameAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -59,7 +61,7 @@ import javax.xml.datatype.Duration;
isAbstract = false,
baseType = "Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument")
public interface CreditCardPI
extends AbstractAnnotatable,org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.PaymentInstrument {
extends Annotatable,org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.PaymentInstrument {
@Key
@ -290,4 +292,60 @@ public interface CreditCardPI
@Override
Annotations annotations();
interface Annotations extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.PaymentInstrument.Annotations{
@AnnotationsForProperty(name = "PaymentInstrumentID",
type = "Edm.Int32")
Annotatable getPaymentInstrumentIDAnnotations();
@AnnotationsForProperty(name = "FriendlyName",
type = "Edm.String")
Annotatable getFriendlyNameAnnotations();
@AnnotationsForProperty(name = "CreatedDate",
type = "Edm.DateTimeOffset")
Annotatable getCreatedDateAnnotations();
@AnnotationsForProperty(name = "CardNumber",
type = "Edm.String")
Annotatable getCardNumberAnnotations();
@AnnotationsForProperty(name = "CVV",
type = "Edm.String")
Annotatable getCVVAnnotations();
@AnnotationsForProperty(name = "HolderName",
type = "Edm.String")
Annotatable getHolderNameAnnotations();
@AnnotationsForProperty(name = "Balance",
type = "Edm.Double")
Annotatable getBalanceAnnotations();
@AnnotationsForProperty(name = "ExperationDate",
type = "Edm.DateTimeOffset")
Annotatable getExperationDateAnnotations();
@AnnotationsForNavigationProperty(name = "TheStoredPI",
type = "Microsoft.Test.OData.Services.ODataWCFService.StoredPI")
Annotatable getTheStoredPIAnnotations();
@AnnotationsForNavigationProperty(name = "BillingStatements",
type = "Microsoft.Test.OData.Services.ODataWCFService.Statement")
Annotatable getBillingStatementsAnnotations();
@AnnotationsForNavigationProperty(name = "BackupStoredPI",
type = "Microsoft.Test.OData.Services.ODataWCFService.StoredPI")
Annotatable getBackupStoredPIAnnotations();
@AnnotationsForNavigationProperty(name = "CreditRecords",
type = "Microsoft.Test.OData.Services.ODataWCFService.CreditRecord")
Annotatable getCreditRecordsAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface CreditRecord
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -157,4 +159,27 @@ public interface CreditRecord
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "CreditRecordID",
type = "Edm.Int32")
Annotatable getCreditRecordIDAnnotations();
@AnnotationsForProperty(name = "IsGood",
type = "Edm.Boolean")
Annotatable getIsGoodAnnotations();
@AnnotationsForProperty(name = "Reason",
type = "Edm.String")
Annotatable getReasonAnnotations();
@AnnotationsForProperty(name = "CreatedDate",
type = "Edm.DateTimeOffset")
Annotatable getCreatedDateAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -59,7 +61,7 @@ import javax.xml.datatype.Duration;
isAbstract = false,
baseType = "Microsoft.Test.OData.Services.ODataWCFService.Person")
public interface Customer
extends AbstractAnnotatable,org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person {
extends Annotatable,org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person {
@Key
@ -364,4 +366,68 @@ public interface Customer
org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Address newHomeAddress();
}
@Override
Annotations annotations();
interface Annotations extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person.Annotations{
@AnnotationsForProperty(name = "PersonID",
type = "Edm.Int32")
Annotatable getPersonIDAnnotations();
@AnnotationsForProperty(name = "FirstName",
type = "Edm.String")
Annotatable getFirstNameAnnotations();
@AnnotationsForProperty(name = "LastName",
type = "Edm.String")
Annotatable getLastNameAnnotations();
@AnnotationsForProperty(name = "MiddleName",
type = "Edm.String")
Annotatable getMiddleNameAnnotations();
@AnnotationsForProperty(name = "HomeAddress",
type = "Microsoft.Test.OData.Services.ODataWCFService.Address")
Annotatable getHomeAddressAnnotations();
@AnnotationsForProperty(name = "Home",
type = "Edm.GeographyPoint")
Annotatable getHomeAnnotations();
@AnnotationsForProperty(name = "Numbers",
type = "Edm.String")
Annotatable getNumbersAnnotations();
@AnnotationsForProperty(name = "Emails",
type = "Edm.String")
Annotatable getEmailsAnnotations();
@AnnotationsForProperty(name = "City",
type = "Edm.String")
Annotatable getCityAnnotations();
@AnnotationsForProperty(name = "Birthday",
type = "Edm.DateTimeOffset")
Annotatable getBirthdayAnnotations();
@AnnotationsForProperty(name = "TimeBetweenLastTwoOrders",
type = "Edm.Duration")
Annotatable getTimeBetweenLastTwoOrdersAnnotations();
@AnnotationsForNavigationProperty(name = "Parent",
type = "Microsoft.Test.OData.Services.ODataWCFService.Person")
Annotatable getParentAnnotations();
@AnnotationsForNavigationProperty(name = "Orders",
type = "Microsoft.Test.OData.Services.ODataWCFService.Order")
Annotatable getOrdersAnnotations();
@AnnotationsForNavigationProperty(name = "Company",
type = "Microsoft.Test.OData.Services.ODataWCFService.Company")
Annotatable getCompanyAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface Department
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -144,4 +146,27 @@ public interface Department
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "DepartmentID",
type = "Edm.Int32")
Annotatable getDepartmentIDAnnotations();
@AnnotationsForProperty(name = "Name",
type = "Edm.String")
Annotatable getNameAnnotations();
@AnnotationsForProperty(name = "DepartmentNO",
type = "Edm.String")
Annotatable getDepartmentNOAnnotations();
@AnnotationsForNavigationProperty(name = "Company",
type = "Microsoft.Test.OData.Services.ODataWCFService.Company")
Annotatable getCompanyAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -59,7 +61,7 @@ import javax.xml.datatype.Duration;
isAbstract = false,
baseType = "Microsoft.Test.OData.Services.ODataWCFService.Person")
public interface Employee
extends AbstractAnnotatable,org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person {
extends Annotatable,org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person {
@Key
@ -331,4 +333,60 @@ public interface Employee
org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Address newHomeAddress();
}
@Override
Annotations annotations();
interface Annotations extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person.Annotations{
@AnnotationsForProperty(name = "PersonID",
type = "Edm.Int32")
Annotatable getPersonIDAnnotations();
@AnnotationsForProperty(name = "FirstName",
type = "Edm.String")
Annotatable getFirstNameAnnotations();
@AnnotationsForProperty(name = "LastName",
type = "Edm.String")
Annotatable getLastNameAnnotations();
@AnnotationsForProperty(name = "MiddleName",
type = "Edm.String")
Annotatable getMiddleNameAnnotations();
@AnnotationsForProperty(name = "HomeAddress",
type = "Microsoft.Test.OData.Services.ODataWCFService.Address")
Annotatable getHomeAddressAnnotations();
@AnnotationsForProperty(name = "Home",
type = "Edm.GeographyPoint")
Annotatable getHomeAnnotations();
@AnnotationsForProperty(name = "Numbers",
type = "Edm.String")
Annotatable getNumbersAnnotations();
@AnnotationsForProperty(name = "Emails",
type = "Edm.String")
Annotatable getEmailsAnnotations();
@AnnotationsForProperty(name = "DateHired",
type = "Edm.DateTimeOffset")
Annotatable getDateHiredAnnotations();
@AnnotationsForProperty(name = "Office",
type = "Edm.GeographyPoint")
Annotatable getOfficeAnnotations();
@AnnotationsForNavigationProperty(name = "Parent",
type = "Microsoft.Test.OData.Services.ODataWCFService.Person")
Annotatable getParentAnnotations();
@AnnotationsForNavigationProperty(name = "Company",
type = "Microsoft.Test.OData.Services.ODataWCFService.Company")
Annotatable getCompanyAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface GiftCard
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -193,4 +195,31 @@ public interface GiftCard
}
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "GiftCardID",
type = "Edm.Int32")
Annotatable getGiftCardIDAnnotations();
@AnnotationsForProperty(name = "GiftCardNO",
type = "Edm.String")
Annotatable getGiftCardNOAnnotations();
@AnnotationsForProperty(name = "Amount",
type = "Edm.Double")
Annotatable getAmountAnnotations();
@AnnotationsForProperty(name = "ExperationDate",
type = "Edm.DateTimeOffset")
Annotatable getExperationDateAnnotations();
@AnnotationsForProperty(name = "OwnerName",
type = "Edm.String")
Annotatable getOwnerNameAnnotations();
}
}

View File

@ -18,10 +18,14 @@
*/
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.ComplexType;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.*;
import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.*;
@ -48,7 +52,7 @@ import javax.xml.datatype.Duration;
isAbstract = false,
baseType = "Microsoft.Test.OData.Services.ODataWCFService.Address")
public interface HomeAddress
extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Address {
extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Address,Serializable {
@Property(name = "Street",
@ -120,4 +124,28 @@ public interface HomeAddress
@Override
Annotations annotations();
interface Annotations extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Address.Annotations{
@AnnotationsForProperty(name = "Street",
type = "Edm.String")
Annotatable getStreetAnnotations();
@AnnotationsForProperty(name = "City",
type = "Edm.String")
Annotatable getCityAnnotations();
@AnnotationsForProperty(name = "PostalCode",
type = "Edm.String")
Annotatable getPostalCodeAnnotations();
@AnnotationsForProperty(name = "FamilyName",
type = "Edm.String")
Annotatable getFamilyNameAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface LabourUnion
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -111,4 +113,19 @@ public interface LabourUnion
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "LabourUnionID",
type = "Edm.Int32")
Annotatable getLabourUnionIDAnnotations();
@AnnotationsForProperty(name = "Name",
type = "Edm.String")
Annotatable getNameAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface Order
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -187,4 +189,39 @@ public interface Order
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "OrderID",
type = "Edm.Int32")
Annotatable getOrderIDAnnotations();
@AnnotationsForProperty(name = "OrderDate",
type = "Edm.DateTimeOffset")
Annotatable getOrderDateAnnotations();
@AnnotationsForProperty(name = "ShelfLife",
type = "Edm.Duration")
Annotatable getShelfLifeAnnotations();
@AnnotationsForProperty(name = "OrderShelfLifes",
type = "Edm.Duration")
Annotatable getOrderShelfLifesAnnotations();
@AnnotationsForNavigationProperty(name = "LoggedInEmployee",
type = "Microsoft.Test.OData.Services.ODataWCFService.Employee")
Annotatable getLoggedInEmployeeAnnotations();
@AnnotationsForNavigationProperty(name = "CustomerForOrder",
type = "Microsoft.Test.OData.Services.ODataWCFService.Customer")
Annotatable getCustomerForOrderAnnotations();
@AnnotationsForNavigationProperty(name = "OrderDetails",
type = "Microsoft.Test.OData.Services.ODataWCFService.OrderDetail")
Annotatable getOrderDetailsAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface OrderDetail
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -200,4 +202,39 @@ public interface OrderDetail
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "OrderID",
type = "Edm.Int32")
Annotatable getOrderIDAnnotations();
@AnnotationsForProperty(name = "ProductID",
type = "Edm.Int32")
Annotatable getProductIDAnnotations();
@AnnotationsForProperty(name = "OrderPlaced",
type = "Edm.DateTimeOffset")
Annotatable getOrderPlacedAnnotations();
@AnnotationsForProperty(name = "Quantity",
type = "Edm.Int32")
Annotatable getQuantityAnnotations();
@AnnotationsForProperty(name = "UnitPrice",
type = "Edm.Single")
Annotatable getUnitPriceAnnotations();
@AnnotationsForNavigationProperty(name = "ProductOrdered",
type = "Microsoft.Test.OData.Services.ODataWCFService.Product")
Annotatable getProductOrderedAnnotations();
@AnnotationsForNavigationProperty(name = "AssociatedOrder",
type = "Microsoft.Test.OData.Services.ODataWCFService.Order")
Annotatable getAssociatedOrderAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface PaymentInstrument
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -164,4 +166,35 @@ public interface PaymentInstrument
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "PaymentInstrumentID",
type = "Edm.Int32")
Annotatable getPaymentInstrumentIDAnnotations();
@AnnotationsForProperty(name = "FriendlyName",
type = "Edm.String")
Annotatable getFriendlyNameAnnotations();
@AnnotationsForProperty(name = "CreatedDate",
type = "Edm.DateTimeOffset")
Annotatable getCreatedDateAnnotations();
@AnnotationsForNavigationProperty(name = "TheStoredPI",
type = "Microsoft.Test.OData.Services.ODataWCFService.StoredPI")
Annotatable getTheStoredPIAnnotations();
@AnnotationsForNavigationProperty(name = "BillingStatements",
type = "Microsoft.Test.OData.Services.ODataWCFService.Statement")
Annotatable getBillingStatementsAnnotations();
@AnnotationsForNavigationProperty(name = "BackupStoredPI",
type = "Microsoft.Test.OData.Services.ODataWCFService.StoredPI")
Annotatable getBackupStoredPIAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface Person
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -287,4 +289,47 @@ public interface Person
org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Address newHomeAddress();
}
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "PersonID",
type = "Edm.Int32")
Annotatable getPersonIDAnnotations();
@AnnotationsForProperty(name = "FirstName",
type = "Edm.String")
Annotatable getFirstNameAnnotations();
@AnnotationsForProperty(name = "LastName",
type = "Edm.String")
Annotatable getLastNameAnnotations();
@AnnotationsForProperty(name = "MiddleName",
type = "Edm.String")
Annotatable getMiddleNameAnnotations();
@AnnotationsForProperty(name = "HomeAddress",
type = "Microsoft.Test.OData.Services.ODataWCFService.Address")
Annotatable getHomeAddressAnnotations();
@AnnotationsForProperty(name = "Home",
type = "Edm.GeographyPoint")
Annotatable getHomeAnnotations();
@AnnotationsForProperty(name = "Numbers",
type = "Edm.String")
Annotatable getNumbersAnnotations();
@AnnotationsForProperty(name = "Emails",
type = "Edm.String")
Annotatable getEmailsAnnotations();
@AnnotationsForNavigationProperty(name = "Parent",
type = "Microsoft.Test.OData.Services.ODataWCFService.Person")
Annotatable getParentAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface Product
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -302,4 +304,51 @@ public interface Product
}
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "ProductID",
type = "Edm.Int32")
Annotatable getProductIDAnnotations();
@AnnotationsForProperty(name = "Name",
type = "Edm.String")
Annotatable getNameAnnotations();
@AnnotationsForProperty(name = "QuantityPerUnit",
type = "Edm.String")
Annotatable getQuantityPerUnitAnnotations();
@AnnotationsForProperty(name = "UnitPrice",
type = "Edm.Single")
Annotatable getUnitPriceAnnotations();
@AnnotationsForProperty(name = "QuantityInStock",
type = "Edm.Int32")
Annotatable getQuantityInStockAnnotations();
@AnnotationsForProperty(name = "Discontinued",
type = "Edm.Boolean")
Annotatable getDiscontinuedAnnotations();
@AnnotationsForProperty(name = "UserAccess",
type = "Microsoft.Test.OData.Services.ODataWCFService.AccessLevel")
Annotatable getUserAccessAnnotations();
@AnnotationsForProperty(name = "SkinColor",
type = "Microsoft.Test.OData.Services.ODataWCFService.Color")
Annotatable getSkinColorAnnotations();
@AnnotationsForProperty(name = "CoverColors",
type = "Microsoft.Test.OData.Services.ODataWCFService.Color")
Annotatable getCoverColorsAnnotations();
@AnnotationsForNavigationProperty(name = "Details",
type = "Microsoft.Test.OData.Services.ODataWCFService.ProductDetail")
Annotatable getDetailsAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface ProductDetail
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -189,4 +191,35 @@ public interface ProductDetail
}
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "ProductID",
type = "Edm.Int32")
Annotatable getProductIDAnnotations();
@AnnotationsForProperty(name = "ProductDetailID",
type = "Edm.Int32")
Annotatable getProductDetailIDAnnotations();
@AnnotationsForProperty(name = "ProductName",
type = "Edm.String")
Annotatable getProductNameAnnotations();
@AnnotationsForProperty(name = "Description",
type = "Edm.String")
Annotatable getDescriptionAnnotations();
@AnnotationsForNavigationProperty(name = "RelatedProduct",
type = "Microsoft.Test.OData.Services.ODataWCFService.Product")
Annotatable getRelatedProductAnnotations();
@AnnotationsForNavigationProperty(name = "Reviews",
type = "Microsoft.Test.OData.Services.ODataWCFService.ProductReview")
Annotatable getReviewsAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface ProductReview
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -203,4 +205,35 @@ public interface ProductReview
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "ProductID",
type = "Edm.Int32")
Annotatable getProductIDAnnotations();
@AnnotationsForProperty(name = "ProductDetailID",
type = "Edm.Int32")
Annotatable getProductDetailIDAnnotations();
@AnnotationsForProperty(name = "ReviewTitle",
type = "Edm.String")
Annotatable getReviewTitleAnnotations();
@AnnotationsForProperty(name = "RevisionID",
type = "Edm.Int32")
Annotatable getRevisionIDAnnotations();
@AnnotationsForProperty(name = "Comment",
type = "Edm.String")
Annotatable getCommentAnnotations();
@AnnotationsForProperty(name = "Author",
type = "Edm.String")
Annotatable getAuthorAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -59,7 +61,7 @@ import javax.xml.datatype.Duration;
isAbstract = false,
baseType = "Microsoft.Test.OData.Services.ODataWCFService.Company")
public interface PublicCompany
extends AbstractAnnotatable,org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company {
extends Annotatable,org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company {
@Key
@ -289,4 +291,64 @@ public interface PublicCompany
org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Address newAddress();
}
@Override
Annotations annotations();
interface Annotations extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company.Annotations{
@AnnotationsForProperty(name = "CompanyID",
type = "Edm.Int32")
Annotatable getCompanyIDAnnotations();
@AnnotationsForProperty(name = "CompanyCategory",
type = "Microsoft.Test.OData.Services.ODataWCFService.CompanyCategory")
Annotatable getCompanyCategoryAnnotations();
@AnnotationsForProperty(name = "Revenue",
type = "Edm.Int64")
Annotatable getRevenueAnnotations();
@AnnotationsForProperty(name = "Name",
type = "Edm.String")
Annotatable getNameAnnotations();
@AnnotationsForProperty(name = "Address",
type = "Microsoft.Test.OData.Services.ODataWCFService.Address")
Annotatable getAddressAnnotations();
@AnnotationsForProperty(name = "StockExchange",
type = "Edm.String")
Annotatable getStockExchangeAnnotations();
@AnnotationsForNavigationProperty(name = "Employees",
type = "Microsoft.Test.OData.Services.ODataWCFService.Employee")
Annotatable getEmployeesAnnotations();
@AnnotationsForNavigationProperty(name = "VipCustomer",
type = "Microsoft.Test.OData.Services.ODataWCFService.Customer")
Annotatable getVipCustomerAnnotations();
@AnnotationsForNavigationProperty(name = "Departments",
type = "Microsoft.Test.OData.Services.ODataWCFService.Department")
Annotatable getDepartmentsAnnotations();
@AnnotationsForNavigationProperty(name = "CoreDepartment",
type = "Microsoft.Test.OData.Services.ODataWCFService.Department")
Annotatable getCoreDepartmentAnnotations();
@AnnotationsForNavigationProperty(name = "Assets",
type = "Microsoft.Test.OData.Services.ODataWCFService.Asset")
Annotatable getAssetsAnnotations();
@AnnotationsForNavigationProperty(name = "Club",
type = "Microsoft.Test.OData.Services.ODataWCFService.Club")
Annotatable getClubAnnotations();
@AnnotationsForNavigationProperty(name = "LabourUnion",
type = "Microsoft.Test.OData.Services.ODataWCFService.LabourUnion")
Annotatable getLabourUnionAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface Statement
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -157,4 +159,27 @@ public interface Statement
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "StatementID",
type = "Edm.Int32")
Annotatable getStatementIDAnnotations();
@AnnotationsForProperty(name = "TransactionType",
type = "Edm.String")
Annotatable getTransactionTypeAnnotations();
@AnnotationsForProperty(name = "TransactionDescription",
type = "Edm.String")
Annotatable getTransactionDescriptionAnnotations();
@AnnotationsForProperty(name = "Amount",
type = "Edm.Double")
Annotatable getAmountAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface StoredPI
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -157,4 +159,27 @@ public interface StoredPI
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "StoredPIID",
type = "Edm.Int32")
Annotatable getStoredPIIDAnnotations();
@AnnotationsForProperty(name = "PIName",
type = "Edm.String")
Annotatable getPINameAnnotations();
@AnnotationsForProperty(name = "PIType",
type = "Edm.String")
Annotatable getPITypeAnnotations();
@AnnotationsForProperty(name = "CreatedDate",
type = "Edm.DateTimeOffset")
Annotatable getCreatedDateAnnotations();
}
}

View File

@ -19,6 +19,8 @@
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.Key;
@ -27,7 +29,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.api.annotations.Operation;
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
import org.apache.olingo.ext.proxy.api.AbstractAnnotatable;
import org.apache.olingo.ext.proxy.api.Annotatable;
import org.apache.olingo.ext.proxy.api.AbstractOpenType;
import org.apache.olingo.ext.proxy.api.OperationType;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
@ -58,7 +60,7 @@ import javax.xml.datatype.Duration;
hasStream = false,
isAbstract = false)
public interface Subscription
extends AbstractAnnotatable,Serializable {
extends Annotatable,Serializable {
@Key
@ -180,4 +182,31 @@ public interface Subscription
Annotations annotations();
interface Annotations {
@AnnotationsForProperty(name = "SubscriptionID",
type = "Edm.Int32")
Annotatable getSubscriptionIDAnnotations();
@AnnotationsForProperty(name = "TemplateGuid",
type = "Edm.String")
Annotatable getTemplateGuidAnnotations();
@AnnotationsForProperty(name = "Title",
type = "Edm.String")
Annotatable getTitleAnnotations();
@AnnotationsForProperty(name = "Category",
type = "Edm.String")
Annotatable getCategoryAnnotations();
@AnnotationsForProperty(name = "CreatedDate",
type = "Edm.DateTimeOffset")
Annotatable getCreatedDateAnnotations();
}
}

View File

@ -329,7 +329,7 @@ public abstract class AbstractTestITCase extends AbstractBaseTestITCase {
final ODataEntity original,
final String entitySetName) {
final URIBuilder uriBuilder = getClient().getURIBuilder(serviceRootURL).
final URIBuilder uriBuilder = getClient().newURIBuilder(serviceRootURL).
appendEntitySetSegment(entitySetName);
debugODataEntity(original, "About to create");
@ -356,7 +356,7 @@ public abstract class AbstractTestITCase extends AbstractBaseTestITCase {
final int actualObjectId,
final Collection<String> expands) {
final URIBuilder uriBuilder = getClient().getURIBuilder(serviceRootURL).
final URIBuilder uriBuilder = getClient().newURIBuilder(serviceRootURL).
appendEntitySetSegment("Customer").appendKeySegment(actualObjectId);
// search expanded

View File

@ -19,7 +19,6 @@
package org.apache.olingo.fit.v3;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertEquals;
import java.util.LinkedHashMap;
@ -27,120 +26,69 @@ import java.util.Map;
import org.apache.olingo.client.api.communication.request.invoke.ODataNoContent;
import org.apache.olingo.client.api.communication.response.ODataInvokeResponse;
import org.apache.olingo.client.api.uri.v3.URIBuilder;
import org.apache.olingo.client.core.uri.URIUtils;
import org.apache.olingo.commons.api.domain.ODataValue;
import org.apache.olingo.commons.api.domain.v3.ODataEntity;
import org.apache.olingo.commons.api.domain.v3.ODataEntitySet;
import org.apache.olingo.commons.api.domain.v3.ODataProperty;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAction;
import org.apache.olingo.commons.api.edm.EdmActionImport;
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
import org.apache.olingo.commons.api.edm.EdmSchema;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.core.edm.primitivetype.EdmInt32;
import org.junit.Test;
public class ActionOverloadingTestITCase extends AbstractTestITCase {
@Test
public void retrieveProduct() throws EdmPrimitiveTypeException {
final Edm edm = getClient().getRetrieveRequestFactory().
getMetadataRequest(testActionOverloadingServiceRootURL).execute().getBody();
assertNotNull(edm);
final String actionImportName = "RetrieveProduct";
final EdmEntityContainer container = edm.getSchemas().get(0).getEntityContainer();
assertNotNull(container);
// 1. unbound
final URIBuilder builder = getClient().newURIBuilder(testActionOverloadingServiceRootURL).
appendOperationCallSegment(actionImportName);
final ODataInvokeResponse<ODataProperty> unboundRes = getClient().getInvokeRequestFactory().
getActionInvokeRequest(builder.build(), ODataProperty.class).execute();
assertNotNull(unboundRes);
assertEquals(200, unboundRes.getStatusCode());
assertEquals(Integer.valueOf(-10), unboundRes.getBody().getPrimitiveValue().toCastValue(Integer.class));
int execs = 0;
for (EdmActionImport actImp : container.getActionImports()) {
if ("RetrieveProduct".equals(actImp.getName())) {
// 1. unbound
final EdmAction unbound = actImp.getUnboundAction();
assertNotNull(unbound);
assertEquals(EdmInt32.getInstance(), unbound.getReturnType().getType());
// 2. bound to Product
final ODataEntity product = getClient().getRetrieveRequestFactory().getEntityRequest(
getClient().newURIBuilder(testActionOverloadingServiceRootURL).
appendEntitySetSegment("Product").appendKeySegment(-10).build()).
execute().getBody();
assertNotNull(product);
final URIBuilder unboundBuilder = getClient().getURIBuilder(testActionOverloadingServiceRootURL).
appendOperationCallSegment(URIUtils.operationImportURISegment(container, actImp.getName()));
final ODataInvokeResponse<ODataProperty> unboundRes = getClient().getInvokeRequestFactory().
<ODataProperty>getInvokeRequest(unboundBuilder.build(), unbound).execute();
assertNotNull(unboundRes);
assertEquals(200, unboundRes.getStatusCode());
assertEquals(Integer.valueOf(-10), unboundRes.getBody().getPrimitiveValue().toCastValue(Integer.class));
execs++;
final ODataInvokeResponse<ODataProperty> productBoundRes = getClient().getInvokeRequestFactory().
getActionInvokeRequest(product.getOperation(actionImportName).getTarget(), ODataProperty.class).
execute();
assertNotNull(productBoundRes);
assertEquals(200, productBoundRes.getStatusCode());
assertEquals(Integer.valueOf(-10), productBoundRes.getBody().getPrimitiveValue().toCastValue(Integer.class));
// 2. bound to Product
final EdmAction productBound = edm.getBoundAction(
new FullQualifiedName(container.getNamespace(), actImp.getName()),
new FullQualifiedName(container.getNamespace(), "Product"), false);
assertNotNull(productBound);
assertEquals(EdmInt32.getInstance(), productBound.getReturnType().getType());
// 3. bound to OrderLine
final Map<String, Object> key = new LinkedHashMap<String, Object>(2);
key.put("OrderId", -10);
key.put("ProductId", -10);
final ODataEntity orderLine = getClient().getRetrieveRequestFactory().getEntityRequest(
getClient().newURIBuilder(testActionOverloadingServiceRootURL).
appendEntitySetSegment("OrderLine").appendKeySegment(key).build()).
execute().getBody();
assertNotNull(orderLine);
final ODataEntity product = getClient().getRetrieveRequestFactory().getEntityRequest(
getClient().getURIBuilder(testActionOverloadingServiceRootURL).
appendEntitySetSegment("Product").appendKeySegment(-10).build()).
execute().getBody();
assertNotNull(product);
final ODataInvokeResponse<ODataProperty> productBoundRes = getClient().getInvokeRequestFactory().
<ODataProperty>getInvokeRequest(product.getOperation(actImp.getName()).getTarget(), unbound).
execute();
assertNotNull(productBoundRes);
assertEquals(200, productBoundRes.getStatusCode());
assertEquals(Integer.valueOf(-10), productBoundRes.getBody().getPrimitiveValue().toCastValue(Integer.class));
execs++;
// 3. bound to OrderLine
final EdmAction orderLineBound = edm.getBoundAction(
new FullQualifiedName(container.getNamespace(), actImp.getName()),
new FullQualifiedName(container.getNamespace(), "OrderLine"), false);
assertNotNull(orderLineBound);
assertEquals(EdmInt32.getInstance(), orderLineBound.getReturnType().getType());
final Map<String, Object> key = new LinkedHashMap<String, Object>(2);
key.put("OrderId", -10);
key.put("ProductId", -10);
final ODataEntity orderLine = getClient().getRetrieveRequestFactory().getEntityRequest(
getClient().getURIBuilder(testActionOverloadingServiceRootURL).
appendEntitySetSegment("OrderLine").appendKeySegment(key).build()).
execute().getBody();
assertNotNull(orderLine);
final ODataInvokeResponse<ODataProperty> orderLineBoundRes = getClient().getInvokeRequestFactory().
<ODataProperty>getInvokeRequest(orderLine.getOperation(actImp.getName()).getTarget(), unbound).
execute();
assertNotNull(orderLineBoundRes);
assertEquals(200, orderLineBoundRes.getStatusCode());
assertEquals(Integer.valueOf(-10), orderLineBoundRes.getBody().getPrimitiveValue().toCastValue(Integer.class));
execs++;
}
}
assertEquals(3, execs);
final ODataInvokeResponse<ODataProperty> orderLineBoundRes = getClient().getInvokeRequestFactory().
getActionInvokeRequest(orderLine.getOperation(actionImportName).getTarget(), ODataProperty.class).
execute();
assertNotNull(orderLineBoundRes);
assertEquals(200, orderLineBoundRes.getStatusCode());
assertEquals(Integer.valueOf(-10), orderLineBoundRes.getBody().getPrimitiveValue().toCastValue(Integer.class));
}
@Test
public void increaseSalaries() {
final Edm edm = getClient().getRetrieveRequestFactory().
getMetadataRequest(testActionOverloadingServiceRootURL).execute().getBody();
assertNotNull(edm);
final EdmSchema schema = edm.getSchemas().get(0);
assertNotNull(schema);
EdmAction actImp = edm.getBoundAction(
new FullQualifiedName(schema.getNamespace(), "IncreaseSalaries"),
new FullQualifiedName(schema.getNamespace(), "Employee"),
true);
final String actionImportName = "IncreaseSalaries";
final Map<String, ODataValue> parameters = new LinkedHashMap<String, ODataValue>(1);
parameters.put("n", getClient().getObjectFactory().newPrimitiveValueBuilder().buildInt32(5));
// 1. bound to employees
assertNotNull(actImp);
assertNull(actImp.getReturnType());
final URIBuilder employeeBuilder = getClient().getURIBuilder(testActionOverloadingServiceRootURL).
final URIBuilder employeeBuilder = getClient().newURIBuilder(testActionOverloadingServiceRootURL).
appendEntitySetSegment("Person").
appendDerivedEntityTypeSegment("Microsoft.Test.OData.Services.AstoriaDefaultService.Employee");
final ODataEntitySet employees = getClient().getRetrieveRequestFactory().getEntitySetRequest(
@ -148,20 +96,13 @@ public class ActionOverloadingTestITCase extends AbstractTestITCase {
assertNotNull(employees);
final ODataInvokeResponse<ODataNoContent> employeeRes = getClient().getInvokeRequestFactory().
<ODataNoContent>getInvokeRequest(employeeBuilder.appendOperationCallSegment(actImp.getName()).build(),
actImp, parameters).execute();
getActionInvokeRequest(employeeBuilder.appendOperationCallSegment(actionImportName).build(),
ODataNoContent.class, parameters).execute();
assertNotNull(employeeRes);
assertEquals(204, employeeRes.getStatusCode());
// 2. bound to special employees
actImp = edm.getBoundAction(
new FullQualifiedName(schema.getNamespace(), "IncreaseSalaries"),
new FullQualifiedName(schema.getNamespace(), "SpecialEmployee"),
true);
assertNotNull(actImp);
assertNull(actImp.getReturnType());
final URIBuilder specEmpBuilder = getClient().getURIBuilder(testActionOverloadingServiceRootURL).
final URIBuilder specEmpBuilder = getClient().newURIBuilder(testActionOverloadingServiceRootURL).
appendEntitySetSegment("Person").
appendDerivedEntityTypeSegment("Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee");
final ODataEntitySet specEmps = getClient().getRetrieveRequestFactory().getEntitySetRequest(
@ -169,8 +110,8 @@ public class ActionOverloadingTestITCase extends AbstractTestITCase {
assertNotNull(specEmps);
final ODataInvokeResponse<ODataNoContent> specEmpsRes = getClient().getInvokeRequestFactory().
<ODataNoContent>getInvokeRequest(specEmpBuilder.appendOperationCallSegment(actImp.getName()).build(),
actImp, parameters).execute();
getActionInvokeRequest(specEmpBuilder.appendOperationCallSegment(actionImportName).build(),
ODataNoContent.class, parameters).execute();
assertNotNull(specEmpsRes);
assertEquals(204, specEmpsRes.getStatusCode());
}

View File

@ -44,7 +44,7 @@ public class AsyncTestITCase extends AbstractTestITCase {
@Test
public void retrieveEntitySet() throws InterruptedException, ExecutionException {
final URIBuilder uriBuilder = client.getURIBuilder(testStaticServiceRootURL).
final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Product");
final Future<ODataRetrieveResponse<ODataEntitySet>> futureRes =
client.getRetrieveRequestFactory().getEntitySetRequest(uriBuilder.build()).asyncExecute();
@ -62,7 +62,7 @@ public class AsyncTestITCase extends AbstractTestITCase {
@Test
public void updateEntity() throws InterruptedException, ExecutionException {
final URI uri = client.getURIBuilder(testStaticServiceRootURL).
final URI uri = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Product").appendKeySegment(-10).build();
final ODataRetrieveResponse<ODataEntity> entityRes = client.getRetrieveRequestFactory().
@ -93,15 +93,15 @@ public class AsyncTestITCase extends AbstractTestITCase {
@Test
public void createMediaEntity() throws Exception {
URIBuilder builder = client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Car");
URIBuilder builder = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Car");
final String TO_BE_UPDATED = "async buffered stream sample";
final InputStream input = IOUtils.toInputStream(TO_BE_UPDATED);
final ODataMediaEntityCreateRequest<ODataEntity> createReq =
client.getStreamedRequestFactory().getMediaEntityCreateRequest(builder.build(), input);
client.getCUDRequestFactory().getMediaEntityCreateRequest(builder.build(), input);
final MediaEntityCreateStreamManager<ODataEntity> streamManager = createReq.execute();
final MediaEntityCreateStreamManager<ODataEntity> streamManager = createReq.payloadManager();
final Future<ODataMediaEntityCreateResponse<ODataEntity>> futureCreateRes = streamManager.getAsyncResponse();
while (!futureCreateRes.isDone()) {
@ -119,10 +119,9 @@ public class AsyncTestITCase extends AbstractTestITCase {
? created.getProperties().get(0).getPrimitiveValue().toCastValue(Integer.class)
: created.getProperties().get(1).getPrimitiveValue().toCastValue(Integer.class);
builder = client.getURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Car").appendKeySegment(id).appendValueSegment();
builder = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Car").appendKeySegment(id);
final ODataMediaRequest retrieveReq = client.getRetrieveRequestFactory().getMediaRequest(builder.build());
final ODataMediaRequest retrieveReq = client.getRetrieveRequestFactory().getMediaEntityRequest(builder.build());
final ODataRetrieveResponse<InputStream> retrieveRes = retrieveReq.execute();
assertEquals(200, retrieveRes.getStatusCode());

View File

@ -30,11 +30,10 @@ import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.apache.http.HttpResponse;
import org.apache.olingo.client.api.ODataBatchConstants;
import org.apache.olingo.client.api.communication.request.ODataStreamManager;
import org.apache.olingo.client.api.communication.request.batch.BatchStreamManager;
import org.apache.olingo.client.api.communication.request.ODataPayloadManager;
import org.apache.olingo.client.api.communication.request.batch.BatchManager;
import org.apache.olingo.client.api.communication.request.batch.ODataBatchResponseItem;
import org.apache.olingo.client.api.communication.request.batch.ODataChangeset;
import org.apache.olingo.client.api.communication.request.batch.ODataRetrieve;
import org.apache.olingo.client.api.communication.request.batch.v3.ODataBatchRequest;
import org.apache.olingo.client.api.communication.request.cud.ODataDeleteRequest;
import org.apache.olingo.client.api.communication.request.cud.ODataEntityCreateRequest;
@ -50,7 +49,7 @@ import org.apache.olingo.client.api.uri.v3.URIBuilder;
import org.apache.olingo.client.core.communication.request.AbstractODataStreamManager;
import org.apache.olingo.client.core.communication.request.Wrapper;
import org.apache.olingo.client.core.communication.request.batch.ODataChangesetResponseItem;
import org.apache.olingo.client.core.communication.request.batch.ODataRetrieveResponseItem;
import org.apache.olingo.client.core.communication.request.batch.ODataSingleResponseItem;
import org.apache.olingo.client.core.communication.request.retrieve.ODataEntityRequestImpl;
import org.apache.olingo.client.core.communication.request.retrieve.ODataEntityRequestImpl.ODataEntityResponseImpl;
import org.apache.olingo.client.core.uri.URIUtils;
@ -90,7 +89,7 @@ public class BatchTestITCase extends AbstractTestITCase {
// create your request
final ODataBatchRequest request = client.getBatchRequestFactory().getBatchRequest(testStaticServiceRootURL);
final BatchStreamManager payload = request.execute();
final BatchManager payload = request.payloadManager();
final ODataBatchResponse response = payload.getResponse();
assertEquals(202, response.getStatusCode());
@ -105,13 +104,13 @@ public class BatchTestITCase extends AbstractTestITCase {
// create your request
final ODataBatchRequest request = client.getBatchRequestFactory().getBatchRequest(testStaticServiceRootURL);
final BatchStreamManager payload = request.execute();
final BatchManager payload = request.payloadManager();
final ODataChangeset changeset = payload.addChangeset();
URIBuilder targetURI;
ODataEntityCreateRequest<ODataEntity> createReq;
targetURI = client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer");
targetURI = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer");
for (int i = 1; i <= 2; i++) {
// Create Customer into the changeset
createReq = client.getCUDRequestFactory().getEntityCreateRequest(
@ -121,14 +120,14 @@ public class BatchTestITCase extends AbstractTestITCase {
changeset.addRequest(createReq);
}
targetURI = client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("WrongEntitySet");
targetURI = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("WrongEntitySet");
createReq = client.getCUDRequestFactory().getEntityCreateRequest(
targetURI.build(),
getSampleCustomerProfile(105, "Sample customer", false));
createReq.setFormat(ODataPubFormat.JSON);
changeset.addRequest(createReq);
targetURI = client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer");
targetURI = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer");
for (int i = 3; i <= 4; i++) {
// Create Customer into the changeset
createReq = client.getCUDRequestFactory().getEntityCreateRequest(
@ -158,12 +157,12 @@ public class BatchTestITCase extends AbstractTestITCase {
public void changesetWithReference() throws EdmPrimitiveTypeException {
// create your request
final ODataBatchRequest request = client.getBatchRequestFactory().getBatchRequest(testStaticServiceRootURL);
final BatchStreamManager streamManager = request.execute();
final BatchManager streamManager = request.payloadManager();
final ODataChangeset changeset = streamManager.addChangeset();
ODataEntity customer = getSampleCustomerProfile(20, "sample customer", false);
URIBuilder uriBuilder = client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer");
URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer");
// add create request
final ODataEntityCreateRequest<ODataEntity> createReq =
@ -178,7 +177,7 @@ public class BatchTestITCase extends AbstractTestITCase {
final ODataEntity customerChanges = client.getObjectFactory().newEntity(customer.getTypeName());
customerChanges.addLink(client.getObjectFactory().newEntityNavigationLink(
"Info",
client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("CustomerInfo").
client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("CustomerInfo").
appendKeySegment(17).build()));
final ODataEntityUpdateRequest<ODataEntity> updateReq = client.getCUDRequestFactory().getEntityUpdateRequest(
@ -234,7 +233,7 @@ public class BatchTestITCase extends AbstractTestITCase {
public void updateLinkWithReference() throws EdmPrimitiveTypeException {
// create your request
final ODataBatchRequest request = client.getBatchRequestFactory().getBatchRequest(testStaticServiceRootURL);
final BatchStreamManager streamManager = request.execute();
final BatchManager streamManager = request.payloadManager();
final ODataChangeset changeset = streamManager.addChangeset();
@ -245,7 +244,7 @@ public class BatchTestITCase extends AbstractTestITCase {
info.getProperties().add(client.getObjectFactory().newPrimitiveProperty("Information",
client.getObjectFactory().newPrimitiveValueBuilder().buildString("Sample information about customer 30")));
URIBuilder uriBuilder = client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("CustomerInfo");
URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("CustomerInfo");
ODataEntityCreateRequest<ODataEntity> createReq =
client.getCUDRequestFactory().getEntityCreateRequest(uriBuilder.build(), info);
@ -259,7 +258,7 @@ public class BatchTestITCase extends AbstractTestITCase {
customer.getNavigationLinks().add(
client.getObjectFactory().newEntityNavigationLink("Info", URI.create("$" + createRequestRef)));
uriBuilder = client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer");
uriBuilder = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer");
// add create request
createReq = client.getCUDRequestFactory().getEntityCreateRequest(uriBuilder.build(), customer);
@ -290,13 +289,13 @@ public class BatchTestITCase extends AbstractTestITCase {
assertEquals(201, res.getStatusCode());
assertTrue(res instanceof ODataEntityCreateResponse);
uriBuilder = client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer").appendKeySegment(30);
uriBuilder = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer").appendKeySegment(30);
final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(
URIUtils.getURI(testStaticServiceRootURL, uriBuilder.build() + "/Info"));
final ODataEntity navigatedInfo = req.execute().getBody();
assertEquals(infoEntity.getProperty("CustomerInfoId").getPrimitiveValue().toCastValue(Integer.class),
navigatedInfo.getProperty("CustomerInfoId").getPrimitiveValue().toCastValue(Integer.class));
}
@ -307,15 +306,13 @@ public class BatchTestITCase extends AbstractTestITCase {
// create your request
final ODataBatchRequest request = client.getBatchRequestFactory().getBatchRequest(testStaticServiceRootURL);
final BatchStreamManager streamManager = request.execute();
final BatchManager streamManager = request.payloadManager();
// -------------------------------------------
// Add retrieve item
// -------------------------------------------
ODataRetrieve retrieve = streamManager.addRetrieve();
// prepare URI
URIBuilder targetURI = client.getURIBuilder(testStaticServiceRootURL);
URIBuilder targetURI = client.newURIBuilder(testStaticServiceRootURL);
targetURI.appendEntitySetSegment("Customer").appendKeySegment(-10).
expand("Logins").select("CustomerId,Logins/Username");
@ -323,7 +320,7 @@ public class BatchTestITCase extends AbstractTestITCase {
ODataEntityRequest<ODataEntity> queryReq = client.getRetrieveRequestFactory().getEntityRequest(targetURI.build());
queryReq.setFormat(ODataPubFormat.ATOM);
retrieve.setRequest(queryReq);
streamManager.addRequest(queryReq);
// -------------------------------------------
// -------------------------------------------
@ -332,7 +329,7 @@ public class BatchTestITCase extends AbstractTestITCase {
final ODataChangeset changeset = streamManager.addChangeset();
// Update Product into the changeset
targetURI = client.getURIBuilder(testStaticServiceRootURL).
targetURI = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Product").appendKeySegment(-10);
final URI editLink = targetURI.build();
@ -351,7 +348,7 @@ public class BatchTestITCase extends AbstractTestITCase {
changeset.addRequest(changeReq);
// Create Customer into the changeset
targetURI = client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer");
targetURI = client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer");
final ODataEntity original = getSampleCustomerProfile(1000, "Sample customer", false);
final ODataEntityCreateRequest<ODataEntity> createReq =
client.getCUDRequestFactory().getEntityCreateRequest(targetURI.build(), original);
@ -360,7 +357,7 @@ public class BatchTestITCase extends AbstractTestITCase {
// Delete customer created above
targetURI =
client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer").appendKeySegment(1000);
client.newURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer").appendKeySegment(1000);
final ODataDeleteRequest deleteReq = client.getCUDRequestFactory().getDeleteRequest(targetURI.build());
changeset.addRequest(deleteReq);
// -------------------------------------------
@ -368,16 +365,15 @@ public class BatchTestITCase extends AbstractTestITCase {
// -------------------------------------------
// Add retrieve item
// -------------------------------------------
retrieve = streamManager.addRetrieve();
// prepare URI
targetURI = client.getURIBuilder(testStaticServiceRootURL).
targetURI = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Product").appendKeySegment(-10);
// create new request
queryReq = client.getRetrieveRequestFactory().getEntityRequest(targetURI.build());
retrieve.setRequest(queryReq);
streamManager.addRequest(queryReq);
// -------------------------------------------
final ODataBatchResponse response = streamManager.getResponse();
@ -387,9 +383,9 @@ public class BatchTestITCase extends AbstractTestITCase {
// retrive the first item (ODataRetrieve)
ODataBatchResponseItem item = iter.next();
assertTrue(item instanceof ODataRetrieveResponseItem);
assertTrue(item instanceof ODataSingleResponseItem);
ODataRetrieveResponseItem retitem = (ODataRetrieveResponseItem) item;
ODataSingleResponseItem retitem = (ODataSingleResponseItem) item;
ODataResponse res = retitem.next();
assertTrue(res instanceof ODataEntityResponseImpl);
assertEquals(200, res.getStatusCode());
@ -426,9 +422,9 @@ public class BatchTestITCase extends AbstractTestITCase {
// retrive the third item (ODataRetrieve)
item = iter.next();
assertTrue(item instanceof ODataRetrieveResponseItem);
assertTrue(item instanceof ODataSingleResponseItem);
retitem = (ODataRetrieveResponseItem) item;
retitem = (ODataSingleResponseItem) item;
res = retitem.next();
assertTrue(res instanceof ODataEntityResponseImpl);
assertEquals(200, res.getStatusCode());
@ -448,7 +444,7 @@ public class BatchTestITCase extends AbstractTestITCase {
super(new Wrapper<Future<HttpResponse>>());
}
public ODataStreamManager<ODataBatchResponse> addObject(byte[] src) {
public ODataPayloadManager<ODataBatchResponse> addObject(byte[] src) {
stream(src);
return this;
}
@ -499,9 +495,9 @@ public class BatchTestITCase extends AbstractTestITCase {
private static class BatchStreamingThread extends Thread {
private final BatchStreamManager streaming;
private final BatchManager streaming;
public BatchStreamingThread(final BatchStreamManager streaming) {
public BatchStreamingThread(final BatchManager streaming) {
this.streaming = streaming;
}

View File

@ -31,7 +31,7 @@ public class CountTestITCase extends AbstractTestITCase {
@Test
public void entityCount() {
CommonURIBuilder<?> uriBuilder = client.getURIBuilder(testStaticServiceRootURL).
CommonURIBuilder<?> uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Customer").count();
final ODataValueRequest req = client.getRetrieveRequestFactory().getValueRequest(uriBuilder.build());
req.setFormat(ODataValueFormat.TEXT);
@ -45,7 +45,7 @@ public class CountTestITCase extends AbstractTestITCase {
@Test
public void invalidAccept() {
final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(testStaticServiceRootURL).
final CommonURIBuilder<?> uriBuilder = client.newURIBuilder(testStaticServiceRootURL).
appendEntitySetSegment("Customer").count();
final ODataValueRequest req = client.getRetrieveRequestFactory().getValueRequest(uriBuilder.build());
req.setFormat(ODataValueFormat.TEXT);

View File

@ -227,7 +227,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
final ODataEntity original = getSampleCustomerProfile(id, "Sample customer", false);
final ODataEntityCreateRequest<ODataEntity> createReq = client.getCUDRequestFactory().getEntityCreateRequest(
client.getURIBuilder(getServiceRoot()).appendEntitySetSegment("Customer").build(), original);
client.newURIBuilder(getServiceRoot()).appendEntitySetSegment("Customer").build(), original);
createReq.setPrefer(client.newPreferences().returnNoContent());
final ODataEntityCreateResponse<ODataEntity> createRes = createReq.execute();
@ -243,7 +243,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
}
final ODataDeleteResponse deleteRes = client.getCUDRequestFactory().getDeleteRequest(
client.getURIBuilder(getServiceRoot()).appendEntitySetSegment("Customer").appendKeySegment(id).build()).
client.newURIBuilder(getServiceRoot()).appendEntitySetSegment("Customer").appendKeySegment(id).build()).
execute();
assertEquals(204, deleteRes.getStatusCode());
}
@ -253,7 +253,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
final int id = 2;
final ODataEntity original = getSampleCustomerProfile(id, "Sample customer for issue 135", false);
final URIBuilder uriBuilder = client.getURIBuilder(getServiceRoot()).appendEntitySetSegment("Customer");
final URIBuilder uriBuilder = client.newURIBuilder(getServiceRoot()).appendEntitySetSegment("Customer");
final ODataEntityCreateRequest<ODataEntity> createReq =
client.getCUDRequestFactory().getEntityCreateRequest(uriBuilder.build(), original);
createReq.setFormat(ODataPubFormat.JSON_FULL_METADATA);
@ -267,7 +267,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
fail(e.getMessage());
} finally {
final ODataDeleteResponse deleteRes = client.getCUDRequestFactory().getDeleteRequest(
client.getURIBuilder(getServiceRoot()).appendEntitySetSegment("Customer").appendKeySegment(id).
client.newURIBuilder(getServiceRoot()).appendEntitySetSegment("Customer").appendKeySegment(id).
build()).
execute();
assertEquals(204, deleteRes.getStatusCode());
@ -294,7 +294,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
client.getObjectFactory().newPrimitiveValueBuilder().buildInt32(id)));
final ODataEntityCreateRequest<ODataEntity> createReq = client.getCUDRequestFactory().getEntityCreateRequest(
client.getURIBuilder(getServiceRoot()).appendEntitySetSegment("Order").build(), order);
client.newURIBuilder(getServiceRoot()).appendEntitySetSegment("Order").build(), order);
createReq.setFormat(format);
original.addLink(client.getObjectFactory().newEntitySetNavigationLink(
@ -306,7 +306,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
// now, compare the created one with the actual one and go deeply into the associated customer info.....
final ODataEntity actual = compareEntities(getServiceRoot(), format, created, id, null);
final URIBuilder uriBuilder = client.getURIBuilder(getServiceRoot());
final URIBuilder uriBuilder = client.newURIBuilder(getServiceRoot());
uriBuilder.appendEntitySetSegment("Customer").appendKeySegment(id).appendEntitySetSegment("Orders");
final ODataEntitySetRequest<ODataEntitySet> req = client.getRetrieveRequestFactory().
@ -348,7 +348,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
// now, compare the created one with the actual one and go deeply into the associated customer info.....
final ODataEntity actual = compareEntities(getServiceRoot(), format, created, id, null);
final URIBuilder uriBuilder = client.getURIBuilder(getServiceRoot());
final URIBuilder uriBuilder = client.newURIBuilder(getServiceRoot());
uriBuilder.appendEntitySetSegment("Customer").appendKeySegment(id).appendEntitySetSegment("Info");
final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
@ -464,7 +464,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
client.getObjectFactory().newPrimitiveValueBuilder().buildBoolean(false)));
final URIBuilder builder =
client.getURIBuilder(getServiceRoot()).appendEntitySetSegment("Message");
client.newURIBuilder(getServiceRoot()).appendEntitySetSegment("Message");
final ODataEntityCreateRequest<ODataEntity> req = client.getCUDRequestFactory().
getEntityCreateRequest(builder.build(), message);
req.setFormat(format);

View File

@ -56,7 +56,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
}
private void withInlineEntry(final ODataPubFormat format) {
final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(getServiceRoot()).
final CommonURIBuilder<?> uriBuilder = client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("Customer").appendKeySegment(-10).expand("Info");
final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
@ -109,7 +109,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
}
private void withInlineFeed(final ODataPubFormat format) {
final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(getServiceRoot()).
final CommonURIBuilder<?> uriBuilder = client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("Customer").appendKeySegment(-10).expand("Orders");
final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
@ -148,7 +148,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
}
private void rawRequest(final ODataPubFormat format) {
final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(getServiceRoot()).
final CommonURIBuilder<?> uriBuilder = client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("Car").appendKeySegment(16);
final ODataRawRequest req = client.getRetrieveRequestFactory().getRawRequest(uriBuilder.build());
@ -180,7 +180,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
multiKey.put("FromUsername", "1");
multiKey.put("MessageId", -10);
final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(getServiceRoot()).
final CommonURIBuilder<?> uriBuilder = client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("Message").appendKeySegment(multiKey);
final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
@ -214,7 +214,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
private void checkForETag(final ODataPubFormat format) {
final CommonURIBuilder<?> uriBuilder =
client.getURIBuilder(getServiceRoot()).appendEntitySetSegment("Product").appendKeySegment(-10);
client.newURIBuilder(getServiceRoot()).appendEntitySetSegment("Product").appendKeySegment(-10);
final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
req.setFormat(format);
@ -231,7 +231,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
@Test(expected = IllegalArgumentException.class)
public void issue99() {
final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(getServiceRoot()).appendEntitySetSegment("Car");
final CommonURIBuilder<?> uriBuilder = client.newURIBuilder(getServiceRoot()).appendEntitySetSegment("Car");
final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
req.setFormat(ODataPubFormat.JSON);
@ -242,7 +242,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
}
private void geospatial(final ODataPubFormat format) {
final URIBuilder uriBuilder = client.getURIBuilder(getServiceRoot()).
final URIBuilder uriBuilder = client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("AllGeoTypesSet").appendKeySegment(-10);
final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());

View File

@ -99,7 +99,7 @@ public class EntitySetTestITCase extends AbstractTestITCase {
}
private void readEntitySetWithNextLink(final ODataPubFormat format) {
final URIBuilder uriBuilder = client.getURIBuilder(getServiceRoot());
final URIBuilder uriBuilder = client.newURIBuilder(getServiceRoot());
uriBuilder.appendEntitySetSegment("Customer");
final ODataEntitySetRequest<ODataEntitySet> req = client.getRetrieveRequestFactory().
@ -124,7 +124,7 @@ public class EntitySetTestITCase extends AbstractTestITCase {
}
private void readODataEntitySetIterator(final ODataPubFormat format) {
final URIBuilder uriBuilder = client.getURIBuilder(getServiceRoot());
final URIBuilder uriBuilder = client.newURIBuilder(getServiceRoot());
uriBuilder.appendEntitySetSegment("Customer");
final ODataEntitySetIteratorRequest<ODataEntitySet, ODataEntity> req =
@ -147,7 +147,7 @@ public class EntitySetTestITCase extends AbstractTestITCase {
}
private void readWithInlineCount(final ODataPubFormat format) {
final URIBuilder uriBuilder = client.getURIBuilder(getServiceRoot());
final URIBuilder uriBuilder = client.newURIBuilder(getServiceRoot());
uriBuilder.appendEntitySetSegment("Product").inlineCount(URIBuilder.InlineCount.allpages);
final ODataRawRequest req = client.getRetrieveRequestFactory().getRawRequest(uriBuilder.build());
@ -161,7 +161,7 @@ public class EntitySetTestITCase extends AbstractTestITCase {
}
private void rawRequest(final ODataPubFormat format) {
final URIBuilder uriBuilder = client.getURIBuilder(getServiceRoot());
final URIBuilder uriBuilder = client.newURIBuilder(getServiceRoot());
uriBuilder.appendEntitySetSegment("Car");
final ODataRawRequest req = client.getRetrieveRequestFactory().getRawRequest(uriBuilder.build());

View File

@ -49,7 +49,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
@Test
public void mergeAsAtom() {
final ODataPubFormat format = ODataPubFormat.ATOM;
final URI uri = client.getURIBuilder(getServiceRoot()).
final URI uri = client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("Product").appendKeySegment(-10).build();
final String etag = getETag(uri);
final ODataEntity merge = client.getObjectFactory().newEntity(TEST_PRODUCT_TYPE);
@ -60,7 +60,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
@Test
public void mergeAsJSON() {
final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
final URI uri = client.getURIBuilder(getServiceRoot()).
final URI uri = client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("Product").appendKeySegment(-10).build();
final String etag = getETag(uri);
final ODataEntity merge = client.getObjectFactory().newEntity(TEST_PRODUCT_TYPE);
@ -71,7 +71,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
@Test
public void patchAsAtom() {
final ODataPubFormat format = ODataPubFormat.ATOM;
final URI uri = client.getURIBuilder(getServiceRoot()).
final URI uri = client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("Product").appendKeySegment(-10).build();
final String etag = getETag(uri);
final ODataEntity patch = client.getObjectFactory().newEntity(TEST_PRODUCT_TYPE);
@ -82,7 +82,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
@Test
public void patchAsJSON() {
final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
final URI uri = client.getURIBuilder(getServiceRoot()).
final URI uri = client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("Product").appendKeySegment(-10).build();
final String etag = getETag(uri);
final ODataEntity patch = client.getObjectFactory().newEntity(TEST_PRODUCT_TYPE);
@ -93,7 +93,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
@Test
public void replaceAsAtom() {
final ODataPubFormat format = ODataPubFormat.ATOM;
final ODataEntity changes = read(format, client.getURIBuilder(getServiceRoot()).
final ODataEntity changes = read(format, client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("Car").appendKeySegment(14).build());
updateEntityDescription(format, changes, UpdateType.REPLACE);
}
@ -101,7 +101,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
@Test
public void replaceAsJSON() {
final ODataPubFormat format = ODataPubFormat.JSON_FULL_METADATA;
final ODataEntity changes = read(format, client.getURIBuilder(getServiceRoot()).
final ODataEntity changes = read(format, client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("Car").appendKeySegment(14).build());
updateEntityDescription(format, changes, UpdateType.REPLACE);
}
@ -117,7 +117,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
}
public void patchLink(final ODataPubFormat format) throws EdmPrimitiveTypeException {
final URI uri = client.getURIBuilder(getServiceRoot()).
final URI uri = client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("Customer").appendKeySegment(-10).build();
final ODataEntity patch = client.getObjectFactory().
@ -127,14 +127,14 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
// ---------------------------------------
// Update to CustomerInfo(12)
// ---------------------------------------
URI customerInfoURI = client.getURIBuilder(getServiceRoot()).
URI customerInfoURI = client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("CustomerInfo").appendKeySegment(12).build();
patch.addLink(client.getObjectFactory().newEntityNavigationLink("Info", customerInfoURI));
update(UpdateType.PATCH, patch, format, null);
customerInfoURI = client.getURIBuilder(getServiceRoot()).
customerInfoURI = client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("Customer").appendKeySegment(-10).appendNavigationSegment("Info").build();
ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(customerInfoURI);
@ -151,7 +151,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
// ---------------------------------------
patch.getNavigationLinks().clear();
customerInfoURI = client.getURIBuilder(getServiceRoot()).
customerInfoURI = client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("CustomerInfo").appendKeySegment(11).build();
read(format, customerInfoURI);
@ -159,7 +159,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
update(UpdateType.PATCH, patch, format, null);
customerInfoURI = client.getURIBuilder(getServiceRoot()).
customerInfoURI = client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("Customer").appendKeySegment(-10).appendNavigationSegment("Info").build();
req = client.getRetrieveRequestFactory().getEntityRequest(customerInfoURI);
@ -178,7 +178,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
final LinkedHashMap<String, Object> multiKey = new LinkedHashMap<String, Object>();
multiKey.put("FromUsername", "1");
multiKey.put("MessageId", -10);
final ODataEntity message = read(format, client.getURIBuilder(getServiceRoot()).
final ODataEntity message = read(format, client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("Message").appendKeySegment(multiKey).build());
message.getAssociationLinks().clear();
message.getNavigationLinks().clear();
@ -222,7 +222,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
@Test
public void concurrentModification() {
final URI uri = client.getURIBuilder(getServiceRoot()).
final URI uri = client.newURIBuilder(getServiceRoot()).
appendEntitySetSegment("Product").appendKeySegment(-10).build();
String etag = getETag(uri);
final ODataEntity product = client.getObjectFactory().newEntity(TEST_PRODUCT_TYPE);

View File

@ -38,12 +38,8 @@ import org.apache.olingo.client.api.uri.v3.URIBuilder;
import org.apache.olingo.client.api.v3.ODataClient;
import org.apache.olingo.client.core.communication.request.AbstractODataBasicRequest;
import org.apache.olingo.client.core.communication.response.AbstractODataResponse;
import org.apache.olingo.client.core.uri.URIUtils;
import org.apache.olingo.commons.api.domain.v3.ODataEntity;
import org.apache.olingo.commons.api.domain.v3.ODataEntitySet;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
import org.apache.olingo.commons.api.edm.EdmFunctionImport;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.format.ODataPubFormat;
import org.junit.Test;
@ -88,7 +84,7 @@ public class ErrorTestITCase extends AbstractTestITCase {
}
private void stacktraceError(final ODataPubFormat format) {
final URIBuilder uriBuilder = client.getURIBuilder(testStaticServiceRootURL);
final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL);
uriBuilder.appendEntitySetSegment("Customer");
final ErrorGeneratingRequest errorReq = new ErrorGeneratingRequest(HttpMethod.POST, uriBuilder.build());
@ -115,7 +111,7 @@ public class ErrorTestITCase extends AbstractTestITCase {
}
private void notfoundError(final ODataPubFormat format) {
final URIBuilder uriBuilder = client.getURIBuilder(testStaticServiceRootURL);
final URIBuilder uriBuilder = client.newURIBuilder(testStaticServiceRootURL);
uriBuilder.appendEntitySetSegment("Customer(154)");
final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
@ -143,16 +139,10 @@ public class ErrorTestITCase extends AbstractTestITCase {
}
private void instreamError(final ODataPubFormat format) {
final Edm metadata =
client.getRetrieveRequestFactory().getMetadataRequest(testStaticServiceRootURL).execute().getBody();
assertNotNull(metadata);
final EdmEntityContainer container = metadata.getSchemas().get(0).getEntityContainer();
final EdmFunctionImport funcImp = container.getFunctionImport("InStreamErrorGetCustomer");
final URIBuilder builder = client.getURIBuilder(testStaticServiceRootURL).
appendOperationCallSegment(URIUtils.operationImportURISegment(container, funcImp.getName()));
final URIBuilder builder = client.newURIBuilder(testStaticServiceRootURL).
appendOperationCallSegment("InStreamErrorGetCustomer");
final ODataInvokeRequest<ODataEntitySet> req =
client.getInvokeRequestFactory().getInvokeRequest(builder.build(), funcImp.getUnboundFunction(null));
client.getInvokeRequestFactory().getFunctionInvokeRequest(builder.build(), ODataEntitySet.class);
req.setFormat(format);
final ODataInvokeResponse<ODataEntitySet> res = req.execute();

Some files were not shown because too many files have changed in this diff Show More