[OLINGO-260] provided proxy entity create mechanism; still working on EntityCreateTestITCase since it seems to hang the integration tests when executed with others

This commit is contained in:
fmartelli 2014-05-11 18:05:39 +02:00
parent ec30775b8c
commit f1cbc4aff6
195 changed files with 1172 additions and 426 deletions

View File

@ -31,8 +31,6 @@ import org.apache.olingo.client.api.CommonEdmEnabledODataClient;
import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
import org.apache.olingo.client.core.uri.URIUtils;
import org.apache.olingo.commons.api.domain.CommonODataEntity;
import org.apache.olingo.commons.api.domain.CommonODataProperty;
import org.apache.olingo.commons.api.domain.ODataComplexValue;
import org.apache.olingo.commons.api.domain.ODataInlineEntity;
import org.apache.olingo.commons.api.domain.ODataInlineEntitySet;
import org.apache.olingo.commons.api.domain.ODataLink;
@ -40,19 +38,25 @@ import org.apache.olingo.commons.api.domain.ODataLinked;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.ext.proxy.EntityContainerFactory;
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
import org.apache.olingo.ext.proxy.api.annotations.ComplexType;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.context.AttachedEntityStatus;
import org.apache.olingo.ext.proxy.context.EntityContext;
import org.apache.olingo.ext.proxy.utils.ClassUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public abstract class AbstractTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?>>
extends AbstractInvocationHandler<C> {
private static final long serialVersionUID = 2629912294765040037L;
/**
* Logger.
*/
protected static final Logger LOG = LoggerFactory.getLogger(AbstractTypeInvocationHandler.class);
protected final Class<?> typeRef;
protected final EntityContext entityContext = EntityContainerFactory.getContext().entityContext();
@ -104,11 +108,17 @@ public abstract class AbstractTypeInvocationHandler<C extends CommonEdmEnabledOD
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {returnType},
OperationInvocationHandler.getInstance(targetHandler));
} else if ("factory".equals(method.getName()) && ArrayUtils.isEmpty(args)) {
final Class<?> returnType = method.getReturnType();
return Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {returnType},
FactoryInvocationHandler.getInstance(targetHandler, 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
final Object res;
final Method getter = typeRef.getMethod(method.getName());
final Property property = ClassUtils.getAnnotation(Property.class, getter);
@ -152,22 +162,6 @@ public abstract class AbstractTypeInvocationHandler<C extends CommonEdmEnabledOD
}
return ClassUtils.returnVoid();
} else if (method.getName().startsWith("new")) {
// get the corresponding getter method (see assumption above)
final String getterName = method.getName().replaceFirst("new", "get");
final Method getter = typeRef.getMethod(getterName);
final Property property = ClassUtils.getAnnotation(Property.class, getter);
if (property == null) {
throw new UnsupportedOperationException("Unsupported method " + method.getName());
}
final ComplexTypeInvocationHandler<C> complexTypeHandler = newComplex(property.name(), getter.getReturnType());
return Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {getter.getReturnType()},
complexTypeHandler);
} else {
throw new UnsupportedOperationException("Method not found: " + method);
}
@ -193,39 +187,6 @@ public abstract class AbstractTypeInvocationHandler<C extends CommonEdmEnabledOD
}
}
@SuppressWarnings({"unchecked"})
protected ComplexTypeInvocationHandler<C> newComplex(final String propertyName, final Class<?> reference) {
final Class<?> complexTypeRef;
final boolean isCollection;
if (Collection.class.isAssignableFrom(reference)) {
complexTypeRef = ClassUtils.extractTypeArg(reference);
isCollection = true;
} else {
complexTypeRef = reference;
isCollection = false;
}
final ComplexType annotation = complexTypeRef.getAnnotation(ComplexType.class);
if (annotation == null) {
throw new IllegalArgumentException("Invalid complex type " + complexTypeRef);
}
final FullQualifiedName typeName =
new FullQualifiedName(ClassUtils.getNamespace(complexTypeRef), annotation.name());
final ODataComplexValue<? extends CommonODataProperty> complex =
client.getObjectFactory().newComplexValue(typeName.toString());
final ComplexTypeInvocationHandler<C> handler = (ComplexTypeInvocationHandler<C>) ComplexTypeInvocationHandler.
getInstance(complex, complexTypeRef, targetHandler);
attach(AttachedEntityStatus.CHANGED);
addPropertyChanges(propertyName, handler, isCollection);
return handler;
}
protected abstract Object getNavigationPropertyValue(final NavigationProperty property, final Method getter);
protected Object retriveNavigationProperty(final NavigationProperty property, final Method getter) {
@ -296,7 +257,7 @@ public abstract class AbstractTypeInvocationHandler<C extends CommonEdmEnabledOD
}
public void addAdditionalProperty(final String name, final Object value) {
addPropertyChanges(name, value, false);
addPropertyChanges(name, value);
attach(AttachedEntityStatus.CHANGED);
}
@ -338,7 +299,7 @@ public abstract class AbstractTypeInvocationHandler<C extends CommonEdmEnabledOD
protected abstract void setPropertyValue(final Property property, final Object value);
protected abstract void addPropertyChanges(final String name, final Object value, final boolean isCollection);
protected abstract void addPropertyChanges(final String name, final Object value);
protected abstract void addLinkChanges(final NavigationProperty navProp, final Object value);

View File

