diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamType.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamType.java deleted file mode 100644 index b65021a76..000000000 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamType.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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.api; - -public interface EdmStreamType { - - EdmStreamValue load(); -} diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamValue.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamValue.java index fe5c345aa..cc5bc32dd 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamValue.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/EdmStreamValue.java @@ -19,28 +19,14 @@ package org.apache.olingo.ext.proxy.api; import java.io.InputStream; -import org.apache.commons.io.IOUtils; -public class EdmStreamValue { +public interface EdmStreamValue { - private final String contentType; + EdmStreamValue load(); - private final InputStream stream; + String getContentType(); - public EdmStreamValue(final String contentType, final InputStream stream) { - this.contentType = contentType; - this.stream = stream; - } + InputStream getStream(); - public String getContentType() { - return contentType; - } - - public InputStream getStream() { - return stream; - } - - public void close() { - IOUtils.closeQuietly(this.stream); - } + void close(); } diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredType.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredType.java index da149dde9..d1c708344 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredType.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/StructuredType.java @@ -22,4 +22,14 @@ package org.apache.olingo.ext.proxy.api; * Marker interface for Entity and complex type. */ public interface StructuredType extends java.io.Serializable { + + /** + * Delete object. + */ + void delete(); + + /** + * Delete a specific property. + */ + void delete(String name); } diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Singleton.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Singleton.java index 0c966984a..be120dab3 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Singleton.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Singleton.java @@ -28,7 +28,7 @@ import java.lang.annotation.Target; * getSimpleName(). */ @Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) +@Target(ElementType.METHOD) public @interface Singleton { String name(); diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java index ab2fe5ce9..2f5276d96 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractInvocationHandler.java @@ -18,6 +18,7 @@ */ package org.apache.olingo.ext.proxy.commons; +import java.lang.annotation.Annotation; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -43,9 +44,12 @@ import org.apache.olingo.commons.api.domain.CommonODataEntitySet; import org.apache.olingo.commons.api.domain.CommonODataProperty; import org.apache.olingo.commons.api.domain.ODataInvokeResult; import org.apache.olingo.commons.api.domain.ODataValue; +import org.apache.olingo.commons.api.edm.Edm; +import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.commons.api.edm.EdmFunction; import org.apache.olingo.commons.api.edm.EdmOperation; import org.apache.olingo.commons.api.edm.EdmReturnType; +import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.EdmTypeKind; import org.apache.olingo.commons.core.edm.EdmTypeInfo; import org.apache.olingo.ext.proxy.AbstractService; @@ -53,16 +57,26 @@ import org.apache.olingo.ext.proxy.api.ComplexCollection; import org.apache.olingo.ext.proxy.api.ComplexType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.PrimitiveCollection; +import org.apache.olingo.ext.proxy.api.annotations.EntitySet; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.annotations.Singleton; +import org.apache.olingo.ext.proxy.context.AttachedEntityStatus; import org.apache.olingo.ext.proxy.context.Context; import org.apache.olingo.ext.proxy.utils.ClassUtils; import org.apache.olingo.ext.proxy.utils.CoreUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; abstract class AbstractInvocationHandler implements InvocationHandler { private static final long serialVersionUID = 358520026931462958L; + /** + * Logger. + */ + protected static final Logger LOG = LoggerFactory.getLogger(AbstractInvocationHandler.class); + protected AbstractService service; protected AbstractInvocationHandler(final AbstractService service) { @@ -116,7 +130,7 @@ abstract class AbstractInvocationHandler implements InvocationHandler { Thread.currentThread().getContextClassLoader(), new Class[] {typeCollectionRef}, new EntityCollectionInvocationHandler(service, items, typeCollectionRef, targetEntitySetURI, - uri == null ? null : getClient().newURIBuilder(uri.toASCIIString()))); + uri == null ? null : getClient().newURIBuilder(uri.toASCIIString()))); } protected Object getEntitySetProxy( @@ -270,10 +284,10 @@ abstract class AbstractInvocationHandler implements InvocationHandler { res = Proxy.newProxyInstance( Thread.currentThread().getContextClassLoader(), new Class[] {ref}, new ComplexCollectionInvocationHandler( - service, - items, - itemRef, - null)); + service, + items, + itemRef, + null)); } else { final List items = new ArrayList(); @@ -284,10 +298,10 @@ abstract class AbstractInvocationHandler implements InvocationHandler { res = Proxy.newProxyInstance( Thread.currentThread().getContextClassLoader(), new Class[] {PrimitiveCollection.class}, new PrimitiveCollectionInvocationHandler( - service, - items, - null, - null)); + service, + items, + null, + null)); } } else { if (edmType.isComplexType()) { @@ -342,6 +356,53 @@ abstract class AbstractInvocationHandler implements InvocationHandler { return res; } + protected boolean isDeleted(final EntityInvocationHandler handler) { + return getContext().entityContext().getStatus(handler) == AttachedEntityStatus.DELETED; + } + + protected static CommonURIBuilder buildEntitySetURI( + final Class ref, + final AbstractService service) { + + final String containerNS; + final String entitySetName; + Annotation ann = ref.getAnnotation(EntitySet.class); + if (ann instanceof EntitySet) { + containerNS = EntitySet.class.cast(ann).container(); + entitySetName = EntitySet.class.cast(ann).name(); + } else { + ann = ref.getAnnotation(Singleton.class); + if (ann instanceof Singleton) { + containerNS = Singleton.class.cast(ann).container(); + entitySetName = Singleton.class.cast(ann).name(); + } else { + containerNS = null; + entitySetName = null; + } + } + + return buildEntitySetURI(containerNS, entitySetName, service); + } + + protected static CommonURIBuilder buildEntitySetURI( + final String containerNS, final String entitySetName, final AbstractService service) { + + final CommonURIBuilder uriBuilder = service.getClient().newURIBuilder(); + final Edm edm = service.getClient().getCachedEdm(); + + final StringBuilder entitySetSegment = new StringBuilder(); + if (StringUtils.isNotBlank(containerNS)) { + final EdmEntityContainer container = edm.getEntityContainer(new FullQualifiedName(containerNS)); + if (!container.isDefault()) { + entitySetSegment.append(container.getFullQualifiedName().toString()).append('.'); + } + } + + entitySetSegment.append(entitySetName); + uriBuilder.appendEntitySetSegment(entitySetSegment.toString()); + return uriBuilder; + } + @Override public boolean equals(final Object obj) { return EqualsBuilder.reflectionEquals(this, obj); diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractPersistenceManager.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractPersistenceManager.java index 101b809a2..38d08da2a 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractPersistenceManager.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractPersistenceManager.java @@ -34,6 +34,7 @@ import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; import org.apache.olingo.ext.proxy.AbstractService; import org.apache.olingo.ext.proxy.api.PersistenceManager; import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; +import org.apache.olingo.ext.proxy.api.EdmStreamValue; import org.apache.olingo.ext.proxy.context.AttachedEntity; import org.apache.olingo.ext.proxy.context.AttachedEntityStatus; import org.apache.olingo.ext.proxy.context.EntityLinkDesc; @@ -50,7 +51,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.olingo.ext.proxy.api.EdmStreamValue; abstract class AbstractPersistenceManager implements PersistenceManager { @@ -92,6 +92,12 @@ abstract class AbstractPersistenceManager implements PersistenceManager { // remove null values items.normalize(); + for (URI uri : service.getContext().entityContext().getFurtherDeletes()) { + pos++; + queueDelete(uri, null, changes); + items.put(null, pos); + } + final List result = new ArrayList(); if (!items.isEmpty()) { result.addAll(doFlush(changes, items)); @@ -461,17 +467,31 @@ abstract class AbstractPersistenceManager implements PersistenceManager { final EntityInvocationHandler handler, final CommonODataEntity entity, final PersistenceChanges changeset) { - final URI deleteURI = entity.getEditLink() == null ? handler.getEntityURI() : entity.getEditLink(); + changeset.addChange(buildDeleteRequest(deleteURI, handler.getETag(), changeset), handler); + } + + private void queueDelete( + final URI deleteURI, + final String etag, + final PersistenceChanges changeset) { + changeset.addChange(buildDeleteRequest(deleteURI, etag, changeset), null); + } + + private ODataDeleteRequest buildDeleteRequest( + final URI deleteURI, + final String etag, + final PersistenceChanges changeset) { + LOG.debug("Delete '{}'", deleteURI); final ODataDeleteRequest req = service.getClient().getCUDRequestFactory().getDeleteRequest(deleteURI); - if (StringUtils.isNotBlank(handler.getETag())) { - req.setIfMatch(handler.getETag()); + if (StringUtils.isNotBlank(etag)) { + req.setIfMatch(etag); } - changeset.addChange(req, handler); + return req; } private AttachedEntityStatus resolveNavigationLink( diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractStructuredInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractStructuredInvocationHandler.java index 00a706487..1e0c2b503 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractStructuredInvocationHandler.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/AbstractStructuredInvocationHandler.java @@ -40,15 +40,12 @@ import org.apache.olingo.commons.api.domain.CommonODataProperty; import org.apache.olingo.commons.api.domain.ODataValue; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.ext.proxy.api.ComplexCollection; -import org.apache.olingo.ext.proxy.api.EdmStreamType; import org.apache.olingo.ext.proxy.api.EdmStreamValue; import org.apache.olingo.ext.proxy.api.PrimitiveCollection; import org.apache.olingo.ext.proxy.api.annotations.Namespace; import org.apache.olingo.ext.proxy.context.EntityUUID; import org.apache.olingo.ext.proxy.utils.CoreUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.lang.reflect.Method; import java.lang.reflect.ParameterizedType; @@ -66,16 +63,12 @@ import java.util.Set; import org.apache.commons.io.IOUtils; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.ext.proxy.api.annotations.ComplexType; +import org.apache.olingo.ext.proxy.context.EntityContext; public abstract class AbstractStructuredInvocationHandler extends AbstractInvocationHandler { private static final long serialVersionUID = 2629912294765040037L; - /** - * Logger. - */ - protected static final Logger LOG = LoggerFactory.getLogger(AbstractStructuredInvocationHandler.class); - protected CommonURIBuilder uri; protected URI baseURI; @@ -106,7 +99,7 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca protected final Map streamedPropertyChanges = new HashMap(); - protected final Map streamedPropertyCache = new HashMap(); + protected final Map streamedPropertyCache = new HashMap(); protected AbstractStructuredInvocationHandler( final Class typeRef, @@ -235,6 +228,29 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca } } + public void delete(final String name) { + if (baseURI != null) { + getContext().entityContext().addFurtherDeletes( + getClient().newURIBuilder(baseURI.toASCIIString()).appendPropertySegment(name).build()); + } + } + + public void delete() { + final EntityContext entityContext = getContext().entityContext(); + + if (this instanceof EntityInvocationHandler) { + final EntityInvocationHandler handler = EntityInvocationHandler.class.cast(this); + + if (entityContext.isAttached(handler)) { + entityContext.setStatus(handler, AttachedEntityStatus.DELETED); + } else { + entityContext.attach(handler, AttachedEntityStatus.DELETED); + } + } else if (baseURI != null) { + entityContext.addFurtherDeletes(baseURI); + } + } + protected void attach() { attach(AttachedEntityStatus.ATTACHED, false); } @@ -259,19 +275,20 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca Object res; Class ref = ClassUtils.getTypeClass(type); - if (ref == EdmStreamType.class) { + if (ref == EdmStreamValue.class) { if (streamedPropertyCache.containsKey(name)) { res = streamedPropertyCache.get(name); } else if (streamedPropertyChanges.containsKey(name)) { - res = new EdmStreamTypeImpl(streamedPropertyChanges.get(name)); + res = streamedPropertyChanges.get(name); } else { res = Proxy.newProxyInstance( Thread.currentThread().getContextClassLoader(), - new Class[] {EdmStreamType.class}, new EdmStreamTypeHandler( - getClient().newURIBuilder(baseURI.toASCIIString()).appendPropertySegment(name), + new Class[] {EdmStreamValue.class}, new EdmStreamValueHandler( + baseURI == null + ? null : getClient().newURIBuilder(baseURI.toASCIIString()).appendPropertySegment(name).build(), service)); - streamedPropertyCache.put(name, EdmStreamType.class.cast(res)); + streamedPropertyCache.put(name, EdmStreamValue.class.cast(res)); } return res; @@ -375,7 +392,7 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca protected void setPropertyValue(final Property property, final Object value) { if (EdmPrimitiveTypeKind.Stream.getFullQualifiedName().toString().equalsIgnoreCase(property.type())) { - setStreamedProperty(property, (EdmStreamType) value); + setStreamedProperty(property, (EdmStreamValue) value); } else { addPropertyChanges(property.name(), value); @@ -402,7 +419,7 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca attach(AttachedEntityStatus.CHANGED); } - private void setStreamedProperty(final Property property, final EdmStreamType input) { + private void setStreamedProperty(final Property property, final EdmStreamValue input) { final Object obj = streamedPropertyChanges.get(property.name()); if (obj instanceof InputStream) { IOUtils.closeQuietly((InputStream) obj); @@ -605,7 +622,7 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca } public void clearQueryOptions() { - this.uri = getClient().newURIBuilder(baseURI.toASCIIString()); + this.uri = baseURI == null ? null : getClient().newURIBuilder(baseURI.toASCIIString()); } protected abstract void load(); diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EdmStreamTypeImpl.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EdmStreamTypeImpl.java deleted file mode 100644 index f139a1109..000000000 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EdmStreamTypeImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 org.apache.olingo.ext.proxy.api.EdmStreamType; -import org.apache.olingo.ext.proxy.api.EdmStreamValue; - -public class EdmStreamTypeImpl implements EdmStreamType { - - private final EdmStreamValue value; - - public EdmStreamTypeImpl(final EdmStreamValue value) { - this.value = value; - } - - @Override - public EdmStreamValue load() { - return value; - } -} diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EdmStreamTypeHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EdmStreamValueHandler.java similarity index 51% rename from ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EdmStreamTypeHandler.java rename to ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EdmStreamValueHandler.java index 109a7d8c7..a910d7a14 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EdmStreamTypeHandler.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EdmStreamValueHandler.java @@ -20,51 +20,75 @@ package org.apache.olingo.ext.proxy.commons; import java.io.InputStream; import java.lang.reflect.Method; +import java.net.URI; +import org.apache.commons.io.IOUtils; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; import org.apache.olingo.ext.proxy.AbstractService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.apache.olingo.client.api.uri.CommonURIBuilder; -import org.apache.olingo.ext.proxy.api.EdmStreamValue; - -public class EdmStreamTypeHandler extends AbstractInvocationHandler { +public class EdmStreamValueHandler extends AbstractInvocationHandler { private static final long serialVersionUID = 2629912294765040047L; - /** - * Logger. - */ - private static final Logger LOG = LoggerFactory.getLogger(EdmStreamTypeHandler.class); + private URI uri; - private CommonURIBuilder uri; + private InputStream stream; - private EdmStreamValue value = null; + private String contentType; - protected EdmStreamTypeHandler( - final CommonURIBuilder uri, + protected EdmStreamValueHandler( + final URI uri, final AbstractService service) { super(service); this.uri = uri; } + protected EdmStreamValueHandler( + final String contentType, + final InputStream stream, + final URI uri, + final AbstractService service) { + + super(service); + this.contentType = contentType; + this.stream = stream; + this.uri = uri; + } + @Override - public Object invoke(Object o, Method method, Object[] args) throws Throwable { - if (isSelfMethod(method, args)) { - return invokeSelfMethod(method, args); + public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { + if ("load".equals(method.getName())) { + load(); + return proxy; } else { - throw new NoSuchMethodException(method.getName()); + if (isSelfMethod(method, args)) { + return invokeSelfMethod(method, args); + } else { + throw new NoSuchMethodException(method.getName()); + } } } - public EdmStreamValue load() { - if (value == null && this.uri != null) { + public void load() { + if (this.uri != null) { final ODataRetrieveResponse res = - getClient().getRetrieveRequestFactory().getMediaRequest(this.uri.build()).execute(); - value = new EdmStreamValue(res.getContentType(), res.getBody()); + getClient().getRetrieveRequestFactory().getMediaRequest(this.uri).execute(); + contentType = res.getContentType(); + stream = res.getBody(); } + } - return value; + public String getContentType() { + return contentType; + } + + public InputStream getStream() { + return stream; + } + + public void close() { + IOUtils.closeQuietly(stream); + contentType = null; + stream = null; } } diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityContainerInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityContainerInvocationHandler.java index a8db2b4c7..32cff3daa 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityContainerInvocationHandler.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityContainerInvocationHandler.java @@ -18,6 +18,7 @@ */ package org.apache.olingo.ext.proxy.commons; +import java.io.InputStream; import java.io.Serializable; import org.apache.commons.lang3.ArrayUtils; import org.apache.olingo.ext.proxy.AbstractService; @@ -27,11 +28,17 @@ import org.apache.olingo.ext.proxy.api.annotations.Singleton; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.lang.reflect.Proxy; +import java.net.URI; +import org.apache.olingo.commons.api.domain.CommonODataEntity; +import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.ext.proxy.api.ComplexCollection; import org.apache.olingo.ext.proxy.api.ComplexType; +import org.apache.olingo.ext.proxy.api.EdmStreamValue; import org.apache.olingo.ext.proxy.api.EntityCollection; import org.apache.olingo.ext.proxy.api.EntityType; import org.apache.olingo.ext.proxy.api.PrimitiveCollection; +import org.apache.olingo.ext.proxy.api.annotations.Namespace; +import org.apache.olingo.ext.proxy.context.EntityUUID; import org.apache.olingo.ext.proxy.utils.ClassUtils; public final class EntityContainerInvocationHandler extends AbstractInvocationHandler { @@ -96,26 +103,45 @@ public final class EntityContainerInvocationHandler extends AbstractInvocationHa } else { final Class returnType = method.getReturnType(); - final EntitySet entitySet = returnType.getAnnotation(EntitySet.class); - if (entitySet == null) { - final Singleton singleton = returnType.getAnnotation(Singleton.class); - if (singleton != null) { - return Proxy.newProxyInstance( - Thread.currentThread().getContextClassLoader(), - new Class[] {returnType}, - SingletonInvocationHandler.getInstance(returnType, service)); - } - } else { + if (returnType.isAnnotationPresent(EntitySet.class)) { return Proxy.newProxyInstance( Thread.currentThread().getContextClassLoader(), new Class[] {returnType}, EntitySetInvocationHandler.getInstance(returnType, service)); + } else if (returnType.isAnnotationPresent(org.apache.olingo.ext.proxy.api.annotations.EntityType.class)) { + return getSingleton(method); } throw new NoSuchMethodException(method.getName()); } } + private Object getSingleton(final Method method) throws IllegalArgumentException { + final Class typeRef = method.getReturnType(); + final Singleton singleton = method.getAnnotation(Singleton.class); + + final URI uri = buildEntitySetURI(singleton.container(), singleton.name(), service).build(); + final EntityUUID uuid = new EntityUUID(uri, typeRef); + LOG.debug("Ask for singleton '{}'", typeRef.getSimpleName()); + + EntityInvocationHandler handler = getContext().entityContext().getEntity(uuid); + + if (handler == null) { + final CommonODataEntity entity = getClient().getObjectFactory().newEntity(new FullQualifiedName( + typeRef.getAnnotation(Namespace.class).value(), ClassUtils.getEntityTypeName(typeRef))); + + handler = EntityInvocationHandler.getInstance(entity, uri, uri, typeRef, service); + } else if (isDeleted(handler)) { + // object deleted + LOG.debug("Singleton '{}' has been deleted", typeRef.getSimpleName()); + handler = null; + } + + return handler == null + ? null + : Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {typeRef}, handler); + } + @SuppressWarnings("unchecked") public NE newEntityInstance(final Class ref) { final EntityInvocationHandler handler = EntityInvocationHandler.getInstance(ref, getService()); @@ -160,4 +186,14 @@ public final class EntityContainerInvocationHandler extends AbstractInvocationHa new Class[] {PrimitiveCollection.class}, new PrimitiveCollectionInvocationHandler(getService(), ref)); } + + @SuppressWarnings("unchecked") + public EdmStreamValue newEdmStreamValue( + final String contentType, final InputStream stream) { + + return EdmStreamValue.class.cast(Proxy.newProxyInstance( + Thread.currentThread().getContextClassLoader(), + new Class[] {EdmStreamValue.class}, + new EdmStreamValueHandler(contentType, stream, null, getService()))); + } } diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityInvocationHandler.java index bf70d8494..5a08418b2 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityInvocationHandler.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityInvocationHandler.java @@ -308,7 +308,10 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler } final ODataRetrieveResponse res = retrieveReq.execute(); - this.stream = new EdmStreamValue(res.getContentType(), res.getBody()); + this.stream = EdmStreamValue.class.cast(Proxy.newProxyInstance( + Thread.currentThread().getContextClassLoader(), + new Class[] {EdmStreamValue.class}, + new EdmStreamValueHandler(res.getContentType(), res.getBody(), contentSource, service))); } return this.stream; diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java index 5b8cc624b..b96b8301a 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java @@ -33,28 +33,20 @@ import org.apache.olingo.ext.proxy.api.AbstractEntitySet; import org.apache.olingo.ext.proxy.api.AbstractSingleton; import org.apache.olingo.ext.proxy.api.Search; import org.apache.olingo.ext.proxy.api.SingleQuery; -import org.apache.olingo.ext.proxy.api.annotations.EntitySet; import org.apache.olingo.ext.proxy.context.AttachedEntityStatus; import org.apache.olingo.ext.proxy.context.EntityContext; import org.apache.olingo.ext.proxy.context.EntityUUID; import org.apache.olingo.ext.proxy.utils.ClassUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.io.Serializable; -import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.net.URI; import java.util.ArrayList; import java.util.List; -import org.apache.commons.lang3.StringUtils; -import org.apache.olingo.commons.api.edm.Edm; -import org.apache.olingo.commons.api.edm.EdmEntityContainer; import org.apache.olingo.ext.proxy.AbstractService; import org.apache.olingo.ext.proxy.api.EntityType; import org.apache.olingo.ext.proxy.api.annotations.Namespace; -import org.apache.olingo.ext.proxy.api.annotations.Singleton; class EntitySetInvocationHandler< T extends EntityType, KEY extends Serializable, EC extends EntityCollection> @@ -63,14 +55,9 @@ class EntitySetInvocationHandler< private static final long serialVersionUID = 2629912294765040027L; - /** - * Logger. - */ - private static final Logger LOG = LoggerFactory.getLogger(EntitySetInvocationHandler.class); - @SuppressWarnings({"rawtypes", "unchecked"}) static EntitySetInvocationHandler getInstance(final Class ref, final AbstractService service) { - return new EntitySetInvocationHandler(ref, service, buildURI(ref, service)); + return new EntitySetInvocationHandler(ref, service, buildEntitySetURI(ref, service)); } @SuppressWarnings({"rawtypes", "unchecked"}) @@ -78,42 +65,6 @@ class EntitySetInvocationHandler< return new EntitySetInvocationHandler(ref, service, service.getClient().newURIBuilder(uri.toASCIIString())); } - private static CommonURIBuilder buildURI( - final Class ref, - final AbstractService service) { - final CommonURIBuilder uriBuilder = service.getClient().newURIBuilder(); - - final Edm edm = service.getClient().getCachedEdm(); - final String containerNS; - final String entitySetName; - Annotation ann = ref.getAnnotation(EntitySet.class); - if (ann instanceof EntitySet) { - containerNS = EntitySet.class.cast(ann).container(); - entitySetName = EntitySet.class.cast(ann).name(); - } else { - ann = ref.getAnnotation(Singleton.class); - if (ann instanceof Singleton) { - containerNS = Singleton.class.cast(ann).container(); - entitySetName = Singleton.class.cast(ann).name(); - } else { - containerNS = null; - entitySetName = null; - } - } - - final StringBuilder entitySetSegment = new StringBuilder(); - if (StringUtils.isNotBlank(containerNS)) { - final EdmEntityContainer container = edm.getEntityContainer(new FullQualifiedName(containerNS)); - if (!container.isDefault()) { - entitySetSegment.append(container.getFullQualifiedName().toString()).append('.'); - } - } - - entitySetSegment.append(entitySetName); - uriBuilder.appendEntitySetSegment(entitySetSegment.toString()); - return uriBuilder; - } - @SuppressWarnings("unchecked") protected EntitySetInvocationHandler( final Class ref, @@ -311,10 +262,6 @@ class EntitySetInvocationHandler< } } - private boolean isDeleted(final EntityInvocationHandler handler) { - return getContext().entityContext().getStatus(handler) == AttachedEntityStatus.DELETED; - } - @Override public EntitySetIterator iterator() { return new EntitySetIterator(getClient().newURIBuilder(this.uri.build().toASCIIString()).build(), this); diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/NonTransactionalPersistenceManagerImpl.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/NonTransactionalPersistenceManagerImpl.java index 78b25a8a2..919669365 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/NonTransactionalPersistenceManagerImpl.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/NonTransactionalPersistenceManagerImpl.java @@ -74,11 +74,13 @@ public class NonTransactionalPersistenceManagerImpl extends AbstractPersistenceM response = ((ODataBasicRequest) req).execute(); } - if (response instanceof ODataEntityCreateResponse && response.getStatusCode() == 201) { + if (entry.getValue() != null + && response instanceof ODataEntityCreateResponse && response.getStatusCode() == 201) { entry.getValue().setEntity(((ODataEntityCreateResponse) response).getBody()); responses.put(virtualContentID, entry.getValue().getEntityURI()); LOG.debug("Upgrade created object '{}'", entry.getValue()); - } else if (response instanceof ODataEntityUpdateResponse && response.getStatusCode() == 200) { + } else if (entry.getValue() != null + && response instanceof ODataEntityUpdateResponse && response.getStatusCode() == 200) { entry.getValue().setEntity(((ODataEntityUpdateResponse) response).getBody()); responses.put(virtualContentID, entry.getValue().getEntityURI()); LOG.debug("Upgrade updated object '{}'", entry.getValue()); diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/SingletonInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/SingletonInvocationHandler.java deleted file mode 100644 index c5fb53348..000000000 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/SingletonInvocationHandler.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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.io.Serializable; -import java.lang.reflect.Method; -import org.apache.olingo.ext.proxy.AbstractService; -import org.apache.olingo.ext.proxy.api.EntityCollection; -import org.apache.olingo.ext.proxy.api.AbstractSingleton; -import org.apache.olingo.ext.proxy.api.EntityType; - -public class SingletonInvocationHandler< - T extends EntityType, KEY extends Serializable, EC extends EntityCollection> - extends AbstractInvocationHandler - implements AbstractSingleton { - - private static final long serialVersionUID = 2450269053734776228L; - - private final EntitySetInvocationHandler entitySetHandler; - - @SuppressWarnings({"rawtypes", "unchecked"}) - static SingletonInvocationHandler getInstance(final Class ref, final AbstractService service) { - return new SingletonInvocationHandler(ref, service); - } - - @SuppressWarnings({"rawtypes", "unchecked"}) - private SingletonInvocationHandler(final Class ref, final AbstractService service) { - - super(service); - this.entitySetHandler = EntitySetInvocationHandler.getInstance(ref, service); - } - - @Override - public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { - if (isSelfMethod(method, args)) { - return invokeSelfMethod(method, args); - } else { - throw new NoSuchMethodException(method.getName()); - } - } - - @SuppressWarnings("unchecked") - public T load() { - return (T) this.entitySetHandler.execute().iterator().next(); - } -} diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityContext.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityContext.java index ea30345f1..945273e6e 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityContext.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityContext.java @@ -18,6 +18,7 @@ */ package org.apache.olingo.ext.proxy.context; +import java.net.URI; import org.apache.olingo.ext.proxy.commons.EntityInvocationHandler; import java.util.ArrayList; @@ -48,6 +49,13 @@ public class EntityContext implements Iterable { private final Map allAttachedEntities = new LinkedHashMap(); + /** + * Deletes to be performed excluding entities. + *
+ * Attachment order will be maintained. + */ + private final List furtherDeletes = new ArrayList(); + /** * Attaches an entity with status NEW. *
@@ -116,6 +124,7 @@ public class EntityContext implements Iterable { public void detachAll() { allAttachedEntities.clear(); searchableEntities.clear(); + furtherDeletes.clear(); } /** @@ -197,4 +206,12 @@ public class EntityContext implements Iterable { } return res.iterator(); } + + public List getFurtherDeletes() { + return furtherDeletes; + } + + public void addFurtherDeletes(final URI uri) { + furtherDeletes.add(uri); + } } diff --git a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractPOJOGenMojo.java b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractPOJOGenMojo.java index 438aa1c4d..d23d92bb6 100644 --- a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractPOJOGenMojo.java +++ b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractPOJOGenMojo.java @@ -52,9 +52,7 @@ import org.apache.olingo.commons.api.edm.EdmEntitySet; import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.EdmSchema; -import org.apache.olingo.commons.api.edm.EdmSingleton; import org.apache.olingo.commons.api.edm.EdmTerm; -import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; @@ -347,15 +345,6 @@ public abstract class AbstractPOJOGenMojo extends AbstractMojo { objs.put("container", container); parseObj(base, pkg, "entitySet", utility.capitalize(entitySet.getName()) + ".java", objs); } - - if (ODataServiceVersion.valueOf(getVersion().toUpperCase()).compareTo(ODataServiceVersion.V40) >= 0) { - for (EdmSingleton singleton : container.getSingletons()) { - objs.clear(); - objs.put("singleton", singleton); - objs.put("container", container); - parseObj(base, pkg, "singleton", utility.capitalize(singleton.getName()) + ".java", objs); - } - } } } diff --git a/ext/pojogen-maven-plugin/src/main/resources/container.vm b/ext/pojogen-maven-plugin/src/main/resources/container.vm index 4208df2e6..843ff886e 100644 --- a/ext/pojogen-maven-plugin/src/main/resources/container.vm +++ b/ext/pojogen-maven-plugin/src/main/resources/container.vm @@ -31,6 +31,7 @@ import org.apache.olingo.ext.proxy.api.ComplexType; import org.apache.olingo.ext.proxy.api.EntityCollection; import org.apache.olingo.ext.proxy.api.EntityType; import org.apache.olingo.ext.proxy.api.PrimitiveCollection; +import org.apache.olingo.ext.proxy.api.EdmStreamValue; #foreach($ns in $namespaces) import #if($basePackage)${basePackage}.#end${ns}.types.*; #end @@ -45,8 +46,9 @@ import org.apache.olingo.commons.api.edm.geo.Point; import org.apache.olingo.commons.api.edm.geo.Polygon; import java.math.BigDecimal; import java.net.URI; -import java.util.UUID; import java.io.Serializable; +import java.io.InputStream; +import java.util.UUID; import java.util.Collection; import java.util.Calendar; import javax.xml.datatype.Duration; @@ -119,4 +121,6 @@ public interface $utility.capitalize($container.Name) extends PersistenceManager > NEC newComplexCollection(Class ref); > NEC newPrimitiveCollection(Class ref); + + EdmStreamValue newEdmStreamValue(String contentType, InputStream stream); } diff --git a/ext/pojogen-maven-plugin/src/main/resources/entityType.vm b/ext/pojogen-maven-plugin/src/main/resources/entityType.vm index eef066661..42c754958 100644 --- a/ext/pojogen-maven-plugin/src/main/resources/entityType.vm +++ b/ext/pojogen-maven-plugin/src/main/resources/entityType.vm @@ -79,7 +79,7 @@ public interface $utility.capitalize($entityType.Name) #if($keys.contains($property.Name))@Key#end #if($property.Type.FullQualifiedName.toString().equals("Edm.Stream"))#* - *##set( $returnType = "org.apache.olingo.ext.proxy.api.EdmStreamType" )#* + *##set( $returnType = "org.apache.olingo.ext.proxy.api.EdmStreamValue" )#* *##else#* *##set( $returnType = $utility.getJavaType($property.Type, $property.Collection) )#* *##end diff --git a/ext/pojogen-maven-plugin/src/main/resources/singleton.vm b/ext/pojogen-maven-plugin/src/main/resources/singleton.vm deleted file mode 100644 index bcee703e0..000000000 --- a/ext/pojogen-maven-plugin/src/main/resources/singleton.vm +++ /dev/null @@ -1,48 +0,0 @@ -#* - * 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 ${package}; - -//CHECKSTYLE:OFF (Maven checkstyle) -import org.apache.olingo.ext.proxy.api.AbstractSingleton; -import org.apache.olingo.ext.proxy.api.annotations.EntitySet; -import org.apache.olingo.ext.proxy.api.annotations.Singleton; -import org.apache.olingo.ext.proxy.api.annotations.CompoundKey; -import org.apache.olingo.ext.proxy.api.annotations.CompoundKeyElement; -#foreach($ns in $namespaces) -import #if($basePackage)${basePackage}.#end${ns}.types.*; -#end - -import org.apache.olingo.commons.api.edm.geo.Geospatial; -import org.apache.olingo.commons.api.edm.geo.GeospatialCollection; -import org.apache.olingo.commons.api.edm.geo.LineString; -import org.apache.olingo.commons.api.edm.geo.MultiLineString; -import org.apache.olingo.commons.api.edm.geo.MultiPoint; -import org.apache.olingo.commons.api.edm.geo.MultiPolygon; -import org.apache.olingo.commons.api.edm.geo.Point; -import org.apache.olingo.commons.api.edm.geo.Polygon; -import java.math.BigDecimal; -import java.net.URI; -import java.util.UUID; -import java.io.Serializable; -import java.util.Collection; -import java.util.Calendar; -//CHECKSTYLE:ON (Maven checkstyle) - -#parse( "${odataVersion}/singleton.vm" ) - diff --git a/ext/pojogen-maven-plugin/src/main/resources/v30/complexType.vm b/ext/pojogen-maven-plugin/src/main/resources/v30/complexType.vm index 4c2689ebe..6fa23f4ff 100644 --- a/ext/pojogen-maven-plugin/src/main/resources/v30/complexType.vm +++ b/ext/pojogen-maven-plugin/src/main/resources/v30/complexType.vm @@ -28,12 +28,22 @@ public interface $utility.capitalize($complexType.Name) #set( $complexProps = [] ) #foreach($propertyName in $complexType.PropertyNames) - #set($property = $complexType.getProperty($propertyName)) + #set($property = $complexType.getProperty($propertyName))#* - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "$property.Name", type = "$property.Type.FullQualifiedName.toString()", nullable = $property.Nullable) - $utility.getJavaType($property.Type, $property.Collection) get$utility.capitalize($property.Name)(); + *##if($property.Type.FullQualifiedName.toString().equals("Edm.Stream"))#* + *##set( $returnType = "org.apache.olingo.ext.proxy.api.EdmStreamValue" )#* + *##else#* + *##set( $returnType = $utility.getJavaType($property.Type, $property.Collection) )#* + *##end - void set$utility.capitalize($property.Name)($utility.getJavaType($property.Type, $property.Collection) _$utility.uncapitalize($property.Name)); + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "$property.Name", + type = "$property.Type.FullQualifiedName.toString()", + nullable = $property.Nullable) + $returnType get$utility.capitalize($property.Name)(); + + void set$utility.capitalize($property.Name)($returnType _$utility.uncapitalize($property.Name)); #if($utility.isComplex($property.Type.FullQualifiedName))#* *##set( $adding = $complexProps.add($property) ) diff --git a/ext/pojogen-maven-plugin/src/main/resources/v40/complexType.vm b/ext/pojogen-maven-plugin/src/main/resources/v40/complexType.vm index 6b2d0d96b..ce4b0fc29 100644 --- a/ext/pojogen-maven-plugin/src/main/resources/v40/complexType.vm +++ b/ext/pojogen-maven-plugin/src/main/resources/v40/complexType.vm @@ -32,7 +32,13 @@ public interface $utility.capitalize($complexType.Name) #set( $complexProps = [] ) #set( $contained = [] ) #foreach($propertyName in $complexType.PropertyNames) - #set($property = $complexType.getProperty($propertyName)) + #set($property = $complexType.getProperty($propertyName))#* + + *##if($property.Type.FullQualifiedName.toString().equals("Edm.Stream"))#* + *##set( $returnType = "org.apache.olingo.ext.proxy.api.EdmStreamValue" )#* + *##else#* + *##set( $returnType = $utility.getJavaType($property.Type, $property.Collection) )#* + *##end @org.apache.olingo.ext.proxy.api.annotations.Property(name = "$property.Name", type = "$property.Type.getFullQualifiedName().toString()", @@ -45,9 +51,9 @@ public interface $utility.capitalize($complexType.Name) unicode = #if($property.isUnicode())$property.isUnicode()#{else}false#end, collation = "#if($property.getCollation())$property.getCollation()#end", srid = "#if($property.getSRID())$property.getSRID()#end") - $utility.getJavaType($property.Type, $property.Collection) get$utility.capitalize($property.Name)(); + $returnType get$utility.capitalize($property.Name)(); - void set$utility.capitalize($property.Name)($utility.getJavaType($property.Type, $property.Collection) _$utility.uncapitalize($property.Name)); + void set$utility.capitalize($property.Name)($returnType _$utility.uncapitalize($property.Name)); #if($utility.isComplex($property.Type.FullQualifiedName))#* *##set( $adding = $complexProps.add($property) ) diff --git a/ext/pojogen-maven-plugin/src/main/resources/v40/container.vm b/ext/pojogen-maven-plugin/src/main/resources/v40/container.vm index fb8c4b3a8..75277173a 100644 --- a/ext/pojogen-maven-plugin/src/main/resources/v40/container.vm +++ b/ext/pojogen-maven-plugin/src/main/resources/v40/container.vm @@ -17,6 +17,9 @@ * under the License. *# #foreach($singleton in $container.Singletons) - $utility.capitalize($singleton.Name) get$utility.capitalize($singleton.Name)(); + @org.apache.olingo.ext.proxy.api.annotations.Singleton( + name = "$singleton.Name", + container = "${container.Namespace}.${container.Name}") + $utility.getJavaType($singleton.EntityType) get$utility.capitalize($singleton.Name)(); #end diff --git a/ext/pojogen-maven-plugin/src/main/resources/v40/singleton.vm b/ext/pojogen-maven-plugin/src/main/resources/v40/singleton.vm deleted file mode 100644 index 734ddfba8..000000000 --- a/ext/pojogen-maven-plugin/src/main/resources/v40/singleton.vm +++ /dev/null @@ -1,30 +0,0 @@ -#* - * 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. - *# -#set( $keys = $utility.getEntityKeyType($singleton) ) -#if( $keys.size() > 1 ) - #set( $type = $utility.getEdmType($singleton).EntityType.Name + "Key" ) -#elseif( $keys.size() == 1 ) - #set( $type = $keys.values().iterator().next() ) -#else - #set( $type = "" ) -#end - -@org.apache.olingo.ext.proxy.api.annotations.Singleton(name = "$singleton.Name", container = "$container.FullQualifiedName.toString()") -public interface $utility.capitalize($singleton.Name) extends org.apache.olingo.ext.proxy.api.SingleQuery<$utility.getJavaType($singleton.EntityType)>,AbstractSingleton<$utility.getJavaType($singleton.EntityType), $type, $utility.getJavaType($singleton.EntityType)Collection> { -} \ No newline at end of file diff --git a/fit/src/main/java/org/apache/olingo/fit/V4Services.java b/fit/src/main/java/org/apache/olingo/fit/V4Services.java index 0c01f497e..8278e538a 100644 --- a/fit/src/main/java/org/apache/olingo/fit/V4Services.java +++ b/fit/src/main/java/org/apache/olingo/fit/V4Services.java @@ -373,7 +373,7 @@ public class V4Services extends AbstractServices { return StringUtils.isBlank(filter) && StringUtils.isBlank(search) ? NumberUtils.isNumber(type) ? super.getEntityInternal( - uriInfo.getRequestUri().toASCIIString(), accept, "People", type, format, null, null) + uriInfo.getRequestUri().toASCIIString(), accept, "People", type, format, null, null) : super.getEntitySet(accept, "People", type) : super.getEntitySet(uriInfo, accept, "People", top, skip, format, count, filter, orderby, skiptoken); } @@ -754,7 +754,7 @@ public class V4Services extends AbstractServices { return utils.getValue().createResponse( FSManager.instance(version).readFile(Constants.get(version, ConstantKey.REF) - + File.separatorChar + filename, utils.getKey()), + + File.separatorChar + filename, utils.getKey()), null, utils.getKey()); } catch (Exception e) { @@ -794,7 +794,7 @@ public class V4Services extends AbstractServices { final Response response = getEntityInternal(uriInfo.getRequestUri().toASCIIString(), - accept, entitySetName, entityId, accept, StringUtils.EMPTY, StringUtils.EMPTY); + accept, entitySetName, entityId, accept, StringUtils.EMPTY, StringUtils.EMPTY); return response.getStatus() >= 400 ? super.postNewEntity(uriInfo, accept, contentType, prefer, entitySetName, changes) : super.patchEntity(uriInfo, accept, contentType, prefer, ifMatch, entitySetName, entityId, changes); @@ -1020,7 +1020,7 @@ public class V4Services extends AbstractServices { // 1. Fetch the contained entity to be removed final InputStream entry = FSManager.instance(version). readFile(containedPath(entityId, containedEntitySetName). - append('(').append(containedEntityId).append(')').toString(), Accept.ATOM); + append('(').append(containedEntityId).append(')').toString(), Accept.ATOM); final ResWrap container = atomDeserializer.toEntity(entry); // 2. Remove the contained entity @@ -1294,7 +1294,7 @@ public class V4Services extends AbstractServices { final ResWrap result = new ResWrap( URI.create(Constants.get(version, ConstantKey.ODATA_METADATA_PREFIX) - + "Microsoft.Test.OData.Services.ODataWCFService.Address"), + + "Microsoft.Test.OData.Services.ODataWCFService.Address"), null, entity.getProperty("address")); @@ -1362,4 +1362,17 @@ public class V4Services extends AbstractServices { return xml.createResponse(null, null, null, Status.NO_CONTENT); } + + @GET + @Path("/Company/VipCustomer") + public Response getVipCustomer( + @Context final UriInfo uriInfo, + @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept, + @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format, + @QueryParam("$expand") @DefaultValue(StringUtils.EMPTY) final String expand, + @QueryParam("$select") @DefaultValue(StringUtils.EMPTY) final String select) { + + return super.getEntityInternal( + uriInfo.getRequestUri().toASCIIString(), accept, "VipCustomer", "1", format, expand, select); + } } diff --git a/fit/src/main/resources/V40/VipCustomer/1/entity.full.json b/fit/src/main/resources/V40/VipCustomer/1/entity.full.json new file mode 100644 index 000000000..ee9e31a72 --- /dev/null +++ b/fit/src/main/resources/V40/VipCustomer/1/entity.full.json @@ -0,0 +1,7 @@ +{ + "@odata.context": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#VipCustomers/$entity", + "@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.Customer", + "@odata.id": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/VipCustomers(PersonID=1)", + "@odata.editLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/VipCustomers(PersonID=1)", + "PersonID": 1 +} \ No newline at end of file diff --git a/fit/src/main/resources/V40/VipCustomer/1/entity.xml b/fit/src/main/resources/V40/VipCustomer/1/entity.xml new file mode 100644 index 000000000..21bbe93be --- /dev/null +++ b/fit/src/main/resources/V40/VipCustomer/1/entity.xml @@ -0,0 +1,44 @@ + + + + http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/VipCustomers(PersonID=1) + + + + + + + <updated>2014-03-24T17:03:20Z</updated> + <author> + <name /> + </author> + <content type="application/xml"> + <m:properties> + <d:PersonID m:type="Int32">1</d:PersonID> + </m:properties> + </content> +</entry> \ No newline at end of file diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTestITCase.java index 7c5379855..df2a0036b 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v3; import static org.junit.Assert.assertEquals; diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/ContextTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/ContextTestITCase.java index 7ef23656b..3d8c225d4 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/ContextTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/ContextTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v3; //CHECKSTYLE:OFF (Maven checkstyle) diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java index bda7f9e94..56e4cba05 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v3; //CHECKSTYLE:OFF (Maven checkstyle) diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityUpdateTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityUpdateTestITCase.java index fd2be177e..a7a8beca6 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityUpdateTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityUpdateTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v3; //CHECKSTYLE:OFF (Maven checkstyle) diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/InvokeTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/InvokeTestITCase.java index 2c4008869..c278abfa3 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/InvokeTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/InvokeTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v3; //CHECKSTYLE:OFF (Maven checkstyle) diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/MediaEntityTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/MediaEntityTestITCase.java index cf8410c10..3a610824a 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/MediaEntityTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/MediaEntityTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v3; import org.apache.commons.io.IOUtils; @@ -25,8 +26,8 @@ import org.junit.Test; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; -import org.apache.olingo.ext.proxy.commons.EdmStreamTypeImpl; import org.apache.olingo.ext.proxy.api.EdmStreamValue; +import static org.apache.olingo.fit.proxy.v3.AbstractTestITCase.container; import static org.apache.olingo.fit.proxy.v3.AbstractTestITCase.service; import static org.junit.Assert.assertEquals; @@ -52,7 +53,7 @@ public class MediaEntityTestITCase extends AbstractTestITCase { final InputStream input = new ByteArrayInputStream(TO_BE_UPDATED.getBytes()); Car car = container.getCar().getByKey(12); - car.setPhoto(new EdmStreamTypeImpl(new EdmStreamValue("application/octet-stream", input))); + car.setPhoto(container.newEdmStreamValue("application/octet-stream", input)); container.flush(); @@ -70,7 +71,7 @@ public class MediaEntityTestITCase extends AbstractTestITCase { final String TO_BE_UPDATED = "buffered stream sample (" + System.currentTimeMillis() + ")"; InputStream input = IOUtils.toInputStream(TO_BE_UPDATED); - car.uploadStream(new EdmStreamValue("*/*", input)); + car.uploadStream(container.newEdmStreamValue("*/*", input)); container.flush(); @@ -89,7 +90,7 @@ public class MediaEntityTestITCase extends AbstractTestITCase { InputStream input = IOUtils.toInputStream(TO_BE_UPDATED); final String DESC = "DESC - " + System.currentTimeMillis(); - car.uploadStream(new EdmStreamValue("*/*", input)); + car.uploadStream(container.newEdmStreamValue("*/*", input)); car.setDescription(DESC); container.getCar().add(car); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/OpenTypeTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/OpenTypeTestITCase.java index a0e8b9972..1ffa7d4c0 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/OpenTypeTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/OpenTypeTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v3; import static org.junit.Assert.assertEquals; diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java index 4fd9ac3c6..606579cd9 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java @@ -26,7 +26,9 @@ import org.apache.olingo.ext.proxy.api.ComplexType; import org.apache.olingo.ext.proxy.api.EntityCollection; import org.apache.olingo.ext.proxy.api.EntityType; import org.apache.olingo.ext.proxy.api.PrimitiveCollection; +import org.apache.olingo.ext.proxy.api.EdmStreamValue; import java.io.Serializable; +import java.io.InputStream; //CHECKSTYLE:ON (Maven checkstyle) @org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService") @@ -113,4 +115,6 @@ public interface DefaultContainer extends PersistenceManager { <T extends ComplexType, NEC extends ComplexCollection<T>> NEC newComplexCollection(Class<NEC> ref); <T extends Serializable, NEC extends PrimitiveCollection<T>> NEC newPrimitiveCollection(Class<T> ref); + + EdmStreamValue newEdmStreamValue(String contentType, InputStream stream); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Aliases.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Aliases.java index cb007f93a..7f42e9151 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Aliases.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Aliases.java @@ -28,7 +28,11 @@ public interface Aliases - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "AlternativeNames", type = "Edm.String", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "AlternativeNames", + type = "Edm.String", + nullable = false) org.apache.olingo.ext.proxy.api.PrimitiveCollection<java.lang.String> getAlternativeNames(); void setAlternativeNames(org.apache.olingo.ext.proxy.api.PrimitiveCollection<java.lang.String> _alternativeNames); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/AuditInfo.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/AuditInfo.java index 5cea69b3b..996ef053b 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/AuditInfo.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/AuditInfo.java @@ -28,21 +28,33 @@ public interface AuditInfo - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "ModifiedDate", type = "Edm.DateTime", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "ModifiedDate", + type = "Edm.DateTime", + nullable = false) java.sql.Timestamp getModifiedDate(); void setModifiedDate(java.sql.Timestamp _modifiedDate); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "ModifiedBy", type = "Edm.String", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "ModifiedBy", + type = "Edm.String", + nullable = true) java.lang.String getModifiedBy(); void setModifiedBy(java.lang.String _modifiedBy); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Concurrency", type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Concurrency", + type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo", + nullable = true) org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo getConcurrency(); void setConcurrency(org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo _concurrency); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine.java index 8fd9ba137..76d90ff73 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine.java @@ -59,9 +59,9 @@ public interface BackOrderLine fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getOrderLineStream(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getOrderLineStream(); - void setOrderLineStream(org.apache.olingo.ext.proxy.api.EdmStreamType _orderLineStream); + void setOrderLineStream(org.apache.olingo.ext.proxy.api.EdmStreamValue _orderLineStream); @Key @org.apache.olingo.ext.proxy.api.annotations.Property(name = "OrderId", diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2.java index 1e90f5a08..7455df715 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2.java @@ -59,9 +59,9 @@ public interface BackOrderLine2 fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getOrderLineStream(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getOrderLineStream(); - void setOrderLineStream(org.apache.olingo.ext.proxy.api.EdmStreamType _orderLineStream); + void setOrderLineStream(org.apache.olingo.ext.proxy.api.EdmStreamValue _orderLineStream); @Key @org.apache.olingo.ext.proxy.api.annotations.Property(name = "OrderId", diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Car.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Car.java index d65a2ea44..24377bb1c 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Car.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Car.java @@ -55,9 +55,9 @@ public interface Car fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getPhoto(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getPhoto(); - void setPhoto(org.apache.olingo.ext.proxy.api.EdmStreamType _photo); + void setPhoto(org.apache.olingo.ext.proxy.api.EdmStreamValue _photo); @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Video", @@ -78,9 +78,9 @@ public interface Car fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getVideo(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getVideo(); - void setVideo(org.apache.olingo.ext.proxy.api.EdmStreamType _video); + void setVideo(org.apache.olingo.ext.proxy.api.EdmStreamValue _video); @Key @org.apache.olingo.ext.proxy.api.annotations.Property(name = "VIN", diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/ComplexToCategory.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/ComplexToCategory.java index a753d8475..f46924653 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/ComplexToCategory.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/ComplexToCategory.java @@ -28,21 +28,33 @@ public interface ComplexToCategory - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Term", type = "Edm.String", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Term", + type = "Edm.String", + nullable = true) java.lang.String getTerm(); void setTerm(java.lang.String _term); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Scheme", type = "Edm.String", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Scheme", + type = "Edm.String", + nullable = true) java.lang.String getScheme(); void setScheme(java.lang.String _scheme); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Label", type = "Edm.String", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Label", + type = "Edm.String", + nullable = true) java.lang.String getLabel(); void setLabel(java.lang.String _label); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/ConcurrencyInfo.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/ConcurrencyInfo.java index 574fd61c8..bf7819f82 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/ConcurrencyInfo.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/ConcurrencyInfo.java @@ -28,14 +28,22 @@ public interface ConcurrencyInfo - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Token", type = "Edm.String", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Token", + type = "Edm.String", + nullable = true) java.lang.String getToken(); void setToken(java.lang.String _token); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "QueriedDateTime", type = "Edm.DateTime", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "QueriedDateTime", + type = "Edm.DateTime", + nullable = true) java.sql.Timestamp getQueriedDateTime(); void setQueriedDateTime(java.sql.Timestamp _queriedDateTime); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/ContactDetails.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/ContactDetails.java index 76191be29..5f8f1d621 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/ContactDetails.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/ContactDetails.java @@ -28,42 +28,66 @@ public interface ContactDetails - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "EmailBag", type = "Edm.String", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "EmailBag", + type = "Edm.String", + nullable = false) org.apache.olingo.ext.proxy.api.PrimitiveCollection<java.lang.String> getEmailBag(); void setEmailBag(org.apache.olingo.ext.proxy.api.PrimitiveCollection<java.lang.String> _emailBag); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "AlternativeNames", type = "Edm.String", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "AlternativeNames", + type = "Edm.String", + nullable = false) org.apache.olingo.ext.proxy.api.PrimitiveCollection<java.lang.String> getAlternativeNames(); void setAlternativeNames(org.apache.olingo.ext.proxy.api.PrimitiveCollection<java.lang.String> _alternativeNames); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "ContactAlias", type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "ContactAlias", + type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases", + nullable = true) org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Aliases getContactAlias(); void setContactAlias(org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Aliases _contactAlias); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "HomePhone", type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "HomePhone", + type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone", + nullable = true) org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Phone getHomePhone(); void setHomePhone(org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Phone _homePhone); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "WorkPhone", type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "WorkPhone", + type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone", + nullable = true) org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Phone getWorkPhone(); void setWorkPhone(org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Phone _workPhone); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "MobilePhoneBag", type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "MobilePhoneBag", + type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone", + nullable = false) org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PhoneCollection getMobilePhoneBag(); void setMobilePhoneBag(org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PhoneCollection _mobilePhoneBag); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Customer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Customer.java index c088d065f..eb52f83c2 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Customer.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Customer.java @@ -55,9 +55,9 @@ public interface Customer fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getThumbnail(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getThumbnail(); - void setThumbnail(org.apache.olingo.ext.proxy.api.EdmStreamType _thumbnail); + void setThumbnail(org.apache.olingo.ext.proxy.api.EdmStreamValue _thumbnail); @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Video", @@ -78,9 +78,9 @@ public interface Customer fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getVideo(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getVideo(); - void setVideo(org.apache.olingo.ext.proxy.api.EdmStreamType _video); + void setVideo(org.apache.olingo.ext.proxy.api.EdmStreamValue _video); @Key @org.apache.olingo.ext.proxy.api.annotations.Property(name = "CustomerId", diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Dimensions.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Dimensions.java index acf138faf..3b4fd458c 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Dimensions.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Dimensions.java @@ -28,21 +28,33 @@ public interface Dimensions - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Width", type = "Edm.Decimal", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Width", + type = "Edm.Decimal", + nullable = false) java.math.BigDecimal getWidth(); void setWidth(java.math.BigDecimal _width); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Height", type = "Edm.Decimal", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Height", + type = "Edm.Decimal", + nullable = false) java.math.BigDecimal getHeight(); void setHeight(java.math.BigDecimal _height); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Depth", type = "Edm.Decimal", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Depth", + type = "Edm.Decimal", + nullable = false) java.math.BigDecimal getDepth(); void setDepth(java.math.BigDecimal _depth); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProduct.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProduct.java index 23a45675f..c5126ca6d 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProduct.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProduct.java @@ -58,9 +58,9 @@ public interface DiscontinuedProduct fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getPicture(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getPicture(); - void setPicture(org.apache.olingo.ext.proxy.api.EdmStreamType _picture); + void setPicture(org.apache.olingo.ext.proxy.api.EdmStreamValue _picture); @Key @org.apache.olingo.ext.proxy.api.annotations.Property(name = "ProductId", diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/OrderLine.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/OrderLine.java index 855541458..59161bb79 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/OrderLine.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/OrderLine.java @@ -57,9 +57,9 @@ public interface OrderLine fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getOrderLineStream(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getOrderLineStream(); - void setOrderLineStream(org.apache.olingo.ext.proxy.api.EdmStreamType _orderLineStream); + void setOrderLineStream(org.apache.olingo.ext.proxy.api.EdmStreamValue _orderLineStream); @Key @org.apache.olingo.ext.proxy.api.annotations.Property(name = "OrderId", diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Phone.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Phone.java index d235dfe1e..a68e4d564 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Phone.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Phone.java @@ -28,14 +28,22 @@ public interface Phone - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "PhoneNumber", type = "Edm.String", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "PhoneNumber", + type = "Edm.String", + nullable = true) java.lang.String getPhoneNumber(); void setPhoneNumber(java.lang.String _phoneNumber); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Extension", type = "Edm.String", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Extension", + type = "Edm.String", + nullable = true) java.lang.String getExtension(); void setExtension(java.lang.String _extension); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Product.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Product.java index e40f16ea3..484bd0013 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Product.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/actionoverloading/microsoft/test/odata/services/astoriadefaultservice/types/Product.java @@ -56,9 +56,9 @@ public interface Product fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getPicture(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getPicture(); - void setPicture(org.apache.olingo.ext.proxy.api.EdmStreamType _picture); + void setPicture(org.apache.olingo.ext.proxy.api.EdmStreamValue _picture); @Key @org.apache.olingo.ext.proxy.api.annotations.Property(name = "ProductId", diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/opentype/microsoft/test/odata/services/opentypesservicev3/DefaultContainer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/opentype/microsoft/test/odata/services/opentypesservicev3/DefaultContainer.java index b4e0551f0..ce848b1d0 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/opentype/microsoft/test/odata/services/opentypesservicev3/DefaultContainer.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/opentype/microsoft/test/odata/services/opentypesservicev3/DefaultContainer.java @@ -25,7 +25,9 @@ import org.apache.olingo.ext.proxy.api.ComplexType; import org.apache.olingo.ext.proxy.api.EntityCollection; import org.apache.olingo.ext.proxy.api.EntityType; import org.apache.olingo.ext.proxy.api.PrimitiveCollection; +import org.apache.olingo.ext.proxy.api.EdmStreamValue; import java.io.Serializable; +import java.io.InputStream; //CHECKSTYLE:ON (Maven checkstyle) @org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.OpenTypesServiceV3") @@ -57,4 +59,6 @@ public interface DefaultContainer extends PersistenceManager { <T extends ComplexType, NEC extends ComplexCollection<T>> NEC newComplexCollection(Class<NEC> ref); <T extends Serializable, NEC extends PrimitiveCollection<T>> NEC newPrimitiveCollection(Class<T> ref); + + EdmStreamValue newEdmStreamValue(String contentType, InputStream stream); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/opentype/microsoft/test/odata/services/opentypesservicev3/types/ContactDetails.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/opentype/microsoft/test/odata/services/opentypesservicev3/types/ContactDetails.java index e15eba4ca..1bf84be72 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/opentype/microsoft/test/odata/services/opentypesservicev3/types/ContactDetails.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/opentype/microsoft/test/odata/services/opentypesservicev3/types/ContactDetails.java @@ -28,84 +28,132 @@ public interface ContactDetails - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "FirstContacted", type = "Edm.Binary", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "FirstContacted", + type = "Edm.Binary", + nullable = true) byte[] getFirstContacted(); void setFirstContacted(byte[] _firstContacted); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "LastContacted", type = "Edm.DateTimeOffset", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "LastContacted", + type = "Edm.DateTimeOffset", + nullable = false) java.sql.Timestamp getLastContacted(); void setLastContacted(java.sql.Timestamp _lastContacted); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Contacted", type = "Edm.DateTime", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Contacted", + type = "Edm.DateTime", + nullable = false) java.sql.Timestamp getContacted(); void setContacted(java.sql.Timestamp _contacted); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "GUID", type = "Edm.Guid", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "GUID", + type = "Edm.Guid", + nullable = false) java.util.UUID getGUID(); void setGUID(java.util.UUID _gUID); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "PreferedContactTime", type = "Edm.Time", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "PreferedContactTime", + type = "Edm.Time", + nullable = false) java.math.BigDecimal getPreferedContactTime(); void setPreferedContactTime(java.math.BigDecimal _preferedContactTime); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Byte", type = "Edm.Byte", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Byte", + type = "Edm.Byte", + nullable = false) java.lang.Short getByte(); void setByte(java.lang.Short _byte); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "SignedByte", type = "Edm.SByte", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "SignedByte", + type = "Edm.SByte", + nullable = false) java.lang.Byte getSignedByte(); void setSignedByte(java.lang.Byte _signedByte); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Double", type = "Edm.Double", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Double", + type = "Edm.Double", + nullable = false) java.lang.Double getDouble(); void setDouble(java.lang.Double _double); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Single", type = "Edm.Single", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Single", + type = "Edm.Single", + nullable = false) java.lang.Float getSingle(); void setSingle(java.lang.Float _single); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Short", type = "Edm.Int16", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Short", + type = "Edm.Int16", + nullable = false) java.lang.Short getShort(); void setShort(java.lang.Short _short); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Int", type = "Edm.Int32", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Int", + type = "Edm.Int32", + nullable = false) java.lang.Integer getInt(); void setInt(java.lang.Integer _int); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Long", type = "Edm.Int64", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Long", + type = "Edm.Int64", + nullable = false) java.lang.Long getLong(); void setLong(java.lang.Long _long); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/primitivekeys/microsoft/test/odata/services/primitivekeysservice/TestContext.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/primitivekeys/microsoft/test/odata/services/primitivekeysservice/TestContext.java index 0c87752b6..f3a3f85d2 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/primitivekeys/microsoft/test/odata/services/primitivekeysservice/TestContext.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/primitivekeys/microsoft/test/odata/services/primitivekeysservice/TestContext.java @@ -25,7 +25,9 @@ import org.apache.olingo.ext.proxy.api.ComplexType; import org.apache.olingo.ext.proxy.api.EntityCollection; import org.apache.olingo.ext.proxy.api.EntityType; import org.apache.olingo.ext.proxy.api.PrimitiveCollection; +import org.apache.olingo.ext.proxy.api.EdmStreamValue; import java.io.Serializable; +import java.io.InputStream; //CHECKSTYLE:ON (Maven checkstyle) @org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.PrimitiveKeysService") @@ -83,4 +85,6 @@ public interface TestContext extends PersistenceManager { <T extends ComplexType, NEC extends ComplexCollection<T>> NEC newComplexCollection(Class<NEC> ref); <T extends Serializable, NEC extends PrimitiveCollection<T>> NEC newPrimitiveCollection(Class<T> ref); + + EdmStreamValue newEdmStreamValue(String contentType, InputStream stream); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java index a4bd08077..d95cbe8ab 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java @@ -26,7 +26,9 @@ import org.apache.olingo.ext.proxy.api.ComplexType; import org.apache.olingo.ext.proxy.api.EntityCollection; import org.apache.olingo.ext.proxy.api.EntityType; import org.apache.olingo.ext.proxy.api.PrimitiveCollection; +import org.apache.olingo.ext.proxy.api.EdmStreamValue; import java.io.Serializable; +import java.io.InputStream; //CHECKSTYLE:ON (Maven checkstyle) @org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService") @@ -151,4 +153,6 @@ public interface DefaultContainer extends PersistenceManager { <T extends ComplexType, NEC extends ComplexCollection<T>> NEC newComplexCollection(Class<NEC> ref); <T extends Serializable, NEC extends PrimitiveCollection<T>> NEC newPrimitiveCollection(Class<T> ref); + + EdmStreamValue newEdmStreamValue(String contentType, InputStream stream); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Aliases.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Aliases.java index 2b049bd4b..1dca6a71f 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Aliases.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Aliases.java @@ -28,7 +28,11 @@ public interface Aliases - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "AlternativeNames", type = "Edm.String", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "AlternativeNames", + type = "Edm.String", + nullable = false) org.apache.olingo.ext.proxy.api.PrimitiveCollection<java.lang.String> getAlternativeNames(); void setAlternativeNames(org.apache.olingo.ext.proxy.api.PrimitiveCollection<java.lang.String> _alternativeNames); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AuditInfo.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AuditInfo.java index 52b9c0847..22e26251a 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AuditInfo.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AuditInfo.java @@ -28,21 +28,33 @@ public interface AuditInfo - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "ModifiedDate", type = "Edm.DateTime", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "ModifiedDate", + type = "Edm.DateTime", + nullable = false) java.sql.Timestamp getModifiedDate(); void setModifiedDate(java.sql.Timestamp _modifiedDate); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "ModifiedBy", type = "Edm.String", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "ModifiedBy", + type = "Edm.String", + nullable = true) java.lang.String getModifiedBy(); void setModifiedBy(java.lang.String _modifiedBy); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Concurrency", type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Concurrency", + type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo", + nullable = true) org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo getConcurrency(); void setConcurrency(org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo _concurrency); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine.java index 9e80aa2ab..99f7bf660 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine.java @@ -59,9 +59,9 @@ public interface BackOrderLine fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getOrderLineStream(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getOrderLineStream(); - void setOrderLineStream(org.apache.olingo.ext.proxy.api.EdmStreamType _orderLineStream); + void setOrderLineStream(org.apache.olingo.ext.proxy.api.EdmStreamValue _orderLineStream); @Key @org.apache.olingo.ext.proxy.api.annotations.Property(name = "OrderId", diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2.java index 84b26c172..de71571c1 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2.java @@ -59,9 +59,9 @@ public interface BackOrderLine2 fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getOrderLineStream(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getOrderLineStream(); - void setOrderLineStream(org.apache.olingo.ext.proxy.api.EdmStreamType _orderLineStream); + void setOrderLineStream(org.apache.olingo.ext.proxy.api.EdmStreamValue _orderLineStream); @Key @org.apache.olingo.ext.proxy.api.annotations.Property(name = "OrderId", diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Car.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Car.java index d94b633cd..74a5ef7f4 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Car.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Car.java @@ -55,9 +55,9 @@ public interface Car fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getPhoto(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getPhoto(); - void setPhoto(org.apache.olingo.ext.proxy.api.EdmStreamType _photo); + void setPhoto(org.apache.olingo.ext.proxy.api.EdmStreamValue _photo); @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Video", @@ -78,9 +78,9 @@ public interface Car fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getVideo(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getVideo(); - void setVideo(org.apache.olingo.ext.proxy.api.EdmStreamType _video); + void setVideo(org.apache.olingo.ext.proxy.api.EdmStreamValue _video); @Key @org.apache.olingo.ext.proxy.api.annotations.Property(name = "VIN", diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexToCategory.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexToCategory.java index 0eb735499..56fbd2a73 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexToCategory.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexToCategory.java @@ -28,21 +28,33 @@ public interface ComplexToCategory - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Term", type = "Edm.String", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Term", + type = "Edm.String", + nullable = true) java.lang.String getTerm(); void setTerm(java.lang.String _term); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Scheme", type = "Edm.String", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Scheme", + type = "Edm.String", + nullable = true) java.lang.String getScheme(); void setScheme(java.lang.String _scheme); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Label", type = "Edm.String", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Label", + type = "Edm.String", + nullable = true) java.lang.String getLabel(); void setLabel(java.lang.String _label); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexWithAllPrimitiveTypes.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexWithAllPrimitiveTypes.java index 5f072bbf4..835436997 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexWithAllPrimitiveTypes.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexWithAllPrimitiveTypes.java @@ -28,98 +28,154 @@ public interface ComplexWithAllPrimitiveTypes - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Binary", type = "Edm.Binary", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Binary", + type = "Edm.Binary", + nullable = true) byte[] getBinary(); void setBinary(byte[] _binary); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Boolean", type = "Edm.Boolean", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Boolean", + type = "Edm.Boolean", + nullable = false) java.lang.Boolean getBoolean(); void setBoolean(java.lang.Boolean _boolean); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Byte", type = "Edm.Byte", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Byte", + type = "Edm.Byte", + nullable = false) java.lang.Short getByte(); void setByte(java.lang.Short _byte); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "DateTime", type = "Edm.DateTime", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "DateTime", + type = "Edm.DateTime", + nullable = false) java.sql.Timestamp getDateTime(); void setDateTime(java.sql.Timestamp _dateTime); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Decimal", type = "Edm.Decimal", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Decimal", + type = "Edm.Decimal", + nullable = false) java.math.BigDecimal getDecimal(); void setDecimal(java.math.BigDecimal _decimal); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Double", type = "Edm.Double", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Double", + type = "Edm.Double", + nullable = false) java.lang.Double getDouble(); void setDouble(java.lang.Double _double); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Int16", type = "Edm.Int16", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Int16", + type = "Edm.Int16", + nullable = false) java.lang.Short getInt16(); void setInt16(java.lang.Short _int16); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Int32", type = "Edm.Int32", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Int32", + type = "Edm.Int32", + nullable = false) java.lang.Integer getInt32(); void setInt32(java.lang.Integer _int32); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Int64", type = "Edm.Int64", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Int64", + type = "Edm.Int64", + nullable = false) java.lang.Long getInt64(); void setInt64(java.lang.Long _int64); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "SByte", type = "Edm.SByte", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "SByte", + type = "Edm.SByte", + nullable = false) java.lang.Byte getSByte(); void setSByte(java.lang.Byte _sByte); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "String", type = "Edm.String", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "String", + type = "Edm.String", + nullable = true) java.lang.String getString(); void setString(java.lang.String _string); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Single", type = "Edm.Single", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Single", + type = "Edm.Single", + nullable = false) java.lang.Float getSingle(); void setSingle(java.lang.Float _single); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "GeographyPoint", type = "Edm.GeographyPoint", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "GeographyPoint", + type = "Edm.GeographyPoint", + nullable = true) org.apache.olingo.commons.api.edm.geo.Point getGeographyPoint(); void setGeographyPoint(org.apache.olingo.commons.api.edm.geo.Point _geographyPoint); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "GeometryPoint", type = "Edm.GeometryPoint", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "GeometryPoint", + type = "Edm.GeometryPoint", + nullable = true) org.apache.olingo.commons.api.edm.geo.Point getGeometryPoint(); void setGeometryPoint(org.apache.olingo.commons.api.edm.geo.Point _geometryPoint); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ConcurrencyInfo.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ConcurrencyInfo.java index ca3a773ca..6e207061a 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ConcurrencyInfo.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ConcurrencyInfo.java @@ -28,14 +28,22 @@ public interface ConcurrencyInfo - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Token", type = "Edm.String", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Token", + type = "Edm.String", + nullable = true) java.lang.String getToken(); void setToken(java.lang.String _token); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "QueriedDateTime", type = "Edm.DateTime", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "QueriedDateTime", + type = "Edm.DateTime", + nullable = true) java.sql.Timestamp getQueriedDateTime(); void setQueriedDateTime(java.sql.Timestamp _queriedDateTime); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ContactDetails.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ContactDetails.java index c325131de..40cb5862e 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ContactDetails.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ContactDetails.java @@ -28,42 +28,66 @@ public interface ContactDetails - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "EmailBag", type = "Edm.String", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "EmailBag", + type = "Edm.String", + nullable = false) org.apache.olingo.ext.proxy.api.PrimitiveCollection<java.lang.String> getEmailBag(); void setEmailBag(org.apache.olingo.ext.proxy.api.PrimitiveCollection<java.lang.String> _emailBag); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "AlternativeNames", type = "Edm.String", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "AlternativeNames", + type = "Edm.String", + nullable = false) org.apache.olingo.ext.proxy.api.PrimitiveCollection<java.lang.String> getAlternativeNames(); void setAlternativeNames(org.apache.olingo.ext.proxy.api.PrimitiveCollection<java.lang.String> _alternativeNames); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "ContactAlias", type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "ContactAlias", + type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases", + nullable = true) org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Aliases getContactAlias(); void setContactAlias(org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Aliases _contactAlias); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "HomePhone", type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.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(org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone _homePhone); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "WorkPhone", type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.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(org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone _workPhone); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "MobilePhoneBag", type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "MobilePhoneBag", + type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone", + nullable = false) org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.PhoneCollection getMobilePhoneBag(); void setMobilePhoneBag(org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.PhoneCollection _mobilePhoneBag); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Customer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Customer.java index 886ded430..5212c22da 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Customer.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Customer.java @@ -55,9 +55,9 @@ public interface Customer fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getThumbnail(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getThumbnail(); - void setThumbnail(org.apache.olingo.ext.proxy.api.EdmStreamType _thumbnail); + void setThumbnail(org.apache.olingo.ext.proxy.api.EdmStreamValue _thumbnail); @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Video", @@ -78,9 +78,9 @@ public interface Customer fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getVideo(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getVideo(); - void setVideo(org.apache.olingo.ext.proxy.api.EdmStreamType _video); + void setVideo(org.apache.olingo.ext.proxy.api.EdmStreamValue _video); @Key @org.apache.olingo.ext.proxy.api.annotations.Property(name = "CustomerId", diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Dimensions.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Dimensions.java index 98c7a104e..d743fb2a3 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Dimensions.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Dimensions.java @@ -28,21 +28,33 @@ public interface Dimensions - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Width", type = "Edm.Decimal", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Width", + type = "Edm.Decimal", + nullable = false) java.math.BigDecimal getWidth(); void setWidth(java.math.BigDecimal _width); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Height", type = "Edm.Decimal", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Height", + type = "Edm.Decimal", + nullable = false) java.math.BigDecimal getHeight(); void setHeight(java.math.BigDecimal _height); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Depth", type = "Edm.Decimal", nullable = false) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Depth", + type = "Edm.Decimal", + nullable = false) java.math.BigDecimal getDepth(); void setDepth(java.math.BigDecimal _depth); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProduct.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProduct.java index f1de80062..50fae2235 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProduct.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProduct.java @@ -58,9 +58,9 @@ public interface DiscontinuedProduct fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getPicture(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getPicture(); - void setPicture(org.apache.olingo.ext.proxy.api.EdmStreamType _picture); + void setPicture(org.apache.olingo.ext.proxy.api.EdmStreamValue _picture); @Key @org.apache.olingo.ext.proxy.api.annotations.Property(name = "ProductId", diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLine.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLine.java index 51e402c72..4a1e58182 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLine.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLine.java @@ -56,9 +56,9 @@ public interface OrderLine fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getOrderLineStream(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getOrderLineStream(); - void setOrderLineStream(org.apache.olingo.ext.proxy.api.EdmStreamType _orderLineStream); + void setOrderLineStream(org.apache.olingo.ext.proxy.api.EdmStreamValue _orderLineStream); @Key @org.apache.olingo.ext.proxy.api.annotations.Property(name = "OrderId", diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Phone.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Phone.java index 6db36feef..032b6fb32 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Phone.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Phone.java @@ -28,14 +28,22 @@ public interface Phone - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "PhoneNumber", type = "Edm.String", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "PhoneNumber", + type = "Edm.String", + nullable = true) java.lang.String getPhoneNumber(); void setPhoneNumber(java.lang.String _phoneNumber); - @org.apache.olingo.ext.proxy.api.annotations.Property(name = "Extension", type = "Edm.String", nullable = true) + + @org.apache.olingo.ext.proxy.api.annotations.Property( + name = "Extension", + type = "Edm.String", + nullable = true) java.lang.String getExtension(); void setExtension(java.lang.String _extension); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Product.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Product.java index d2c41ec0c..233b8010c 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Product.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Product.java @@ -57,9 +57,9 @@ public interface Product fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getPicture(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getPicture(); - void setPicture(org.apache.olingo.ext.proxy.api.EdmStreamType _picture); + void setPicture(org.apache.olingo.ext.proxy.api.EdmStreamValue _picture); @Key @org.apache.olingo.ext.proxy.api.annotations.Property(name = "ProductId", diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/APIBasicDesignTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/APIBasicDesignTestITCase.java index b0dbde436..19972875a 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/APIBasicDesignTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/APIBasicDesignTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v4; import static org.junit.Assert.assertEquals; @@ -38,7 +39,6 @@ import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.ext.proxy.AbstractService; import org.apache.olingo.ext.proxy.api.EdmStreamValue; import org.apache.olingo.ext.proxy.api.PrimitiveCollection; -import org.apache.olingo.ext.proxy.commons.EdmStreamTypeImpl; 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.ContactDetailsCollection; import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.PhoneCollection; @@ -210,10 +210,20 @@ public class APIBasicDesignTestITCase extends AbstractTestITCase { service.getContext().detachAll(); - // Delete order ... + // (1) Delete by key (see EntityCreateTestITCase) + getContainer().getOrders().delete(1105); + assertNull(getContainer().getOrders().getByKey(1105)); + + service.getContext().detachAll(); // detach to show the second delete case + + // (2) Delete by object (see EntityCreateTestITCase) getContainer().getOrders().delete(getContainer().getOrders().getByKey(1105)); - actual = getContainer().getOrders().getByKey(1105); - assertNull(actual); + assertNull(getContainer().getOrders().getByKey(1105)); + + // (3) Delete by invoking delete method on the object itself + service.getContext().detachAll(); // detach to show the third delete case + getContainer().getOrders().getByKey(1105).delete(); + assertNull(getContainer().getOrders().getByKey(1105)); getContainer().flush(); @@ -255,8 +265,7 @@ public class APIBasicDesignTestITCase extends AbstractTestITCase { final PersonDetail personDetail = dcontainer.getPersonDetails().getByKey(1); // NO HTTP Request // 1 HTTP Request to add an Edm.Stream property value about MediaEditLink Photo - personDetail.setPhoto( - new EdmStreamTypeImpl(new EdmStreamValue("application/octet-stream", IOUtils.toInputStream(random)))); + personDetail.setPhoto(dcontainer.newEdmStreamValue("application/octet-stream", IOUtils.toInputStream(random))); dcontainer.flush(); @@ -362,4 +371,9 @@ public class APIBasicDesignTestITCase extends AbstractTestITCase { // Not supported by the test service BTW generates a single request as expected: // <service root>/Orders(1)/CustomerForOrder/Emails } + + @Test + public void workingWithSingletons() { + assertNotNull(container.getCompany().getVipCustomer().load().getPersonID()); + } } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTestITCase.java index ca1166fe2..6a74d50e4 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v4; import static org.junit.Assert.assertEquals; diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/BoundOperationInvokeTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/BoundOperationInvokeTestITCase.java index 8e4f87cee..bc4b604eb 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/BoundOperationInvokeTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/BoundOperationInvokeTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v4; import static org.junit.Assert.assertEquals; diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/ContextTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/ContextTestITCase.java index 041d6ec99..19bd3562e 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/ContextTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/ContextTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v4; import static org.junit.Assert.assertEquals; diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/DerivedTypeTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/DerivedTypeTestITCase.java index 8779e119a..77fb3d119 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/DerivedTypeTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/DerivedTypeTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v4; import static org.junit.Assert.assertNotNull; diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityCreateTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityCreateTestITCase.java index aaff86784..6f05792fe 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityCreateTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityCreateTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v4; //CHECKSTYLE:OFF (Maven checkstyle) diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityUpdateTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityUpdateTestITCase.java index d2fd6b476..35f775484 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityUpdateTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityUpdateTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v4; //CHECKSTYLE:OFF (Maven checkstyle) diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/MediaEntityTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/MediaEntityTestITCase.java index 6d117e6dc..a6188cb71 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/MediaEntityTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/MediaEntityTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v4; import static org.junit.Assert.assertEquals; @@ -81,7 +82,7 @@ public class MediaEntityTestITCase extends AbstractTestITCase { final UUID uuid = UUID.fromString("f89dee73-af9f-4cd4-b330-db93c25ff3c7"); final Advertisement adv = getContainer().getAdvertisements().getByKey(uuid); final String random = RandomStringUtils.random(124, "abcdefghijklmnopqrstuvwxyz"); - adv.uploadStream(new EdmStreamValue("application/octet-stream", IOUtils.toInputStream(random))); + adv.uploadStream(getContainer().newEdmStreamValue("application/octet-stream", IOUtils.toInputStream(random))); getContainer().flush(); assertEquals(random, IOUtils.toString(getContainer().getAdvertisements().getByKey(uuid).loadStream().getStream())); @@ -93,7 +94,7 @@ public class MediaEntityTestITCase extends AbstractTestITCase { final String random = RandomStringUtils.random(124, "abcdefghijklmnopqrstuvwxyz"); final Advertisement adv = getContainer().newEntityInstance(Advertisement.class); - adv.uploadStream(new EdmStreamValue("application/octet-stream", IOUtils.toInputStream(random))); + adv.uploadStream(getContainer().newEdmStreamValue("application/octet-stream", IOUtils.toInputStream(random))); adv.setAirDate(new Timestamp(Calendar.getInstance().getTimeInMillis())); getContainer().getAdvertisements().add(adv); diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/OperationImportInvokeTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/OperationImportInvokeTestITCase.java index 1f70cc9fc..044b4f7b1 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/OperationImportInvokeTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/OperationImportInvokeTestITCase.java @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.apache.olingo.fit.proxy.v4; import static org.junit.Assert.assertEquals; diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/demo/odatademo/DemoService.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/demo/odatademo/DemoService.java index 64b4af811..73ed1cf41 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/demo/odatademo/DemoService.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/demo/odatademo/DemoService.java @@ -26,7 +26,9 @@ import org.apache.olingo.ext.proxy.api.ComplexType; import org.apache.olingo.ext.proxy.api.EntityCollection; import org.apache.olingo.ext.proxy.api.EntityType; import org.apache.olingo.ext.proxy.api.PrimitiveCollection; +import org.apache.olingo.ext.proxy.api.EdmStreamValue; import java.io.Serializable; +import java.io.InputStream; //CHECKSTYLE:ON (Maven checkstyle) @org.apache.olingo.ext.proxy.api.annotations.Namespace("ODataDemo") @@ -73,4 +75,6 @@ public interface DemoService extends PersistenceManager { <T extends ComplexType, NEC extends ComplexCollection<T>> NEC newComplexCollection(Class<NEC> ref); <T extends Serializable, NEC extends PrimitiveCollection<T>> NEC newPrimitiveCollection(Class<T> ref); + + EdmStreamValue newEdmStreamValue(String contentType, InputStream stream); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/demo/odatademo/types/PersonDetail.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/demo/odatademo/types/PersonDetail.java index 80305b6c0..4abf8c844 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/demo/odatademo/types/PersonDetail.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/demo/odatademo/types/PersonDetail.java @@ -170,9 +170,9 @@ public interface PersonDetail fcNSPrefix = "", fcNSURI = "", fcKeepInContent = false) - org.apache.olingo.ext.proxy.api.EdmStreamType getPhoto(); + org.apache.olingo.ext.proxy.api.EdmStreamValue getPhoto(); - void setPhoto(org.apache.olingo.ext.proxy.api.EdmStreamType _photo); + void setPhoto(org.apache.olingo.ext.proxy.api.EdmStreamValue _photo); @org.apache.olingo.ext.proxy.api.annotations.NavigationProperty(name = "Person", diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/opentype/microsoft/test/odata/services/opentypesservicev4/DefaultContainer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/opentype/microsoft/test/odata/services/opentypesservicev4/DefaultContainer.java index 39dea9d7a..54f2b360e 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/opentype/microsoft/test/odata/services/opentypesservicev4/DefaultContainer.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/opentype/microsoft/test/odata/services/opentypesservicev4/DefaultContainer.java @@ -25,7 +25,9 @@ import org.apache.olingo.ext.proxy.api.ComplexType; import org.apache.olingo.ext.proxy.api.EntityCollection; import org.apache.olingo.ext.proxy.api.EntityType; import org.apache.olingo.ext.proxy.api.PrimitiveCollection; +import org.apache.olingo.ext.proxy.api.EdmStreamValue; import java.io.Serializable; +import java.io.InputStream; //CHECKSTYLE:ON (Maven checkstyle) @org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.OpenTypesServiceV4") @@ -56,4 +58,6 @@ public interface DefaultContainer extends PersistenceManager { <T extends ComplexType, NEC extends ComplexCollection<T>> NEC newComplexCollection(Class<NEC> ref); <T extends Serializable, NEC extends PrimitiveCollection<T>> NEC newPrimitiveCollection(Class<T> ref); + + EdmStreamValue newEdmStreamValue(String contentType, InputStream stream); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Boss.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Boss.java deleted file mode 100644 index 25f1d7cc3..000000000 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Boss.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice; - -//CHECKSTYLE:OFF (Maven checkstyle) -import org.apache.olingo.ext.proxy.api.AbstractSingleton; -//CHECKSTYLE:ON (Maven checkstyle) - - - -@org.apache.olingo.ext.proxy.api.annotations.Singleton(name = "Boss", container = "Microsoft.Test.OData.Services.ODataWCFService.InMemoryEntities") -public interface Boss extends org.apache.olingo.ext.proxy.api.SingleQuery<org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person>,AbstractSingleton<org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person, java.lang.Integer, org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.PersonCollection> { -} diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Company.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Company.java deleted file mode 100644 index 788ab931a..000000000 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Company.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice; - -//CHECKSTYLE:OFF (Maven checkstyle) -import org.apache.olingo.ext.proxy.api.AbstractSingleton; -//CHECKSTYLE:ON (Maven checkstyle) - - - -@org.apache.olingo.ext.proxy.api.annotations.Singleton(name = "Company", container = "Microsoft.Test.OData.Services.ODataWCFService.InMemoryEntities") -public interface Company extends org.apache.olingo.ext.proxy.api.SingleQuery<org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company>,AbstractSingleton<org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company, java.lang.Integer, org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.CompanyCollection> { -} diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/DefaultStoredPI.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/DefaultStoredPI.java deleted file mode 100644 index ae0bb9133..000000000 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/DefaultStoredPI.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice; - -//CHECKSTYLE:OFF (Maven checkstyle) -import org.apache.olingo.ext.proxy.api.AbstractSingleton; -//CHECKSTYLE:ON (Maven checkstyle) - - - -@org.apache.olingo.ext.proxy.api.annotations.Singleton(name = "DefaultStoredPI", container = "Microsoft.Test.OData.Services.ODataWCFService.InMemoryEntities") -public interface DefaultStoredPI extends org.apache.olingo.ext.proxy.api.SingleQuery<org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.StoredPI>,AbstractSingleton<org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.StoredPI, java.lang.Integer, org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.StoredPICollection> { -} diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/InMemoryEntities.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/InMemoryEntities.java index d66883f04..565a51696 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/InMemoryEntities.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/InMemoryEntities.java @@ -26,7 +26,9 @@ import org.apache.olingo.ext.proxy.api.ComplexType; import org.apache.olingo.ext.proxy.api.EntityCollection; import org.apache.olingo.ext.proxy.api.EntityType; import org.apache.olingo.ext.proxy.api.PrimitiveCollection; +import org.apache.olingo.ext.proxy.api.EdmStreamValue; import java.io.Serializable; +import java.io.InputStream; //CHECKSTYLE:ON (Maven checkstyle) @org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.ODataWCFService") @@ -61,17 +63,35 @@ public interface InMemoryEntities extends PersistenceManager { - PublicCompany getPublicCompany(); + @org.apache.olingo.ext.proxy.api.annotations.Singleton( + name = "PublicCompany", + container = "Microsoft.Test.OData.Services.ODataWCFService.InMemoryEntities") + org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company getPublicCompany(); - DefaultStoredPI getDefaultStoredPI(); + @org.apache.olingo.ext.proxy.api.annotations.Singleton( + name = "DefaultStoredPI", + container = "Microsoft.Test.OData.Services.ODataWCFService.InMemoryEntities") + org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.StoredPI getDefaultStoredPI(); - VipCustomer getVipCustomer(); + @org.apache.olingo.ext.proxy.api.annotations.Singleton( + name = "VipCustomer", + container = "Microsoft.Test.OData.Services.ODataWCFService.InMemoryEntities") + org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Customer getVipCustomer(); - Company getCompany(); + @org.apache.olingo.ext.proxy.api.annotations.Singleton( + name = "Company", + container = "Microsoft.Test.OData.Services.ODataWCFService.InMemoryEntities") + org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company getCompany(); - Boss getBoss(); + @org.apache.olingo.ext.proxy.api.annotations.Singleton( + name = "Boss", + container = "Microsoft.Test.OData.Services.ODataWCFService.InMemoryEntities") + org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person getBoss(); - LabourUnion getLabourUnion(); + @org.apache.olingo.ext.proxy.api.annotations.Singleton( + name = "LabourUnion", + container = "Microsoft.Test.OData.Services.ODataWCFService.InMemoryEntities") + org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.LabourUnion getLabourUnion(); Operations operations(); @@ -161,4 +181,6 @@ public interface InMemoryEntities extends PersistenceManager { <T extends ComplexType, NEC extends ComplexCollection<T>> NEC newComplexCollection(Class<NEC> ref); <T extends Serializable, NEC extends PrimitiveCollection<T>> NEC newPrimitiveCollection(Class<T> ref); + + EdmStreamValue newEdmStreamValue(String contentType, InputStream stream); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/LabourUnion.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/LabourUnion.java deleted file mode 100644 index e87ecbd8a..000000000 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/LabourUnion.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice; - -//CHECKSTYLE:OFF (Maven checkstyle) -import org.apache.olingo.ext.proxy.api.AbstractSingleton; -//CHECKSTYLE:ON (Maven checkstyle) - - - -@org.apache.olingo.ext.proxy.api.annotations.Singleton(name = "LabourUnion", container = "Microsoft.Test.OData.Services.ODataWCFService.InMemoryEntities") -public interface LabourUnion extends org.apache.olingo.ext.proxy.api.SingleQuery<org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.LabourUnion>,AbstractSingleton<org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.LabourUnion, java.lang.Integer, org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.LabourUnionCollection> { -} diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/PublicCompany.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/PublicCompany.java deleted file mode 100644 index 609ca5971..000000000 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/PublicCompany.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice; - -//CHECKSTYLE:OFF (Maven checkstyle) -import org.apache.olingo.ext.proxy.api.AbstractSingleton; -//CHECKSTYLE:ON (Maven checkstyle) - - - -@org.apache.olingo.ext.proxy.api.annotations.Singleton(name = "PublicCompany", container = "Microsoft.Test.OData.Services.ODataWCFService.InMemoryEntities") -public interface PublicCompany extends org.apache.olingo.ext.proxy.api.SingleQuery<org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company>,AbstractSingleton<org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company, java.lang.Integer, org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.CompanyCollection> { -} diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/VipCustomer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/VipCustomer.java deleted file mode 100644 index 93624ea9e..000000000 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/VipCustomer.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice; - -//CHECKSTYLE:OFF (Maven checkstyle) -import org.apache.olingo.ext.proxy.api.AbstractSingleton; -//CHECKSTYLE:ON (Maven checkstyle) - - - -@org.apache.olingo.ext.proxy.api.annotations.Singleton(name = "VipCustomer", container = "Microsoft.Test.OData.Services.ODataWCFService.InMemoryEntities") -public interface VipCustomer extends org.apache.olingo.ext.proxy.api.SingleQuery<org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Customer>,AbstractSingleton<org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Customer, java.lang.Integer, org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.CustomerCollection> { -}