@ -20,8 +20,10 @@ package org.apache.olingo.ext.proxy.commons;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Proxy;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
@ -30,6 +32,7 @@ import org.apache.olingo.client.api.CommonEdmEnabledODataClient;
import org.apache.olingo.commons.api.domain.CommonODataProperty;
import org.apache.olingo.commons.api.domain.ODataComplexValue;
import org.apache.olingo.commons.api.domain.ODataLinked;
import org.apache.olingo.commons.api.domain.ODataValue;
import org.apache.olingo.commons.api.edm.EdmElement;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.core.edm.EdmTypeInfo;
@ -45,13 +48,41 @@ public class ComplexTypeInvocationHandler<C extends CommonEdmEnabledODataClient<
private static final long serialVersionUID = 2629912294765040037L;
public static ComplexTypeInvocationHandler<?> getInstance(
final CommonEdmEnabledODataClient<?> client,
final String propertyName,
final Class<?> reference,
final EntityTypeInvocationHandler<?> handler) {
final Class<?> complexTypeRef;
if (Collection.class.isAssignableFrom(reference)) {
complexTypeRef = ClassUtils.extractTypeArg(reference);
} else {
complexTypeRef = reference;
}
final ComplexType annotation = complexTypeRef.getAnnotation(ComplexType.class);
if (annotation == null) {
throw new IllegalArgumentException("Invalid complex type " + complexTypeRef);
}
final FullQualifiedName typeName =
new FullQualifiedName(ClassUtils.getNamespace(complexTypeRef), annotation.name());
final ODataComplexValue<? extends CommonODataProperty> complex =
client.getObjectFactory().newComplexValue(typeName.toString());
return (ComplexTypeInvocationHandler<?>) ComplexTypeInvocationHandler.getInstance(
client, complex, complexTypeRef, handler);
}
@SuppressWarnings({"unchecked", "rawtypes"})
static ComplexTypeInvocationHandler<?> getInstance(
final CommonEdmEnabledODataClient<?> client,
final ODataComplexValue<?> complex,
final Class<?> typeRef,
final EntityTypeInvocationHandler<?> handler) {
return new ComplexTypeInvocationHandler(handler.targetHandler.getClient(), complex, typeRef, handler);
return new ComplexTypeInvocationHandler(client, complex, typeRef, handler);
}
public ComplexTypeInvocationHandler(
@ -83,19 +114,38 @@ public class ComplexTypeInvocationHandler<C extends CommonEdmEnabledODataClient<
final Object res;
final CommonODataProperty property = getComplex().get(name);
if (property.hasComplexValue()) {
if (property == null) {
res = null;
} else if (property.hasComplexValue()) {
res = Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {(Class<?>) type},
newComplex(name, (Class<?>) type));
ComplexTypeInvocationHandler.getInstance(
client, property.getValue().asComplex(), (Class<?>) type, targetHandler));
CoreUtils.populate(
client.getCachedEdm(),
res,
(Class<?>) type,
Property.class,
property.getValue().asComplex().iterator());
} else if (property.hasCollectionValue()) {
final ParameterizedType collType = (ParameterizedType) type;
final Class<?> collItemClass = (Class<?>) collType.getActualTypeArguments()[0];
final ArrayList<Object> collection = new ArrayList<Object>();
final Iterator<ODataValue> collPropItor = property.getValue().asCollection().iterator();
while (collPropItor.hasNext()) {
final ODataValue value = collPropItor.next();
if (value.isPrimitive()) {
collection.add(CoreUtils.primitiveValueToObject(value.asPrimitive()));
} else if (value.isComplex()) {
final Object collItem = Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {collItemClass},
ComplexTypeInvocationHandler.getInstance(
client, value.asComplex(), collItemClass, targetHandler));
collection.add(collItem);
}
}
res = collection;
} else {
res = type == null
? CoreUtils.getValueFromProperty(client, property)
@ -131,17 +181,34 @@ public class ComplexTypeInvocationHandler<C extends CommonEdmEnabledODataClient<
}
@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 Object toBeAdded;
if (value == null) {
toBeAdded = null;
} 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);
}
} else if (value instanceof Proxy) {
toBeAdded = Proxy.getInvocationHandler(value);
} else {
toBeAdded = value;
}
final EdmTypeInfo type = new EdmTypeInfo.Builder().
setEdm(client.getCachedEdm()).setTypeExpression(
edmProperty.isCollection() ? "Collection(" + property.type() + ")" : property.type()).build();
edmProperty.isCollection() ? "Collection(" + property.type() + ")" : property.type()).build();
client.getBinder().add(getComplex(), CoreUtils.getODataProperty(client, property.name(), type, value));
client.getBinder().add(
getComplex(), CoreUtils.getODataProperty(client, property.name(), type, toBeAdded));
if (targetHandler != null && !entityContext.isAttached(targetHandler)) {
entityContext.attach(targetHandler, AttachedEntityStatus.CHANGED);
@ -158,7 +225,7 @@ public class ComplexTypeInvocationHandler<C extends CommonEdmEnabledODataClient<
}
@Override
protected void addPropertyChanges(final String name, final Object value, final boolean isCollection) {
protected void addPropertyChanges(final String name, final Object value) {
// do nothing ....
}

View File

@ -21,6 +21,7 @@ package org.apache.olingo.ext.proxy.commons;
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Proxy;
import java.lang.reflect.Type;
import java.net.URI;
@ -28,6 +29,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.apache.commons.io.IOUtils;
@ -38,6 +40,7 @@ import org.apache.olingo.client.core.uri.URIUtils;
import org.apache.olingo.commons.api.domain.CommonODataEntity;
import org.apache.olingo.commons.api.domain.CommonODataProperty;
import org.apache.olingo.commons.api.domain.ODataLinked;
import org.apache.olingo.commons.api.domain.ODataValue;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.format.ODataMediaFormat;
@ -107,7 +110,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
containerHandler.getEntityContainerName(),
entitySetName,
entity.getTypeName(),
CoreUtils.getKey(client.getCachedEdm(), typeRef, entity));
CoreUtils.getKey(client, typeRef, entity));
this.stream = null;
}
@ -120,7 +123,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
getUUID().getContainerName(),
getUUID().getEntitySetName(),
getUUID().getName(),
CoreUtils.getKey(client.getCachedEdm(), typeRef, entity));
CoreUtils.getKey(client, typeRef, entity));
this.propertyChanges.clear();
this.linkChanges.clear();
@ -193,35 +196,52 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
protected Object getPropertyValue(final String name, final Type type) {
try {
final Object res;
final CommonODataProperty property = entity.getProperty(name);
if (propertyChanges.containsKey(name)) {
res = property.hasComplexValue()
? Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {(Class<?>) type},
(ComplexTypeInvocationHandler<?>) propertyChanges.get(name))
: propertyChanges.get(name);
res = propertyChanges.get(name);
} else if (property == null) {
res = null;
} else if (property.hasComplexValue()) {
res = Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {(Class<?>) type},
newComplex(name, (Class<?>) type));
ComplexTypeInvocationHandler.getInstance(
client, property.getValue().asComplex(), (Class<?>) type, this));
CoreUtils.populate(
client.getCachedEdm(),
res,
(Class<?>) type,
Property.class,
property.getValue().asComplex().iterator());
addPropertyChanges(name, res);
} else if (property.hasCollectionValue()) {
final ParameterizedType collType = (ParameterizedType) type;
final Class<?> collItemClass = (Class<?>) collType.getActualTypeArguments()[0];
final ArrayList<Object> collection = new ArrayList<Object>();
final Iterator<ODataValue> collPropItor = property.getValue().asCollection().iterator();
while (collPropItor.hasNext()) {
final ODataValue value = collPropItor.next();
if (value.isPrimitive()) {
collection.add(CoreUtils.primitiveValueToObject(value.asPrimitive()));
} else if (value.isComplex()) {
final Object collItem = Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {collItemClass},
ComplexTypeInvocationHandler.getInstance(
client, value.asComplex(), collItemClass, this));
collection.add(collItem);
}
}
res = collection;
addPropertyChanges(name, res);
} else {
res = type == null
? CoreUtils.getValueFromProperty(client, property)
: CoreUtils.getValueFromProperty(client, property, type);
if (res != null) {
addPropertyChanges(name, res, false);
addPropertyChanges(name, res);
}
}
@ -256,11 +276,27 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
}
@Override
@SuppressWarnings("unchecked")
protected void setPropertyValue(final Property property, final Object value) {
if (property.type().equalsIgnoreCase(EdmPrimitiveTypeKind.Stream.toString())) {
setStreamedProperty(property, (InputStream) value);
} else {
addPropertyChanges(property.name(), value, false);
final Object toBeAdded;
if (value == null) {
toBeAdded = null;
} 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);
}
} else if (value instanceof Proxy) {
toBeAdded = Proxy.getInvocationHandler(value);
} else {
toBeAdded = value;
}
addPropertyChanges(property.name(), toBeAdded);
}
attach(AttachedEntityStatus.CHANGED);
@ -360,22 +396,9 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
@Override
@SuppressWarnings("unchecked")
protected void addPropertyChanges(final String name, final Object value, final boolean isCollection) {
protected void addPropertyChanges(final String name, final Object value) {
int checkpoint = propertyChanges.hashCode();
if (isCollection) {
Object collItem = propertyChanges.get(name);
if (collItem == null) {
collItem = new ArrayList<Object>();
propertyChanges.put(name, collItem);
}
((Collection<Object>) collItem).add(value);
} else {
propertyChanges.put(name, value);
}
propertyChanges.put(name, value);
updatePropertiesTag(checkpoint);
}

View File

@ -0,0 +1,84 @@
/*
* 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.OperationExecutor;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.utils.ClassUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
class FactoryInvocationHandler<C extends CommonEdmEnabledODataClient<?>> extends AbstractInvocationHandler<C>
implements OperationExecutor {
private static final long serialVersionUID = 2629912294765040027L;
/**
* Logger.
*/
private static final Logger LOG = LoggerFactory.getLogger(FactoryInvocationHandler.class);
private final EntityTypeInvocationHandler<C> entityHandler;
private final AbstractTypeInvocationHandler<C> invokerHandler;
@SuppressWarnings({"rawtypes", "unchecked"})
static FactoryInvocationHandler<?> getInstance(
final EntityTypeInvocationHandler<?> entityHandler,
final AbstractTypeInvocationHandler<?> targetHandler) {
return new FactoryInvocationHandler(entityHandler, targetHandler);
}
@SuppressWarnings("unchecked")
private FactoryInvocationHandler(
final EntityTypeInvocationHandler<C> entityHandler,
final AbstractTypeInvocationHandler<C> targetHandler) {
super(targetHandler.containerHandler.getClient(), targetHandler.containerHandler);
this.invokerHandler = targetHandler;
this.entityHandler = entityHandler;
}
@Override
@SuppressWarnings("unchecked")
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("new")) {
final String getterName = method.getName().replaceFirst("new", "get");
final Method getter = invokerHandler.getTypeRef().getMethod(getterName);
final Property property = ClassUtils.getAnnotation(Property.class, getter);
if (property == null) {
throw new UnsupportedOperationException("Unsupported method " + method.getName());
}
final ComplexTypeInvocationHandler<?> complexTypeHandler =
ComplexTypeInvocationHandler.getInstance(client, property.name(), method.getReturnType(), entityHandler);
return Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {method.getReturnType()},
complexTypeHandler);
} else {
throw new UnsupportedOperationException("Method not found: " + method);
}
}
}

View File

@ -19,6 +19,7 @@
package org.apache.olingo.ext.proxy.utils;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
@ -41,7 +42,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.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmElement;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
import org.apache.olingo.commons.api.edm.EdmType;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
@ -51,6 +52,7 @@ import org.apache.olingo.ext.proxy.api.annotations.ComplexType;
import org.apache.olingo.ext.proxy.api.annotations.CompoundKeyElement;
import org.apache.olingo.ext.proxy.api.annotations.Key;
import org.apache.olingo.ext.proxy.api.annotations.Property;
import org.apache.olingo.ext.proxy.commons.AbstractTypeInvocationHandler;
import org.apache.olingo.ext.proxy.commons.ComplexTypeInvocationHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -97,13 +99,20 @@ public final class CoreUtils {
} else if (type.isComplexType()) {
value = client.getObjectFactory().newComplexValue(type.getFullQualifiedName().toString());
if (obj instanceof ComplexTypeInvocationHandler<?>) {
final Class<?> typeRef = ((ComplexTypeInvocationHandler<?>)obj).getTypeRef();
final Object complex = Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {typeRef},
(ComplexTypeInvocationHandler<?>)obj);
final Object oo;
if (obj instanceof Proxy) {
oo = Proxy.getInvocationHandler(obj);
} else {
oo = obj;
}
if (oo instanceof ComplexTypeInvocationHandler<?>) {
final Class<?> typeRef = ((ComplexTypeInvocationHandler<?>) oo).getTypeRef();
final Object complex = Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {typeRef},
(ComplexTypeInvocationHandler<?>) oo);
for (Method method : typeRef.getMethods()) {
final Property complexPropertyAnn = method.getAnnotation(Property.class);
try {
@ -113,12 +122,13 @@ public final class CoreUtils {
}
} catch (Exception ignore) {
// ignore value
LOG.warn("Error attaching complex field '{}'", complexPropertyAnn.name(), ignore);
LOG.warn("Error attaching complex {} for field '{}.{}'",
type.getFullQualifiedName(), typeRef.getName(), complexPropertyAnn.name(), ignore);
}
}
} else {
throw new IllegalArgumentException(
"Object '" + obj.getClass().getSimpleName() + "' is not a complex value");
"Object '" + oo.getClass().getSimpleName() + "' is not a complex value");
}
} else if (type.isEnumType()) {
if (client.getServiceVersion().compareTo(ODataServiceVersion.V30) <= 0) {
@ -135,17 +145,14 @@ public final class CoreUtils {
return value;
}
private static CommonODataProperty getODataProperty(
private static CommonODataProperty getODataEntityProperty(
final CommonEdmEnabledODataClient<?> client,
final FullQualifiedName entity,
final String property,
final Object obj) {
final EdmType edmType = client.getCachedEdm().getEntityType(entity).getProperty(property).getType();
final EdmTypeInfo type = new EdmTypeInfo.Builder().
setEdm(client.getCachedEdm()).setTypeExpression(edmType.getFullQualifiedName().toString()).build();
return getODataProperty(client, property, type, obj);
final EdmElement edmProperty = client.getCachedEdm().getEntityType(entity).getProperty(property);
return getODataProperty(client, edmProperty, property, obj);
}
private static CommonODataProperty getODataComplexProperty(
@ -154,9 +161,22 @@ public final class CoreUtils {
final String property,
final Object obj) {
final EdmType edmType = client.getCachedEdm().getComplexType(complex).getProperty(property).getType();
final EdmTypeInfo type = new EdmTypeInfo.Builder().
setEdm(client.getCachedEdm()).setTypeExpression(edmType.getFullQualifiedName().toString()).build();
final EdmElement edmProperty = client.getCachedEdm().getComplexType(complex).getProperty(property);
return getODataProperty(client, edmProperty, property, obj);
}
private static CommonODataProperty getODataProperty(
final CommonEdmEnabledODataClient<?> client,
final EdmElement edmProperty,
final String property,
final Object obj) {
final EdmType edmType = edmProperty.getType();
final EdmTypeInfo type = new EdmTypeInfo.Builder().setEdm(client.getCachedEdm()).setTypeExpression(
edmProperty.isCollection()
? "Collection(" + edmType.getFullQualifiedName().toString() + ")"
: edmType.getFullQualifiedName().toString()).build();
return getODataProperty(client, property, type, obj);
}
@ -184,8 +204,8 @@ public final class CoreUtils {
} else {
oprop = ((org.apache.olingo.commons.api.domain.v4.ODataObjectFactory) client.getObjectFactory()).
newEnumProperty(name,
((org.apache.olingo.commons.api.domain.v4.ODataValue) getODataValue(client, type, obj)).
asEnum());
((org.apache.olingo.commons.api.domain.v4.ODataValue) getODataValue(client, type, obj)).
asEnum());
}
} else {
throw new UnsupportedOperationException("Usupported object type " + type.getFullQualifiedName());
@ -211,11 +231,11 @@ public final class CoreUtils {
}
((List<CommonODataProperty>) entity.getProperties()).add(
getODataProperty(client, entity.getTypeName(), property.getKey(), property.getValue()));
getODataEntityProperty(client, entity.getTypeName(), property.getKey(), property.getValue()));
}
}
private static Object primitiveValueToObject(final ODataPrimitiveValue value) {
public static Object primitiveValueToObject(final ODataPrimitiveValue value) {
Object obj;
try {
@ -239,7 +259,7 @@ public final class CoreUtils {
}
public static Object getKey(
final Edm metadata, final Class<?> entityTypeRef, final CommonODataEntity entity) {
final CommonEdmEnabledODataClient<?> client, final Class<?> entityTypeRef, final CommonODataEntity entity) {
Object res = null;
@ -253,7 +273,7 @@ public final class CoreUtils {
} else {
try {
res = keyRef.newInstance();
populate(metadata, res, CompoundKeyElement.class, entity.getProperties().iterator());
populate(client, res, CompoundKeyElement.class, entity.getProperties().iterator());
} catch (Exception e) {
LOG.error("Error population compound key {}", keyRef.getSimpleName(), e);
throw new IllegalArgumentException("Cannot populate compound key");
@ -265,19 +285,30 @@ public final class CoreUtils {
}
public static void populate(
final Edm metadata,
final CommonEdmEnabledODataClient<?> client,
final Object bean,
final Class<? extends Annotation> getterAnn,
final Iterator<? extends CommonODataProperty> propItor) {
if (bean != null) {
populate(metadata, bean, bean.getClass(), getterAnn, propItor);
final Class<?> typeRef;
if (bean instanceof Proxy) {
final InvocationHandler handler = Proxy.getInvocationHandler(bean);
if (handler instanceof AbstractTypeInvocationHandler) {
typeRef = ((ComplexTypeInvocationHandler<?>) handler).getTypeRef();
} else {
throw new IllegalStateException("Invalid bean " + bean);
}
} else {
typeRef = bean.getClass();
}
populate(client, bean, typeRef, getterAnn, propItor);
}
}
@SuppressWarnings({"unchecked"})
public static void populate(
final Edm metadata,
final CommonEdmEnabledODataClient<?> client,
final Object bean,
final Class<?> reference,
final Class<? extends Annotation> getterAnn,
@ -296,16 +327,18 @@ public final class CoreUtils {
try {
if (property.hasNullValue()) {
setPropertyValue(bean, getter, null);
}
if (property.hasPrimitiveValue()) {
} else if (property.hasPrimitiveValue()) {
setPropertyValue(bean, getter, primitiveValueToObject(property.getPrimitiveValue()));
}
if (property.hasComplexValue()) {
final Object complex = getter.getReturnType().newInstance();
populate(metadata, complex, Property.class, property.getValue().asComplex().iterator());
} else if (property.hasComplexValue()) {
final Object complex = Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {getter.getReturnType()},
ComplexTypeInvocationHandler.getInstance(
client, property.getName(), getter.getReturnType(), null));
populate(client, complex, Property.class, property.getValue().asComplex().iterator());
setPropertyValue(bean, getter, complex);
}
if (property.hasCollectionValue()) {
} else if (property.hasCollectionValue()) {
final ParameterizedType collType = (ParameterizedType) getter.getGenericReturnType();
final Class<?> collItemClass = (Class<?>) collType.getActualTypeArguments()[0];
@ -320,10 +353,14 @@ public final class CoreUtils {
final ODataValue value = collPropItor.next();
if (value.isPrimitive()) {
collection.add(primitiveValueToObject(value.asPrimitive()));
}
if (value.isComplex()) {
final Object collItem = collItemClass.newInstance();
populate(metadata, collItem, Property.class, value.asComplex().iterator());
} else if (value.isComplex()) {
final Object collItem = Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {collItemClass},
ComplexTypeInvocationHandler.getInstance(
client, property.getName(), collItemClass, null));
populate(client, collItem, Property.class, value.asComplex().iterator());
collection.add(collItem);
}
}
@ -356,14 +393,14 @@ public final class CoreUtils {
}
if (odataValue.isComplex()) {
final Object collItem =
buildComplexInstance(client.getCachedEdm(), property.getName(), odataValue.asComplex().iterator());
buildComplexInstance(client, property.getName(), odataValue.asComplex().iterator());
((Collection) value).add(collItem);
}
}
} else if (property.hasPrimitiveValue()) {
value = primitiveValueToObject(property.getPrimitiveValue());
} else if (property.hasComplexValue()) {
value = buildComplexInstance(client.getCachedEdm(), property.getValue().asComplex().getTypeName(),
value = buildComplexInstance(client, property.getValue().asComplex().getTypeName(),
property.getValue().asComplex().iterator());
} else {
throw new IllegalArgumentException("Invalid property " + property);
@ -374,14 +411,16 @@ public final class CoreUtils {
@SuppressWarnings("unchecked")
private static <C extends AbstractComplexType> C buildComplexInstance(
final Edm metadata, final String name, final Iterator<CommonODataProperty> properties) {
final CommonEdmEnabledODataClient<?> client,
final String name,
final Iterator<CommonODataProperty> properties) {
for (C complex : (Iterable<C>) ServiceLoader.load(AbstractComplexType.class)) {
final ComplexType ann = complex.getClass().getAnnotation(ComplexType.class);
final String fn = ann == null ? null : ClassUtils.getNamespace(complex.getClass()) + "." + ann.name();
if (name.equals(fn)) {
populate(metadata, complex, Property.class, properties);
populate(client, complex, Property.class, properties);
return complex;
}
}
@ -391,7 +430,8 @@ public final class CoreUtils {
@SuppressWarnings({"unchecked", "rawtypes"})
public static Object getValueFromProperty(
final CommonEdmEnabledODataClient<?> client, final CommonODataProperty property, final Type type)
final CommonEdmEnabledODataClient<?> client,
final CommonODataProperty property, final Type type)
throws InstantiationException, IllegalAccessException {
final Object value;
@ -415,7 +455,7 @@ public final class CoreUtils {
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {collItemClass},
new ComplexTypeInvocationHandler(client, odataValue.asComplex(), collItemClass, null));
populate(client.getCachedEdm(), collItem, Property.class, odataValue.asComplex().iterator());
populate(client, collItem, Property.class, odataValue.asComplex().iterator());
((Collection) value).add(collItem);
}
}

View File

@ -36,6 +36,7 @@ import org.apache.olingo.commons.api.edm.EdmEntityType;
import org.apache.olingo.commons.api.edm.EdmFunction;
import org.apache.olingo.commons.api.edm.EdmKeyPropertyRef;
import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
import org.apache.olingo.commons.api.edm.EdmOperation;
import org.apache.olingo.commons.api.edm.EdmParameter;
import org.apache.olingo.commons.api.edm.EdmProperty;
import org.apache.olingo.commons.api.edm.EdmSchema;
@ -205,6 +206,17 @@ public abstract class AbstractUtility {
return result;
}
public List<EdmOperation> justInheritedOperationsBoundTo(final EdmEntityType entity){
final List<EdmOperation> result = new ArrayList<EdmOperation>();
if(entity.getBaseType()!=null){
result.addAll(getFunctionsBoundTo(entity.getBaseType().getName(), false));
result.addAll(getActionsBoundTo(entity.getBaseType().getName(), false));
result.addAll(justInheritedOperationsBoundTo(entity.getBaseType()));
}
return result;
}
public List<EdmAction> getActionsBoundTo(final String typeExpression, final boolean collection) {
final List<EdmAction> result = new ArrayList<EdmAction>();

View File

@ -69,6 +69,7 @@ public interface $utility.capitalize($entityType.Name)
#if(!$keys.add($key.KeyPropertyName)) #stop #end
#end
#set( $complexProps = [] )
#foreach($propertyName in $entityType.PropertyNames)
#set($property = $entityType.getProperty($propertyName))
#set($fcprops = $utility.getFcProperties($property) )
@ -96,7 +97,7 @@ public interface $utility.capitalize($entityType.Name)
void set$utility.capitalize($property.Name)(final $utility.getJavaType($property.Type, $property.Collection) _$utility.uncapitalize($property.Name));
#if($utility.isComplex($property.Type.FullQualifiedName))#*
*#$utility.getJavaType($property.Type) new$utility.capitalize($property.Name)();
*##set( $adding = $complexProps.add($property) )
#end
#end
@ -125,10 +126,15 @@ public interface $utility.capitalize($entityType.Name)
#set( $functions = $utility.getFunctionsBoundTo($entityType.Name, false) )
#set( $actions = $utility.getActionsBoundTo($entityType.Name, false) )
#if( $functions.size() > 0 || $actions.size() > 0 )
#set( $inherited = $utility.justInheritedOperationsBoundTo($entityType).size())
#if( $inherited.size() > 0 || $functions.size() > 0 || $actions.size() > 0 )
#if($inherited.size() > 0)
@Overide
#end
Operations operations();
public interface Operations {
interface Operations #if($inherited.size() > 0)
extends ${utility.getJavaType($entityType.getBaseType())}.Operations#end{
#foreach($operation in $functions)
@Operation(name = "$operation.Name",
type = OperationType.FUNCTION,
@ -169,4 +175,21 @@ public interface $utility.capitalize($entityType.Name)
#end
}
#end
#if( $complexProps.size() > 0 )
#if( $entityType.baseType )
@Override
#end
ComplexFactory factory();
interface ComplexFactory #if( $entityType.baseType )
extends ${utility.getJavaType($entityType.getBaseType())}.ComplexFactory#end{
#foreach($property in $complexProps)
@Property(name = "$property.Name",
type = "$property.Type.FullQualifiedName.toString()")
$utility.getJavaType($property.Type) new$utility.capitalize($property.Name)();
#end
}
#end
}

View File

@ -18,8 +18,10 @@
*#
@Namespace("$namespace")
@ComplexType(name = "$complexType.Name")
public interface $utility.capitalize($complexType.Name) extends Serializable {
public interface $utility.capitalize($complexType.Name)
extends #if($complexType.getBaseType())$utility.getJavaType($complexType.getBaseType().getFullQualifiedName().toString())#{else}Serializable#end {
#set( $complexProps = [] )
#foreach($propertyName in $complexType.PropertyNames)
#set($property = $complexType.getProperty($propertyName))
@ -29,7 +31,24 @@ public interface $utility.capitalize($complexType.Name) extends Serializable {
void set$utility.capitalize($property.Name)(final $utility.getJavaType($property.Type, $property.Collection) _$utility.uncapitalize($property.Name));
#if($utility.isComplex($property.Type.FullQualifiedName))#*
*#$utility.getJavaType($property.Type) new$utility.capitalize($property.Name)();
*##set( $adding = $complexProps.add($property) )
#end
#end
#if( $complexProps.size() > 0 )
#if( $complexType.baseType )
@Override
#end
ComplexFactory factory();
interface ComplexFactory #if( $complexType.baseType )
extends ${utility.getJavaType($complexType.getBaseType())}.ComplexFactory#end{
#foreach($property in $complexProps)
@Property(name = "$property.Name",
type = "$property.Type.FullQualifiedName.toString()")
$utility.getJavaType($property.Type) new$utility.capitalize($property.Name)();
#end
}
#end

View File

@ -21,8 +21,10 @@
isOpenType = $complexType.isOpenType(),
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 {
public interface $utility.capitalize($complexType.Name)
extends #if($complexType.getBaseType())$utility.getJavaType($complexType.getBaseType().getFullQualifiedName().toString())#{else}Serializable#end {
#set( $complexProps = [] )
#foreach($propertyName in $complexType.PropertyNames)
#set($property = $complexType.getProperty($propertyName))
@ -42,7 +44,7 @@ public interface $utility.capitalize($complexType.Name) extends #if($complexType
void set$utility.capitalize($property.Name)(final $utility.getJavaType($property.Type, $property.Collection) _$utility.uncapitalize($property.Name));
#if($utility.isComplex($property.Type.FullQualifiedName))#*
*#$utility.getJavaType($property.Type) new$utility.capitalize($property.Name)();
*##set( $adding = $complexProps.add($property) )
#end
#end
@ -62,3 +64,20 @@ public interface $utility.capitalize($complexType.Name) extends #if($complexType
void set$utility.capitalize($property.Name)(final $utility.getJavaType($type, $property.Collection) _$utility.uncapitalize($property.Name));
#end
#if( $complexProps.size() > 0 )
#if( $complexType.baseType )
@Override
#end
ComplexFactory factory();
interface ComplexFactory #if( $complexType.baseType )
extends ${utility.getJavaType($complexType.getBaseType())}.ComplexFactory#end{
#foreach($property in $complexProps)
@Property(name = "$property.Name",
type = "$property.Type.FullQualifiedName.toString()")
$utility.getJavaType($property.Type) new$utility.capitalize($property.Name)();
#end
}
#end

View File

@ -233,31 +233,36 @@ public abstract class AbstractServices {
final Response res;
if (matcher.find()) {
String method = matcher.group(1);
if ("PATCH".equals(method) || "MERGE".equals(method)) {
headers.putSingle("X-HTTP-METHOD", method);
method = "POST";
}
final String url = matcher.group(2);
final WebClient client = WebClient.create(url);
client.headers(headers);
res = client.invoke(method, body.getDataHandler().getInputStream());
client.close();
} else if (matcherRef.find()) {
String method = matcherRef.group(1);
if ("PATCH".equals(method) || "MERGE".equals(method)) {
headers.putSingle("X-HTTP-METHOD", method);
method = "POST";
final String method = matcher.group(1);
if ("DELETE".equals(method)) {
res = client.delete();
} else if ("PATCH".equals(method) || "MERGE".equals(method)) {
client.header("X-HTTP-METHOD", method);
res = client.invoke("POST", body.getDataHandler().getInputStream());
} else {
res = client.invoke(method, body.getDataHandler().getInputStream());
}
client.close();
} else if (matcherRef.find()) {
final String url = matcherRef.group(2);
final WebClient client = WebClient.create(references.get(url));
client.headers(headers);
res = client.invoke(method, body.getDataHandler().getInputStream());
String method = matcherRef.group(1);
if ("DELETE".equals(method)) {
res = client.delete();
} else if ("PATCH".equals(method) || "MERGE".equals(method)) {
client.header("X-HTTP-METHOD", method);
res = client.invoke("POST", body.getDataHandler().getInputStream());
} else {
res = client.invoke(method, body.getDataHandler().getInputStream());
}
client.close();
} else {
res = null;
@ -406,7 +411,7 @@ public abstract class AbstractServices {
} else {
final ResWrap<JSONEntityImpl> jcont = mapper.readValue(IOUtils.toInputStream(changes, Constants.ENCODING),
new TypeReference<JSONEntityImpl>() {
});
});
entryChanges = dataBinder.toAtomEntity(jcont.getPayload());
}
@ -593,8 +598,8 @@ public abstract class AbstractServices {
} else {
final ResWrap<JSONEntityImpl> jcontainer =
mapper.readValue(IOUtils.toInputStream(entity, Constants.ENCODING),
new TypeReference<JSONEntityImpl>() {
});
new TypeReference<JSONEntityImpl>() {
});
entry = dataBinder.toAtomEntity(jcontainer.getPayload());
@ -621,7 +626,7 @@ public abstract class AbstractServices {
ResWrap<AtomEntityImpl> result = atomDeserializer.read(serialization, AtomEntityImpl.class);
result = new ResWrap<AtomEntityImpl>(
URI.create(Constants.get(version, ConstantKey.ODATA_METADATA_PREFIX)
+ entitySetName + Constants.get(version, ConstantKey.ODATA_METADATA_ENTITY_SUFFIX)),
+ entitySetName + Constants.get(version, ConstantKey.ODATA_METADATA_ENTITY_SUFFIX)),
null, result.getPayload());
final String path = Commons.getEntityBasePath(entitySetName, entityKey);
@ -684,13 +689,13 @@ public abstract class AbstractServices {
replaceAll("\"Salary\":[0-9]*,", "\"Salary\":0,").
replaceAll("\"Title\":\".*\"", "\"Title\":\"[Sacked]\"").
replaceAll("\\<d:Salary m:type=\"Edm.Int32\"\\>.*\\</d:Salary\\>",
"<d:Salary m:type=\"Edm.Int32\">0</d:Salary>").
"<d:Salary m:type=\"Edm.Int32\">0</d:Salary>").
replaceAll("\\<d:Title\\>.*\\</d:Title\\>", "<d:Title>[Sacked]</d:Title>");
final FSManager fsManager = FSManager.instance(version);
fsManager.putInMemory(IOUtils.toInputStream(newContent, Constants.ENCODING),
fsManager.getAbsolutePath(Commons.getEntityBasePath("Person", entityId) + Constants.get(version,
ConstantKey.ENTITY), utils.getKey()));
ConstantKey.ENTITY), utils.getKey()));
return utils.getValue().createResponse(null, null, null, utils.getKey(), Response.Status.NO_CONTENT);
} catch (Exception e) {
@ -742,9 +747,9 @@ public abstract class AbstractServices {
final Long newSalary = Long.valueOf(salaryMatcher.group(1)) + n;
newContent = newContent.
replaceAll("\"Salary\":" + salaryMatcher.group(1) + ",",
"\"Salary\":" + newSalary + ",").
"\"Salary\":" + newSalary + ",").
replaceAll("\\<d:Salary m:type=\"Edm.Int32\"\\>" + salaryMatcher.group(1) + "</d:Salary\\>",
"<d:Salary m:type=\"Edm.Int32\">" + newSalary + "</d:Salary>");
"<d:Salary m:type=\"Edm.Int32\">" + newSalary + "</d:Salary>");
}
FSManager.instance(version).putInMemory(IOUtils.toInputStream(newContent, Constants.ENCODING),
@ -893,7 +898,7 @@ public abstract class AbstractServices {
} else {
mapper.writeValue(
writer, new JSONFeedContainer(container.getContextURL(), container.getMetadataETag(),
dataBinder.toJSONEntitySet(container.getPayload())));
dataBinder.toJSONEntitySet(container.getPayload())));
}
return xml.createResponse(
@ -1556,8 +1561,8 @@ public abstract class AbstractServices {
mapper.writeValue(
writer,
new JSONFeedContainer(container.getContextURL(),
container.getMetadataETag(),
dataBinder.toJSONEntitySet((AtomEntitySetImpl) container.getPayload())));
container.getMetadataETag(),
dataBinder.toJSONEntitySet((AtomEntitySetImpl) container.getPayload())));
}
} else {
final ResWrap<Entity> container =
@ -1570,8 +1575,8 @@ public abstract class AbstractServices {
mapper.writeValue(
writer,
new JSONEntryContainer(container.getContextURL(),
container.getMetadataETag(),
dataBinder.toJSONEntity((AtomEntityImpl) container.getPayload())));
container.getMetadataETag(),
dataBinder.toJSONEntity((AtomEntityImpl) container.getPayload())));
}
}
@ -1641,9 +1646,9 @@ public abstract class AbstractServices {
final ResWrap<AtomPropertyImpl> container = new ResWrap<AtomPropertyImpl>(
URI.create(Constants.get(version, ConstantKey.ODATA_METADATA_PREFIX)
+ (version.compareTo(ODataServiceVersion.V40) >= 0
? entitySetName + "(" + entityId + ")/" + path
: property.getType())),
+ (version.compareTo(ODataServiceVersion.V40) >= 0
? entitySetName + "(" + entityId + ")/" + path
: property.getType())),
entryContainer.getMetadataETag(),
property);
@ -1651,9 +1656,9 @@ public abstract class AbstractServices {
null,
searchForValue
? IOUtils.toInputStream(
container.getPayload().getValue() == null || container.getPayload().getValue().isNull()
? StringUtils.EMPTY
: container.getPayload().getValue().asPrimitive().get(), Constants.ENCODING)
container.getPayload().getValue() == null || container.getPayload().getValue().isNull()
? StringUtils.EMPTY
: container.getPayload().getValue().asPrimitive().get(), Constants.ENCODING)
: utils.writeProperty(acceptType, container),
Commons.getETag(Commons.getEntityBasePath(entitySetName, entityId), version),
acceptType);

View File

@ -553,7 +553,7 @@ public abstract class AbstractUtilities {
} else {
final ResWrap<JSONEntitySetImpl> container =
mapper.readValue(entitySet, new TypeReference<JSONEntitySetImpl>() {
});
});
entry = dataBinder.toAtomEntitySet(container.getPayload());
}
@ -571,7 +571,7 @@ public abstract class AbstractUtilities {
} else {
mapper.writeValue(
writer, new JSONFeedContainer(container.getContextURL(),
container.getMetadataETag(), dataBinder.toJSONEntitySet(container.getPayload())));
container.getMetadataETag(), dataBinder.toJSONEntitySet(container.getPayload())));
}
return IOUtils.toInputStream(writer.toString(), Constants.ENCODING);
@ -586,7 +586,7 @@ public abstract class AbstractUtilities {
} else {
final ResWrap<JSONEntityImpl> jcontainer =
mapper.readValue(entity, new TypeReference<JSONEntityImpl>() {
});
});
container = new ResWrap<AtomEntityImpl>(
jcontainer.getContextURL(),
jcontainer.getMetadataETag(),
@ -611,7 +611,7 @@ public abstract class AbstractUtilities {
} else {
mapper.writeValue(
writer, new JSONEntryContainer(container.getContextURL(), container.getMetadataETag(),
dataBinder.toJSONEntity(container.getPayload())));
dataBinder.toJSONEntity(container.getPayload())));
}
return IOUtils.toInputStream(writer.toString(), Constants.ENCODING);
@ -641,7 +641,7 @@ public abstract class AbstractUtilities {
} else {
final ResWrap<JSONPropertyImpl> jcontainer = mapper.readValue(property,
new TypeReference<JSONPropertyImpl>() {
});
});
atomProperty = dataBinder.toAtomProperty(jcontainer.getPayload(), entryType);
}
@ -658,7 +658,7 @@ public abstract class AbstractUtilities {
} else {
mapper.writeValue(
writer, new JSONPropertyContainer(container.getContextURL(), container.getMetadataETag(),
dataBinder.toJSONProperty(container.getPayload())));
dataBinder.toJSONProperty(container.getPayload())));
}
return IOUtils.toInputStream(writer.toString(), Constants.ENCODING);
@ -691,14 +691,14 @@ public abstract class AbstractUtilities {
if (entity.getProperty("MessageId") == null || entity.getProperty("FromUsername") == null) {
if (Commons.SEQUENCE.containsKey(entitySetName)) {
messageId = Commons.SEQUENCE.get(entitySetName) + 1;
res = "MessageId=" + String.valueOf(messageId) + ",FromUsername=1";
res = "FromUsername=1" + ",MessageId=" + String.valueOf(messageId);
} else {
throw new Exception(String.format("Unable to retrieve entity key value for %s", entitySetName));
}
} else {
messageId = Integer.valueOf(entity.getProperty("MessageId").getValue().asPrimitive().get());
res = "MessageId=" + entity.getProperty("MessageId").getValue().asPrimitive().get()
+ ",FromUsername=" + entity.getProperty("FromUsername").getValue().asPrimitive().get();
res = "FromUsername=" + entity.getProperty("FromUsername").getValue().asPrimitive().get()
+ ",MessageId=" + entity.getProperty("MessageId").getValue().asPrimitive().get();
}
Commons.SEQUENCE.put(entitySetName, messageId);
} else if ("Order".equals(entitySetName)) {

View File

@ -0,0 +1,11 @@
{
"odata.metadata": "http://localhost:8080/DefaultService.svc/$metadata#CustomerInfo/@Element",
"odata.type": "Microsoft.Test.OData.Services.AstoriaDefaultService.CustomerInfo",
"odata.id": "http://localhost:8080/DefaultService.svc/CustomerInfo(16)",
"odata.editLink": "CustomerInfo(16)",
"odata.mediaEditLink": "CustomerInfo(16)/$value",
"odata.mediaReadLink": "CustomerInfo(16)/$value",
"odata.mediaContentType": "*/*",
"CustomerInfoId": 16,
"Information": "uuvoqobtxfgtnzugqjsocbhjkynsjafonxuxmcrnyldkxvpnuezalvpyhjpsmkgxacuruxtjruusxylndzxgefpscvk"
}

View File

@ -0,0 +1,37 @@
<?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:8080/DefaultService.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<id>http://localhost:8080/DefaultService.svc/CustomerInfo(16)</id>
<category term="Microsoft.Test.OData.Services.AstoriaDefaultService.CustomerInfo" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<link rel="edit" title="CustomerInfo" href="CustomerInfo(16)" />
<title />
<updated>2014-05-11T15:46:20Z</updated>
<author>
<name />
</author>
<link rel="edit-media" title="CustomerInfo" href="CustomerInfo(16)/$value" />
<content type="*/*" src="CustomerInfo(16)/$value" />
<m:properties>
<d:CustomerInfoId m:type="Edm.Int32">16</d:CustomerInfoId>
<d:Information>uuvoqobtxfgtnzugqjsocbhjkynsjafonxuxmcrnyldkxvpnuezalvpyhjpsmkgxacuruxtjruusxylndzxgefpscvk</d:Information>
</m:properties>
</entry>

View File

@ -30,11 +30,14 @@ import org.apache.olingo.ext.proxy.EntityContainerFactory;
import org.apache.olingo.ext.proxy.context.EntityContext;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
DefaultContainer;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.
ContactDetails;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Customer;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Aliases;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.ContactDetails;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.Customer;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.Aliases;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.Phone;
import org.junit.BeforeClass;
import org.slf4j.Logger;
@ -94,18 +97,21 @@ public abstract class AbstractTest {
// add key attribute
customer.setCustomerId(id);
final ContactDetails cd = customer.newPrimaryContactInfo();
final ContactDetails cd = customer.factory().newPrimaryContactInfo();
cd.setAlternativeNames(Arrays.asList("alternative1", "alternative2"));
cd.setEmailBag(Collections.<String>singleton("myname@mydomain.org"));
cd.setMobilePhoneBag(Collections.<Phone>emptySet());
customer.setPrimaryContactInfo(cd);
final Aliases aliases = cd.newContactAlias();
final Aliases aliases = cd.factory().newContactAlias();
aliases.setAlternativeNames(Collections.<String>singleton("myAlternativeName"));
cd.setContactAlias(aliases);
final ContactDetails bcd = customer.newBackupContactInfo();
final ContactDetails bcd = customer.factory().newBackupContactInfo();
bcd.setAlternativeNames(Arrays.asList("alternative3", "alternative4"));
bcd.setEmailBag(Collections.<String>emptySet());
bcd.setMobilePhoneBag(Collections.<Phone>emptySet());
customer.setBackupContactInfo(Collections.<ContactDetails>singleton(bcd));
return customer;
}

View File

@ -0,0 +1,210 @@
/*
* 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.v3;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.Customer;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.Employee;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.Message;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.MessageKey;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.Order;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.OrderCollection;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.junit.Ignore;
import org.junit.Test;
/**
* This is the unit test class to check entity create operations.
*/
public class EntityCreateTestITCase extends AbstractTest {
@Test
@Ignore
public void create() {
final String sampleName = "sample customer from proxy";
final Integer id = 100;
getSampleCustomerProfile(id, sampleName, container);
container.flush();
Customer actual = readCustomer(container, id);
checkSampleCustomerProfile(actual, id, sampleName);
container.getCustomer().delete(actual.getCustomerId());
actual = container.getCustomer().get(id);
assertNull(actual);
entityContext.detachAll();
actual = container.getCustomer().get(id);
assertNotNull(actual);
container.getCustomer().delete(actual.getCustomerId());
container.flush();
actual = container.getCustomer().get(id);
assertNull(actual);
entityContext.detachAll();
actual = container.getCustomer().get(id);
assertNull(actual);
}
@Test
@Ignore
public void createEmployee() {
final Integer id = 101;
final Employee employee = container.getPerson().newEmployee();
employee.setPersonId(id);
employee.setName("sample employee from proxy");
employee.setManagersPersonId(-9918);
employee.setSalary(2147483647);
employee.setTitle("CEO");
container.flush();
Employee actual = container.getPerson().get(id, Employee.class);
assertNotNull(actual);
assertEquals(id, actual.getPersonId());
entityContext.detachAll();
actual = container.getPerson().get(id, Employee.class);
assertNotNull(actual);
container.getPerson().delete(actual.getPersonId());
container.flush();
actual = container.getPerson().get(id, Employee.class);
assertNull(actual);
entityContext.detachAll();
actual = container.getPerson().get(id, Employee.class);
assertNull(actual);
}
@Test
@Ignore
public void createWithNavigation() {
final String sampleName = "sample customer from proxy with navigation";
final Integer id = 101;
final Customer original = getSampleCustomerProfile(id, sampleName, container);
original.setInfo(container.getCustomerInfo().get(16));
container.flush();
Customer actual = readCustomer(container, id);
checkSampleCustomerProfile(actual, id, sampleName);
assertEquals(Integer.valueOf(16), actual.getInfo().getCustomerInfoId());
container.getCustomer().delete(actual.getCustomerId());
container.flush();
actual = container.getCustomer().get(id);
assertNull(actual);
}
@Test
@Ignore
public void createWithBackNavigation() {
final String sampleName = "sample customer from proxy with back navigation";
final Integer id = 102;
Order order = container.getOrder().newOrder();
order.setCustomerId(id);
order.setOrderId(id); // same id ...
final Customer customer = getSampleCustomerProfile(id, sampleName, container);
final OrderCollection orders = container.getOrder().newOrderCollection();
orders.add(order);
customer.setOrders(orders);
order.setCustomer(customer);
container.flush();
assertEquals(id, order.getOrderId());
assertEquals(id, order.getCustomerId());
Customer actual = readCustomer(container, id);
checkSampleCustomerProfile(actual, id, sampleName);
assertEquals(1, actual.getOrders().size());
assertEquals(id, actual.getOrders().iterator().next().getOrderId());
assertEquals(id, actual.getOrders().iterator().next().getCustomerId());
order = container.getOrder().get(id);
assertNotNull(order);
assertEquals(id, order.getCustomer().getCustomerId());
container.getOrder().delete(actual.getOrders());
container.flush();
order = container.getOrder().get(id);
assertNull(order);
actual = readCustomer(container, id);
assertTrue(actual.getOrders().isEmpty());
container.getCustomer().delete(actual.getCustomerId());
container.flush();
actual = container.getCustomer().get(id);
assertNull(actual);
}
@Test
@Ignore
public void multiKey() {
Message message = container.getMessage().newMessage();
message.setMessageId(100);
message.setFromUsername("fromusername");
message.setToUsername("myusername");
message.setIsRead(false);
message.setSubject("test message");
message.setBody("test");
container.flush();
MessageKey key = new MessageKey();
key.setFromUsername("fromusername");
key.setMessageId(100);
message = container.getMessage().get(key);
assertNotNull(message);
assertEquals(Integer.valueOf(100), message.getMessageId());
assertEquals("fromusername", message.getFromUsername());
assertEquals("myusername", message.getToUsername());
assertEquals("test message", message.getSubject());
assertEquals("test", message.getBody());
container.getMessage().delete(key);
container.flush();
assertNull(container.getMessage().get(key));
}
}

View File

@ -41,6 +41,8 @@ import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.service
types.ComputerDetail;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.ConcurrencyInfo;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.ContactDetails;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.Contractor;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
@ -71,6 +73,8 @@ import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.service
types.Person;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.PersonCollection;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.Phone;
import org.junit.Test;
/**
@ -81,7 +85,7 @@ public class EntityRetrieveTestITCase extends AbstractTest {
protected DefaultContainer getContainer() {
return container;
}
@Test
public void exists() {
assertTrue(getContainer().getCar().exists(15));
@ -109,7 +113,7 @@ public class EntityRetrieveTestITCase extends AbstractTest {
assertNotNull(employee);
}
final SpecialEmployeeCollection specialEmployees =
final SpecialEmployeeCollection specialEmployees =
getContainer().getPerson().getAll(SpecialEmployeeCollection.class);
assertNotNull(specialEmployees);
assertFalse(specialEmployees.isEmpty());
@ -210,4 +214,34 @@ public class EntityRetrieveTestITCase extends AbstractTest {
assertTrue(StringUtils.isNotBlank(
((EntityTypeInvocationHandler) Proxy.getInvocationHandler(product)).getETag()));
}
@Test
public void collectionsAndComplexes() {
final Customer customer = readCustomer(getContainer(), -10);
boolean found = false;
assertTrue(customer.getPrimaryContactInfo().getEmailBag().contains("psgdkmxamznjulzbsohqjytbxhnojbufe"));
final Collection<ContactDetails> backupContactInfo = customer.getBackupContactInfo();
assertEquals(9, backupContactInfo.size());
for (ContactDetails contact : backupContactInfo) {
if (contact.getContactAlias() != null && contact.getContactAlias().getAlternativeNames() != null && contact.
getContactAlias().getAlternativeNames().contains("vxiefursgkqzptijhincpdm")) {
found = true;
}
}
assertTrue(found);
found = false;
for (ContactDetails contact : backupContactInfo) {
for (Phone phone : contact.getMobilePhoneBag()) {
if ("gqvuusqrrriljkospoxbdod".equals(phone.getExtension())) {
found = true;
}
}
}
assertTrue(found);
}
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;

View File

@ -16,5 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
@ -44,8 +45,8 @@ import javax.xml.datatype.Duration;
@Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
@ComplexType(name = "Aliases")
public interface Aliases extends Serializable {
public interface Aliases
extends Serializable {
@Property(name = "AlternativeNames", type = "Edm.String", nullable = false)

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface AllSpatialCollectionTypes
extends Serializable {
@Key
@Property(name = "Id",
type = "Edm.Int32",
@ -88,5 +88,4 @@ public interface AllSpatialCollectionTypes
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -61,7 +62,6 @@ public interface AllSpatialCollectionTypes_Simple
extends org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes {
@Key
@Property(name = "Id",
type = "Edm.Int32",
@ -227,5 +227,4 @@ public interface AllSpatialCollectionTypes_Simple
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface AllSpatialTypes
extends Serializable {
@Key
@Property(name = "Id",
type = "Edm.Int32",
@ -456,5 +456,4 @@ public interface AllSpatialTypes
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
@ -44,8 +45,8 @@ import javax.xml.datatype.Duration;
@Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
@ComplexType(name = "AuditInfo")
public interface AuditInfo extends Serializable {
public interface AuditInfo
extends Serializable {
@Property(name = "ModifiedDate", type = "Edm.DateTime", nullable = false)
@ -67,8 +68,14 @@ public interface AuditInfo extends Serializable {
void setConcurrency(final org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo _concurrency);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo newConcurrency();
ComplexFactory factory();
interface ComplexFactory {
@Property(name = "Concurrency",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo newConcurrency();
}
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -61,7 +62,6 @@ public interface BackOrderLine
extends org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.OrderLine {
@Property(name = "OrderLineStream",
type = "Edm.Stream",
@ -201,5 +201,4 @@ public interface BackOrderLine
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -61,7 +62,6 @@ public interface BackOrderLine2
extends org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine {
@Property(name = "OrderLineStream",
type = "Edm.Stream",
@ -201,5 +201,4 @@ public interface BackOrderLine2
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface Car
extends Serializable {
@Property(name = "Photo",
type = "Edm.Stream",
@ -160,5 +160,4 @@ public interface Car
java.io.InputStream getStream();
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
@ -44,8 +45,8 @@ import javax.xml.datatype.Duration;
@Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
@ComplexType(name = "ComplexToCategory")
public interface ComplexToCategory extends Serializable {
public interface ComplexToCategory
extends Serializable {
@Property(name = "Term", type = "Edm.String", nullable = true)

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
@ -44,8 +45,8 @@ import javax.xml.datatype.Duration;
@Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
@ComplexType(name = "ComplexWithAllPrimitiveTypes")
public interface ComplexWithAllPrimitiveTypes extends Serializable {
public interface ComplexWithAllPrimitiveTypes
extends Serializable {
@Property(name = "Binary", type = "Edm.Binary", nullable = true)

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface Computer
extends Serializable {
@Key
@Property(name = "ComputerId",
type = "Edm.Int32",
@ -120,9 +120,9 @@ public interface Computer
Operations operations();
Operations operations();
public interface Operations {
interface Operations {
@Operation(name = "GetComputer",
type = OperationType.ACTION,
@ -132,5 +132,4 @@ public interface Computer
}
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface ComputerDetail
extends Serializable {
@Key
@Property(name = "ComputerDetailId",
type = "Edm.Int32",
@ -221,9 +221,7 @@ public interface ComputerDetail
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Dimensions getDimensions();
void setDimensions(final org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Dimensions _dimensions);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Dimensions newDimensions();
@NavigationProperty(name = "Computer",
@ -237,9 +235,9 @@ public interface ComputerDetail
Operations operations();
Operations operations();
public interface Operations {
interface Operations {
@Operation(name = "ResetComputerDetailsSpecifications",
type = OperationType.ACTION)
@ -250,5 +248,12 @@ public interface ComputerDetail
}
ComplexFactory factory();
interface ComplexFactory {
@Property(name = "Dimensions",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Dimensions newDimensions();
}
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
@ -44,8 +45,8 @@ import javax.xml.datatype.Duration;
@Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
@ComplexType(name = "ConcurrencyInfo")
public interface ConcurrencyInfo extends Serializable {
public interface ConcurrencyInfo
extends Serializable {
@Property(name = "Token", type = "Edm.String", nullable = true)

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
@ -44,8 +45,8 @@ import javax.xml.datatype.Duration;
@Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
@ComplexType(name = "ContactDetails")
public interface ContactDetails extends Serializable {
public interface ContactDetails
extends Serializable {
@Property(name = "EmailBag", type = "Edm.String", nullable = false)
@ -67,35 +68,47 @@ public interface ContactDetails extends Serializable {
void setContactAlias(final org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Aliases _contactAlias);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Aliases newContactAlias();
@Property(name = "HomePhone", type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone", nullable = true)
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone getHomePhone();
void setHomePhone(final org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone _homePhone);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone newHomePhone();
@Property(name = "WorkPhone", type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone", nullable = true)
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone getWorkPhone();
void setWorkPhone(final org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone _workPhone);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone newWorkPhone();
@Property(name = "MobilePhoneBag", type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone", nullable = false)
Collection<org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone> getMobilePhoneBag();
void setMobilePhoneBag(final Collection<org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone> _mobilePhoneBag);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone newMobilePhoneBag();
ComplexFactory factory();
interface ComplexFactory {
@Property(name = "ContactAlias",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Aliases newContactAlias();
@Property(name = "HomePhone",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone newHomePhone();
@Property(name = "WorkPhone",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone newWorkPhone();
@Property(name = "MobilePhoneBag",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone newMobilePhoneBag();
}
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -61,7 +62,6 @@ public interface Contractor
extends org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Person {
@Key
@Property(name = "PersonId",
type = "Edm.Int32",
@ -214,5 +214,4 @@ public interface Contractor
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface Customer
extends Serializable {
@Property(name = "Thumbnail",
type = "Edm.Stream",
@ -175,9 +175,7 @@ public interface Customer
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails getPrimaryContactInfo();
void setPrimaryContactInfo(final org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails _primaryContactInfo);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails newPrimaryContactInfo();
@Property(name = "BackupContactInfo",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails",
@ -200,9 +198,7 @@ public interface Customer
Collection<org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails> getBackupContactInfo();
void setBackupContactInfo(final Collection<org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails> _backupContactInfo);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails newBackupContactInfo();
@Property(name = "Auditing",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.AuditInfo",
@ -225,9 +221,7 @@ public interface Customer
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.AuditInfo getAuditing();
void setAuditing(final org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.AuditInfo _auditing);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.AuditInfo newAuditing();
@NavigationProperty(name = "Orders",
@ -282,5 +276,20 @@ public interface Customer
ComplexFactory factory();
interface ComplexFactory {
@Property(name = "PrimaryContactInfo",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails newPrimaryContactInfo();
@Property(name = "BackupContactInfo",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails newBackupContactInfo();
@Property(name = "Auditing",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.AuditInfo")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.AuditInfo newAuditing();
}
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface CustomerInfo
extends Serializable {
@Key
@Property(name = "CustomerInfoId",
type = "Edm.Int32",
@ -114,5 +114,4 @@ public interface CustomerInfo
java.io.InputStream getStream();
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
@ -44,8 +45,8 @@ import javax.xml.datatype.Duration;
@Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
@ComplexType(name = "Dimensions")
public interface Dimensions extends Serializable {
public interface Dimensions
extends Serializable {
@Property(name = "Width", type = "Edm.Decimal", nullable = false)

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -61,7 +62,6 @@ public interface DiscontinuedProduct
extends org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Product {
@Property(name = "Picture",
type = "Edm.Stream",
@ -153,9 +153,7 @@ public interface DiscontinuedProduct
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Dimensions getDimensions();
void setDimensions(final org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Dimensions _dimensions);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Dimensions newDimensions();
@Property(name = "BaseConcurrency",
type = "Edm.String",
@ -201,9 +199,7 @@ public interface DiscontinuedProduct
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo getComplexConcurrency();
void setComplexConcurrency(final org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo _complexConcurrency);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo newComplexConcurrency();
@Property(name = "NestedComplexConcurrency",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.AuditInfo",
@ -226,9 +222,7 @@ public interface DiscontinuedProduct
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.AuditInfo getNestedComplexConcurrency();
void setNestedComplexConcurrency(final org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.AuditInfo _nestedComplexConcurrency);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.AuditInfo newNestedComplexConcurrency();
@Property(name = "Discontinued",
type = "Edm.DateTime",
@ -297,9 +291,7 @@ public interface DiscontinuedProduct
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone getDiscontinuedPhone();
void setDiscontinuedPhone(final org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone _discontinuedPhone);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone newDiscontinuedPhone();
@Property(name = "ChildConcurrencyToken",
type = "Edm.String",
@ -367,5 +359,25 @@ public interface DiscontinuedProduct
@Override
ComplexFactory factory();
interface ComplexFactory extends org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Product.ComplexFactory{
@Property(name = "Dimensions",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Dimensions newDimensions();
@Property(name = "ComplexConcurrency",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo newComplexConcurrency();
@Property(name = "NestedComplexConcurrency",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.AuditInfo")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.AuditInfo newNestedComplexConcurrency();
@Property(name = "DiscontinuedPhone",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone newDiscontinuedPhone();
}
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface Driver
extends Serializable {
@Key
@Property(name = "Name",
type = "Edm.String",
@ -121,5 +121,4 @@ public interface Driver
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -61,7 +62,6 @@ public interface Employee
extends org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Person {
@Key
@Property(name = "PersonId",
type = "Edm.Int32",
@ -200,9 +200,9 @@ public interface Employee
Operations operations();
Operations operations();
public interface Operations {
interface Operations {
@Operation(name = "Sack",
type = OperationType.ACTION)
@ -211,5 +211,4 @@ public interface Employee
}
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface LastLogin
extends Serializable {
@Key
@Property(name = "Username",
type = "Edm.String",
@ -167,5 +167,4 @@ public interface LastLogin
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface License
extends Serializable {
@Key
@Property(name = "Name",
type = "Edm.String",
@ -190,5 +190,4 @@ public interface License
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface Login
extends Serializable {
@Key
@Property(name = "Username",
type = "Edm.String",
@ -161,5 +161,4 @@ public interface Login
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface MappedEntityType
extends Serializable {
@Key
@Property(name = "Id",
type = "Edm.Int32",
@ -474,9 +474,7 @@ public interface MappedEntityType
Collection<org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ComplexToCategory> getBagOfComplexToCategories();
void setBagOfComplexToCategories(final Collection<org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ComplexToCategory> _bagOfComplexToCategories);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ComplexToCategory newBagOfComplexToCategories();
@Property(name = "ComplexPhone",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone",
@ -499,9 +497,7 @@ public interface MappedEntityType
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone getComplexPhone();
void setComplexPhone(final org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone _complexPhone);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone newComplexPhone();
@Property(name = "ComplexContactDetails",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails",
@ -524,12 +520,25 @@ public interface MappedEntityType
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails getComplexContactDetails();
void setComplexContactDetails(final org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails _complexContactDetails);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails newComplexContactDetails();
ComplexFactory factory();
interface ComplexFactory {
@Property(name = "BagOfComplexToCategories",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ComplexToCategory")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ComplexToCategory newBagOfComplexToCategories();
@Property(name = "ComplexPhone",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone newComplexPhone();
@Property(name = "ComplexContactDetails",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails newComplexContactDetails();
}
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface Message
extends Serializable {
@Key
@Property(name = "MessageId",
type = "Edm.Int32",
@ -256,5 +256,4 @@ public interface Message
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface MessageAttachment
extends Serializable {
@Key
@Property(name = "AttachmentId",
type = "Edm.Guid",
@ -111,5 +111,4 @@ public interface MessageAttachment
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface Order
extends Serializable {
@Key
@Property(name = "OrderId",
type = "Edm.Int32",
@ -129,9 +129,7 @@ public interface Order
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo getConcurrency();
void setConcurrency(final org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo _concurrency);
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo newConcurrency();
@NavigationProperty(name = "Login",
@ -156,5 +154,12 @@ public interface Order
ComplexFactory factory();
interface ComplexFactory {
@Property(name = "Concurrency",
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo")
org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo newConcurrency();
}
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface OrderLine
extends Serializable {
@Property(name = "OrderLineStream",
type = "Edm.Stream",
@ -200,5 +200,4 @@ public interface OrderLine
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface PageView
extends Serializable {
@Key
@Property(name = "PageViewId",
type = "Edm.Int32",
@ -190,5 +190,4 @@ public interface PageView
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface Person
extends Serializable {
@Key
@Property(name = "PersonId",
type = "Edm.Int32",
@ -121,5 +121,4 @@ public interface Person
}

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;

View File

@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@ -60,7 +61,6 @@ public interface PersonMetadata
extends Serializable {
@Key
@Property(name = "PersonMetadataId",
type = "Edm.Int32",
@ -167,5 +167,4 @@ public interface PersonMetadata
}

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