diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/EntityContainerFactory.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/EntityContainerFactory.java index c378a7a0e..9de2d4ff3 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/EntityContainerFactory.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/EntityContainerFactory.java @@ -63,10 +63,10 @@ public final class EntityContainerFactory instance = new EntityContainerFactory(client, serviceRoot); FACTORY_PER_SERVICEROOT.put(serviceRoot, instance); } - client.getConfiguration().setDefaultPubFormat(ODataPubFormat.JSON_FULL_METADATA); return (EntityContainerFactory) FACTORY_PER_SERVICEROOT.get(serviceRoot); } diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractAnnotatable.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractAnnotatable.java new file mode 100644 index 000000000..b0a1f4ff3 --- /dev/null +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractAnnotatable.java @@ -0,0 +1,34 @@ +/* + * 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; + +import java.io.Serializable; +import java.util.Collection; + +public interface AbstractAnnotatable extends Serializable { + + void addAnnotation(Class term, Object value); + + void removeAnnotation(Class term); + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); + +} diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractOpenType.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractOpenType.java index c2f565c36..769bd2a4c 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractOpenType.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractOpenType.java @@ -25,6 +25,8 @@ public interface AbstractOpenType extends Serializable { void addAdditionalProperty(String name, Object value); + void removeAdditionalProperty(String name); + Object getAdditionalProperty(String name); Collection getAdditionalPropertyNames(); diff --git a/ext/pojogen-maven-plugin/src/main/resources/services.vm b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractTerm.java similarity index 85% rename from ext/pojogen-maven-plugin/src/main/resources/services.vm rename to ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractTerm.java index 94480f368..065727c9d 100644 --- a/ext/pojogen-maven-plugin/src/main/resources/services.vm +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/AbstractTerm.java @@ -1,4 +1,4 @@ -#* +/* * 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 @@ -15,7 +15,10 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - *# -#foreach ($service in $services) -$service -#end \ No newline at end of file + */ +package org.apache.olingo.ext.proxy.api; + +import java.io.Serializable; + +public interface AbstractTerm extends Serializable { +} diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Term.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Term.java new file mode 100644 index 000000000..97ae42118 --- /dev/null +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/api/annotations/Term.java @@ -0,0 +1,40 @@ +/* + * 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.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Mark POJO as term. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +public @interface Term { + + String name(); + + String type(); + + String baseTerm() default ""; +} 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 e3a2bc9ef..2ce424a17 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 @@ -224,7 +224,10 @@ abstract class AbstractInvocationHandler implements InvocationHandler { false); } } else { - return CoreUtils.getValueFromProperty(client, (CommonODataProperty) result, method.getGenericReturnType(), null); + final CommonODataProperty property = (CommonODataProperty) result; + return property == null || property.hasNullValue() + ? null + : CoreUtils.getObjectFromODataValue(client, property.getValue(), method.getGenericReturnType(), null); } } 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 689d99fc1..3a858951a 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 @@ -28,6 +28,7 @@ import java.util.Collection; import java.util.Collections; import org.apache.commons.lang3.ArrayUtils; import org.apache.olingo.client.api.CommonEdmEnabledODataClient; +import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; import org.apache.olingo.client.core.uri.URIUtils; import org.apache.olingo.commons.api.domain.CommonODataEntity; @@ -35,6 +36,7 @@ import org.apache.olingo.commons.api.domain.ODataInlineEntity; import org.apache.olingo.commons.api.domain.ODataInlineEntitySet; import org.apache.olingo.commons.api.domain.ODataLink; import org.apache.olingo.commons.api.domain.ODataLinked; +import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; import org.apache.olingo.ext.proxy.EntityContainerFactory; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; import org.apache.olingo.ext.proxy.api.AbstractEntitySet; @@ -141,7 +143,7 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca } } else { // if the getter refers to a property .... get property from wrapped entity - res = getPropertyValue(property, getter.getGenericReturnType()); + res = getPropertyValue(property.name(), getter.getGenericReturnType()); } // attach the current handler @@ -246,8 +248,12 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca } else if (AbstractEntitySet.class.isAssignableFrom(type)) { navPropValue = getEntitySetProxy(type, uri); } else { - final ODataRetrieveResponse res = - client.getRetrieveRequestFactory().getEntityRequest(uri).execute(); + final ODataEntityRequest req = client.getRetrieveRequestFactory().getEntityRequest(uri); + if (client.getServiceVersion().compareTo(ODataServiceVersion.V30) > 0) { + req.setPrefer(client.newPreferences().includeAnnotations("*")); + } + + final ODataRetrieveResponse res = req.execute(); navPropValue = getEntityProxy( uri, @@ -265,15 +271,16 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca protected abstract Object getPropertyValue(final String name, final Type type); - private Object getPropertyValue(final Property property, final Type type) { - return getPropertyValue(property.name(), type); - } - public void addAdditionalProperty(final String name, final Object value) { addPropertyChanges(name, value); attach(AttachedEntityStatus.CHANGED); } + public void removeAdditionalProperty(final String name) { + removePropertyChanges(name); + attach(AttachedEntityStatus.CHANGED); + } + public Object getAdditionalProperty(final String name) { return getPropertyValue(name, null); } @@ -313,6 +320,8 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca protected abstract void addPropertyChanges(final String name, final Object value); + protected abstract void removePropertyChanges(final String name); + protected abstract void addLinkChanges(final NavigationProperty navProp, final Object value); public abstract boolean isChanged(); diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ComplexInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ComplexInvocationHandler.java index b85452de9..e3743fe88 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ComplexInvocationHandler.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ComplexInvocationHandler.java @@ -99,7 +99,10 @@ public class ComplexInvocationHandler extends AbstractStructuredInvocationHandle @Override protected Object getPropertyValue(final String name, final Type type) { try { - return CoreUtils.getValueFromProperty(client, getComplex().get(name), type, getEntityHandler()); + final CommonODataProperty property = getComplex().get(name); + return property == null || property.hasNullValue() + ? null + : CoreUtils.getObjectFromODataValue(client, property.getValue(), type, getEntityHandler()); } catch (Exception e) { throw new IllegalArgumentException("Error getting value for property '" + name + "'", e); } @@ -174,6 +177,11 @@ public class ComplexInvocationHandler extends AbstractStructuredInvocationHandle // do nothing .... } + @Override + protected void removePropertyChanges(final String name) { + // do nothing .... + } + @Override protected void addLinkChanges(final NavigationProperty navProp, final Object value) { // do nothing .... diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ContainerImpl.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ContainerImpl.java index da9329d71..a5aa6b318 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ContainerImpl.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ContainerImpl.java @@ -51,6 +51,7 @@ import org.apache.olingo.client.core.uri.URIUtils; import org.apache.olingo.commons.api.domain.CommonODataEntity; import org.apache.olingo.commons.api.domain.ODataLink; import org.apache.olingo.commons.api.domain.ODataLinkType; +import org.apache.olingo.commons.api.domain.v4.ODataEntity; import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; import org.apache.olingo.commons.api.format.ODataMediaFormat; import org.apache.olingo.ext.proxy.EntityContainerFactory; @@ -240,10 +241,10 @@ class ContainerImpl implements Container { client.getServiceVersion().compareTo(ODataServiceVersion.V30) <= 0 ? ((org.apache.olingo.client.api.v3.EdmEnabledODataClient) client).getCUDRequestFactory(). getEntityUpdateRequest(handler.getEntityURI(), - org.apache.olingo.client.api.communication.request.cud.v3.UpdateType.PATCH, changes) + org.apache.olingo.client.api.communication.request.cud.v3.UpdateType.PATCH, changes) : ((org.apache.olingo.client.api.v4.EdmEnabledODataClient) client).getCUDRequestFactory(). getEntityUpdateRequest(handler.getEntityURI(), - org.apache.olingo.client.api.communication.request.cud.v4.UpdateType.PATCH, changes); + org.apache.olingo.client.api.communication.request.cud.v4.UpdateType.PATCH, changes); req.setPrefer(new ODataPreferences(client.getServiceVersion()).returnContent()); @@ -266,10 +267,10 @@ class ContainerImpl implements Container { client.getServiceVersion().compareTo(ODataServiceVersion.V30) <= 0 ? ((org.apache.olingo.client.api.v3.EdmEnabledODataClient) client).getCUDRequestFactory(). getEntityUpdateRequest(uri, - org.apache.olingo.client.api.communication.request.cud.v3.UpdateType.PATCH, changes) + org.apache.olingo.client.api.communication.request.cud.v3.UpdateType.PATCH, changes) : ((org.apache.olingo.client.api.v4.EdmEnabledODataClient) client).getCUDRequestFactory(). getEntityUpdateRequest(uri, - org.apache.olingo.client.api.communication.request.cud.v4.UpdateType.PATCH, changes); + org.apache.olingo.client.api.communication.request.cud.v4.UpdateType.PATCH, changes); req.setPrefer(new ODataPreferences(client.getServiceVersion()).returnContent()); @@ -316,6 +317,11 @@ class ContainerImpl implements Container { if (AttachedEntityStatus.DELETED != currentStatus) { entity.getProperties().clear(); CoreUtils.addProperties(client, handler.getPropertyChanges(), entity); + + if (entity instanceof ODataEntity) { + ((ODataEntity) entity).getAnnotations().clear(); + CoreUtils.addAnnotations(client, handler.getAnnotations(), (ODataEntity) entity); + } } for (Map.Entry property : handler.getLinkChanges().entrySet()) { @@ -395,7 +401,7 @@ class ContainerImpl implements Container { final URI targetURI = currentStatus == AttachedEntityStatus.NEW ? URI.create("$" + startingPos + "/$value") : URIUtils.getURI( - factory.getServiceRoot(), handler.getEntity().getEditLink().toASCIIString() + "/$value"); + factory.getServiceRoot(), handler.getEntity().getEditLink().toASCIIString() + "/$value"); batchUpdateMediaEntity(handler, targetURI, handler.getStreamChanges(), changeset); @@ -408,8 +414,8 @@ class ContainerImpl implements Container { for (Map.Entry streamedChanges : handler.getStreamedPropertyChanges().entrySet()) { final URI targetURI = currentStatus == AttachedEntityStatus.NEW ? URI.create("$" + startingPos) : URIUtils.getURI( - factory.getServiceRoot(), - CoreUtils.getMediaEditLink(streamedChanges.getKey(), entity).toASCIIString()); + factory.getServiceRoot(), + CoreUtils.getMediaEditLink(streamedChanges.getKey(), entity).toASCIIString()); batchUpdateMediaResource(handler, targetURI, streamedChanges.getValue(), changeset); diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityCollectionInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityCollectionInvocationHandler.java index 06d03a216..49f61bf10 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityCollectionInvocationHandler.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityCollectionInvocationHandler.java @@ -22,10 +22,19 @@ import java.io.Serializable; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.net.URI; +import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; import java.util.Iterator; +import java.util.List; +import java.util.Map; import org.apache.commons.lang3.ArrayUtils; +import org.apache.olingo.commons.api.domain.v4.ODataAnnotation; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; +import org.apache.olingo.ext.proxy.api.annotations.Namespace; +import org.apache.olingo.ext.proxy.api.annotations.Term; +import org.apache.olingo.ext.proxy.utils.CoreUtils; public class EntityCollectionInvocationHandler extends AbstractInvocationHandler implements AbstractEntityCollection { @@ -38,6 +47,11 @@ public class EntityCollectionInvocationHandler private final URI uri; + private final List annotations = new ArrayList(); + + private final Map, Object> annotationsByTerm = + new HashMap, Object>(); + public EntityCollectionInvocationHandler(final EntityContainerInvocationHandler containerHandler, final Collection items, final Class itemRef) { @@ -54,6 +68,12 @@ public class EntityCollectionInvocationHandler this.uri = uri; } + public void setAnnotations(final List annotations) { + this.annotations.clear(); + this.annotationsByTerm.clear(); + this.annotations.addAll(annotations); + } + public Class getEntityReference() { return itemRef; } @@ -142,4 +162,37 @@ public class EntityCollectionInvocationHandler public void clear() { items.clear(); } + + public Object getAnnotation(final Class term) { + Object res = null; + + if (annotationsByTerm.containsKey(term)) { + res = annotationsByTerm.get(term); + } else { + try { + final Term termAnn = term.getAnnotation(Term.class); + final Namespace namespaceAnn = term.getAnnotation(Namespace.class); + ODataAnnotation annotation = null; + for (ODataAnnotation _annotation : annotations) { + if ((namespaceAnn.value() + "." + termAnn.name()).equals(_annotation.getTerm())) { + annotation = _annotation; + } + } + res = annotation == null || annotation.hasNullValue() + ? null + : CoreUtils.getObjectFromODataValue(client, annotation.getValue(), null, null); + if (res != null) { + annotationsByTerm.put(term, res); + } + } catch (Exception e) { + throw new IllegalArgumentException("Error getting annotation for term '" + term.getName() + "'", e); + } + } + + return res; + } + + public Collection> getAnnotationTerms() { + return CoreUtils.getAnnotationTerms(annotations); + } } 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 6b1f08b3b..529c5eb61 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 @@ -39,11 +39,16 @@ import org.apache.olingo.client.core.uri.URIUtils; import org.apache.olingo.commons.api.domain.CommonODataEntity; import org.apache.olingo.commons.api.domain.CommonODataProperty; import org.apache.olingo.commons.api.domain.ODataLinked; +import org.apache.olingo.commons.api.domain.v4.ODataAnnotation; +import org.apache.olingo.commons.api.domain.v4.ODataEntity; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; import org.apache.olingo.commons.api.format.ODataMediaFormat; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.annotations.EntityType; +import org.apache.olingo.ext.proxy.api.annotations.Namespace; import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; +import org.apache.olingo.ext.proxy.api.annotations.Term; import org.apache.olingo.ext.proxy.context.AttachedEntityStatus; import org.apache.olingo.ext.proxy.context.EntityUUID; import org.apache.olingo.ext.proxy.utils.CoreUtils; @@ -54,15 +59,18 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler private final URI entityURI; - protected Map propertyChanges = new HashMap(); + protected final Map propertyChanges = new HashMap(); - protected Map linkChanges = new HashMap(); + protected final Map linkChanges = new HashMap(); protected int propertiesTag = 0; protected int linksTag = 0; - private Map streamedPropertyChanges = new HashMap(); + private final Map streamedPropertyChanges = new HashMap(); + + private final Map, Object> annotations = + new HashMap, Object>(); private InputStream stream; @@ -127,6 +135,7 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler this.linkChanges.clear(); this.propertiesTag = 0; this.linksTag = 0; + this.annotations.clear(); } public EntityUUID getUUID() { @@ -175,6 +184,10 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler return linkChanges; } + public Map, Object> getAnnotations() { + return annotations; + } + private void updatePropertiesTag(final int checkpoint) { if (checkpoint == propertiesTag) { propertiesTag = propertyChanges.hashCode(); @@ -199,10 +212,12 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler if (propertyChanges.containsKey(name)) { res = propertyChanges.get(name); } else { - res = CoreUtils.getValueFromProperty(client, property, type, this); + res = property == null || property.hasNullValue() + ? null + : CoreUtils.getObjectFromODataValue(client, property.getValue(), type, this); if (res != null) { - chacheProperty(name, res); + cacheProperty(name, res); } } @@ -238,15 +253,14 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler } @Override - @SuppressWarnings("unchecked") protected void setPropertyValue(final Property property, final Object value) { - if (property.type().equalsIgnoreCase("Edm." + EdmPrimitiveTypeKind.Stream.toString())) { + if (EdmPrimitiveTypeKind.Stream.getFullQualifiedName().toString().equalsIgnoreCase(property.type())) { setStreamedProperty(property, (InputStream) value); } else { addPropertyChanges(property.name(), value); if (value != null) { - final Collection coll; + Collection coll; if (Collection.class.isAssignableFrom(value.getClass())) { coll = Collection.class.cast(value); } else { @@ -364,7 +378,12 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler propertyChanges.put(name, value); } - protected void chacheProperty(final String name, final Object value) { + @Override + protected void removePropertyChanges(final String name) { + propertyChanges.remove(name); + } + + protected void cacheProperty(final String name, final Object value) { final int checkpoint = propertyChanges.hashCode(); propertyChanges.put(name, value); updatePropertiesTag(checkpoint); @@ -381,6 +400,70 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler updateLinksTag(checkpoint); } + public void addAnnotation(final Class term, final Object value) { + this.annotations.put(term, value); + + if (value != null) { + Collection coll; + if (Collection.class.isAssignableFrom(value.getClass())) { + coll = Collection.class.cast(value); + } else { + coll = Collections.singleton(value); + } + + for (Object item : coll) { + if (item instanceof Proxy) { + final InvocationHandler handler = Proxy.getInvocationHandler(item); + if ((handler instanceof ComplexInvocationHandler) + && ((ComplexInvocationHandler) handler).getEntityHandler() == null) { + ((ComplexInvocationHandler) handler).setEntityHandler(this); + } + } + } + } + + attach(AttachedEntityStatus.CHANGED); + } + + public void removeAnnotation(final Class term) { + this.annotations.remove(term); + } + + public Object getAnnotation(final Class term) { + Object res = null; + + if (annotations.containsKey(term)) { + res = annotations.get(term); + } else if (getEntity() instanceof ODataEntity) { + try { + final Term termAnn = term.getAnnotation(Term.class); + final Namespace namespaceAnn = term.getAnnotation(Namespace.class); + ODataAnnotation annotation = null; + for (ODataAnnotation _annotation : ((ODataEntity) getEntity()).getAnnotations()) { + if ((namespaceAnn.value() + "." + termAnn.name()).equals(_annotation.getTerm())) { + annotation = _annotation; + } + } + res = annotation == null || annotation.hasNullValue() + ? null + : CoreUtils.getObjectFromODataValue(client, annotation.getValue(), null, this); + if (res != null) { + annotations.put(term, res); + } + } catch (Exception e) { + throw new IllegalArgumentException("Error getting annotation for term '" + term.getName() + "'", e); + } + } + + return res; + } + + public Collection> getAnnotationTerms() { + return getEntity() instanceof ODataEntity + ? CoreUtils.getAnnotationTerms(((ODataEntity) getEntity()).getAnnotations()) + : Collections.>emptyList(); + } + @Override public String toString() { return uuid.toString(); 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 6e70a0e9f..4f4e45ab8 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 @@ -25,7 +25,6 @@ import java.lang.reflect.ParameterizedType; import java.lang.reflect.Proxy; import java.lang.reflect.Type; import java.net.URI; -import java.util.AbstractMap; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -33,6 +32,10 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.tuple.ImmutableTriple; +import org.apache.commons.lang3.tuple.Triple; +import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest; +import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetRequest; import org.apache.olingo.client.api.communication.request.retrieve.ODataValueRequest; import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse; import org.apache.olingo.client.api.uri.CommonURIBuilder; @@ -41,6 +44,8 @@ import org.apache.olingo.client.api.v4.EdmEnabledODataClient; import org.apache.olingo.client.api.v4.ODataClient; import org.apache.olingo.commons.api.domain.CommonODataEntity; import org.apache.olingo.commons.api.domain.CommonODataEntitySet; +import org.apache.olingo.commons.api.domain.v4.ODataAnnotation; +import org.apache.olingo.commons.api.domain.v4.ODataEntitySet; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; import org.apache.olingo.commons.api.format.ODataValueFormat; @@ -254,8 +259,13 @@ class EntitySetInvocationHandler< LOG.debug("GET {}", uriBuilder.toString()); - final ODataRetrieveResponse res = - client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build()).execute(); + final ODataEntityRequest req = + client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build()); + if (client.getServiceVersion().compareTo(ODataServiceVersion.V30) > 0) { + req.setPrefer(client.newPreferences().includeAnnotations("*")); + } + + final ODataRetrieveResponse res = req.execute(); final String etag = res.getETag(); final CommonODataEntity entity = res.getBody(); @@ -282,9 +292,12 @@ class EntitySetInvocationHandler< } @SuppressWarnings("unchecked") - public Map.Entry, URI> fetchPartialEntitySet(final URI uri, final Class typeRef) { + public Triple, URI, List> + fetchPartialEntitySet(final URI uri, final Class typeRef) { + final List entities = new ArrayList(); final URI next; + final List annotations = new ArrayList(); if (isSingleton) { final ODataRetrieveResponse res = @@ -293,12 +306,20 @@ class EntitySetInvocationHandler< entities.add(res.getBody()); next = null; } else { - final ODataRetrieveResponse res = - client.getRetrieveRequestFactory().getEntitySetRequest(uri).execute(); + final ODataEntitySetRequest req = + client.getRetrieveRequestFactory().getEntitySetRequest(uri); + if (client.getServiceVersion().compareTo(ODataServiceVersion.V30) > 0) { + req.setPrefer(client.newPreferences().includeAnnotations("*")); + } + + final ODataRetrieveResponse res = req.execute(); final CommonODataEntitySet entitySet = res.getBody(); entities.addAll(entitySet.getEntities()); next = entitySet.getNext(); + if (entitySet instanceof ODataEntitySet) { + annotations.addAll(((ODataEntitySet) entitySet).getAnnotations()); + } } final List items = new ArrayList(entities.size()); @@ -316,7 +337,7 @@ class EntitySetInvocationHandler< handlerInTheContext == null ? handler : handlerInTheContext)); } - return new AbstractMap.SimpleEntry, URI>(items, next); + return new ImmutableTriple, URI, List>(items, next, annotations); } @SuppressWarnings("unchecked") @@ -324,18 +345,24 @@ class EntitySetInvocationHandler< final URI entitySetURI, final Class typeRef, final Class collTypeRef) { final List items = new ArrayList(); + final List annotations = new ArrayList(); URI nextURI = entitySetURI; while (nextURI != null) { - final Map.Entry, URI> entitySet = fetchPartialEntitySet(nextURI, typeRef); - nextURI = entitySet.getValue(); - items.addAll(entitySet.getKey()); + final Triple, URI, List> entitySet = fetchPartialEntitySet(nextURI, typeRef); + items.addAll(entitySet.getLeft()); + nextURI = entitySet.getMiddle(); + annotations.addAll(entitySet.getRight()); } + final EntityCollectionInvocationHandler entityCollectionHandler = + new EntityCollectionInvocationHandler(containerHandler, items, typeRef, entitySetURI); + entityCollectionHandler.setAnnotations(annotations); + return (SEC) Proxy.newProxyInstance( Thread.currentThread().getContextClassLoader(), new Class[] {collTypeRef}, - new EntityCollectionInvocationHandler(containerHandler, items, typeRef, entitySetURI)); + entityCollectionHandler); } @Override diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetIterator.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetIterator.java index 8a14b7ed8..48405e860 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetIterator.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetIterator.java @@ -23,8 +23,9 @@ import java.net.URI; import java.util.Collections; import java.util.Iterator; import java.util.List; -import java.util.Map; import java.util.NoSuchElementException; +import org.apache.commons.lang3.tuple.Triple; +import org.apache.olingo.commons.api.domain.v4.ODataAnnotation; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; class EntitySetIterator> @@ -50,7 +51,7 @@ class EntitySetIterator, URI> entitySet = esi.fetchPartialEntitySet(this.next, this.esi.getTypeRef()); - this.next = entitySet.getValue(); - this.current = entitySet.getKey().iterator(); + private void goOn() { + final Triple, URI, List> entitySet = + esi.fetchPartialEntitySet(this.next, this.esi.getTypeRef()); + this.current = entitySet.getLeft().iterator(); + this.next = entitySet.getMiddle(); } } diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java index 3c4843ac6..5fbdc69ef 100644 --- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java +++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/utils/CoreUtils.java @@ -43,23 +43,28 @@ import org.apache.olingo.commons.api.domain.CommonODataProperty; import org.apache.olingo.commons.api.domain.ODataLink; import org.apache.olingo.commons.api.domain.ODataPrimitiveValue; import org.apache.olingo.commons.api.domain.ODataValue; +import org.apache.olingo.commons.api.domain.v4.ODataAnnotation; +import org.apache.olingo.commons.api.domain.v4.ODataEntity; import org.apache.olingo.commons.api.domain.v4.ODataEnumValue; import org.apache.olingo.commons.api.domain.v4.ODataObjectFactory; -import org.apache.olingo.commons.api.domain.v4.ODataProperty; import org.apache.olingo.commons.api.edm.EdmElement; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; +import org.apache.olingo.commons.api.edm.EdmTerm; import org.apache.olingo.commons.api.edm.EdmType; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; +import org.apache.olingo.commons.core.domain.v4.ODataAnnotationImpl; import org.apache.olingo.commons.core.edm.EdmTypeInfo; import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.annotations.ComplexType; import org.apache.olingo.ext.proxy.api.annotations.CompoundKeyElement; import org.apache.olingo.ext.proxy.api.annotations.EnumType; import org.apache.olingo.ext.proxy.api.annotations.Key; import org.apache.olingo.ext.proxy.api.annotations.Namespace; import org.apache.olingo.ext.proxy.api.annotations.Property; +import org.apache.olingo.ext.proxy.api.annotations.Term; import org.apache.olingo.ext.proxy.commons.AbstractStructuredInvocationHandler; import org.apache.olingo.ext.proxy.commons.ComplexInvocationHandler; import org.apache.olingo.ext.proxy.commons.EntityInvocationHandler; @@ -189,48 +194,59 @@ public final class CoreUtils { return getODataProperty(client, property, type, obj); } + public static ODataAnnotation getODataAnnotation( + final CommonEdmEnabledODataClient client, final String term, final EdmType type, final Object obj) { + + ODataAnnotation annotation; + + if (obj == null) { + annotation = new ODataAnnotationImpl(term, null); + } else { + final EdmTypeInfo valueType = type == null + ? guessTypeFromObject(client, obj) + : new EdmTypeInfo.Builder().setEdm(client.getCachedEdm()). + setTypeExpression(type.getFullQualifiedName().toString()).build(); + + annotation = new ODataAnnotationImpl(term, + (org.apache.olingo.commons.api.domain.v4.ODataValue) getODataValue(client, valueType, obj)); + } + + return annotation; + } + public static CommonODataProperty getODataProperty( final CommonEdmEnabledODataClient client, final String name, final EdmTypeInfo type, final Object obj) { - CommonODataProperty oprop; + CommonODataProperty property; try { if (obj == null) { - oprop = client.getObjectFactory().newPrimitiveProperty(name, null); + property = client.getObjectFactory().newPrimitiveProperty(name, null); } else { - final EdmTypeInfo valueType; - if (type == null) { - valueType = guessTypeFromObject(client, obj); - } else { - valueType = type; - } + final EdmTypeInfo valueType = type == null + ? guessTypeFromObject(client, obj) + : type; + final ODataValue value = getODataValue(client, valueType, obj); if (valueType.isCollection()) { - // create collection property - oprop = client.getObjectFactory().newCollectionProperty(name, getODataValue(client, valueType, obj). - asCollection()); + property = client.getObjectFactory().newCollectionProperty(name, value.asCollection()); } else if (valueType.isPrimitiveType()) { - // create a primitive property - oprop = client.getObjectFactory().newPrimitiveProperty(name, getODataValue(client, valueType, obj). - asPrimitive()); + property = client.getObjectFactory().newPrimitiveProperty(name, value.asPrimitive()); } else if (valueType.isComplexType()) { - // create a complex property - oprop = client.getObjectFactory().newComplexProperty(name, getODataValue(client, valueType, obj). - asComplex()); + property = client.getObjectFactory().newComplexProperty(name, value.asComplex()); } else if (valueType.isEnumType()) { if (client.getServiceVersion().compareTo(ODataServiceVersion.V30) <= 0) { throw new UnsupportedInV3Exception(); } else { - oprop = ((ODataObjectFactory) client.getObjectFactory()).newEnumProperty(name, - ((org.apache.olingo.commons.api.domain.v4.ODataValue) getODataValue(client, valueType, obj)). - asEnum()); + property = ((ODataObjectFactory) client.getObjectFactory()).newEnumProperty(name, + ((org.apache.olingo.commons.api.domain.v4.ODataValue) value).asEnum()); } } else { throw new UnsupportedOperationException("Usupported object type " + valueType.getFullQualifiedName()); } } - return oprop; + return property; } catch (Exception e) { throw new IllegalStateException(e); } @@ -287,15 +303,28 @@ public final class CoreUtils { final Map changes, final CommonODataEntity entity) { - for (Map.Entry property : changes.entrySet()) { - // if the getter exists and it is annotated as expected then get value/value and add a new property - final CommonODataProperty odataProperty = entity.getProperty(property.getKey()); - if (odataProperty != null) { - entity.getProperties().remove(odataProperty); - } - + for (Map.Entry entry : changes.entrySet()) { ((List) entity.getProperties()).add( - getODataEntityProperty(client, entity.getTypeName(), property.getKey(), property.getValue())); + getODataEntityProperty(client, entity.getTypeName(), entry.getKey(), entry.getValue())); + } + } + + public static void addAnnotations( + final CommonEdmEnabledODataClient client, + final Map, Object> annotations, + final ODataEntity entity) { + + for (Map.Entry, Object> entry : annotations.entrySet()) { + final Namespace nsAnn = entry.getKey().getAnnotation(Namespace.class); + final Term termAnn = entry.getKey().getAnnotation(Term.class); + final FullQualifiedName termName = new FullQualifiedName(nsAnn.value(), termAnn.name()); + final EdmTerm term = client.getCachedEdm().getTerm(termName); + if (term == null) { + LOG.error("Could not find term for class {}", entry.getKey().getName()); + } else { + entity.getAnnotations().add(getODataAnnotation( + client, term.getFullQualifiedName().toString(), term.getType(), entry.getValue())); + } } } @@ -426,7 +455,7 @@ public final class CoreUtils { Thread.currentThread().getContextClassLoader(), new Class[] {getter.getReturnType()}, ComplexInvocationHandler.getInstance( - client, property.getName(), getter.getReturnType(), null)); + client, property.getName(), getter.getReturnType(), null)); populate(client, complex, Property.class, property.getValue().asComplex().iterator()); setPropertyValue(bean, getter, complex); @@ -451,7 +480,7 @@ public final class CoreUtils { Thread.currentThread().getContextClassLoader(), new Class[] {collItemClass}, ComplexInvocationHandler.getInstance( - client, property.getName(), collItemClass, null)); + client, property.getName(), collItemClass, null)); populate(client, collItem, Property.class, value.asComplex().iterator()); collection.add(collItem); @@ -467,9 +496,9 @@ public final class CoreUtils { } @SuppressWarnings("unchecked") - public static Object getValueFromProperty( + public static Object getObjectFromODataValue( final CommonEdmEnabledODataClient client, - final CommonODataProperty property, + final ODataValue value, final Type typeRef, final EntityInvocationHandler entityHandler) throws InstantiationException, IllegalAccessException { @@ -487,59 +516,93 @@ public final class CoreUtils { final Object res; - if (property == null || property.hasNullValue()) { + if (value == null) { res = null; - } else if (property.hasComplexValue()) { + } else if (value.isComplex()) { // complex types supports inheritance in V4, best to re-read actual type - internalRef = getComplexTypeRef(property); + internalRef = getComplexTypeRef(value); res = Proxy.newProxyInstance( Thread.currentThread().getContextClassLoader(), new Class[] {internalRef}, ComplexInvocationHandler.getInstance( - client, property.getValue().asComplex(), internalRef, entityHandler)); - } else if (property.hasCollectionValue()) { + client, value.asComplex(), internalRef, entityHandler)); + } else if (value.isCollection()) { final ArrayList collection = new ArrayList(); - final Iterator collPropItor = property.getValue().asCollection().iterator(); + final Iterator collPropItor = value.asCollection().iterator(); while (collPropItor.hasNext()) { - final ODataValue value = collPropItor.next(); - if (value.isPrimitive()) { - collection.add(CoreUtils.primitiveValueToObject(value.asPrimitive(), internalRef)); - } else if (value.isComplex()) { - internalRef = getComplexTypeRef(property); + final ODataValue itemValue = collPropItor.next(); + if (itemValue.isPrimitive()) { + collection.add(CoreUtils.primitiveValueToObject(itemValue.asPrimitive(), internalRef)); + } else if (itemValue.isComplex()) { + internalRef = getComplexTypeRef(value); final Object collItem = Proxy.newProxyInstance( Thread.currentThread().getContextClassLoader(), new Class[] {internalRef}, ComplexInvocationHandler.getInstance( - client, value.asComplex(), internalRef, entityHandler)); + client, itemValue.asComplex(), internalRef, entityHandler)); collection.add(collItem); } } res = collection; - } else if (property instanceof ODataProperty && ((ODataProperty) property).hasEnumValue()) { + } else if (value instanceof ODataEnumValue) { if (internalRef == null) { - internalRef = getEnumTypeRef(property); + internalRef = getEnumTypeRef(value); } - res = enumValueToObject(((ODataProperty) property).getEnumValue(), internalRef); + res = enumValueToObject((ODataEnumValue) value, internalRef); } else { - res = primitiveValueToObject(property.getPrimitiveValue(), internalRef); + res = primitiveValueToObject(value.asPrimitive(), internalRef); } return res; } - private static Class getEnumTypeRef(final CommonODataProperty property) { - return getTypeRef(property, "META-INF/" + Constants.PROXY_ENUM_CLASS_LIST, EnumType.class); + @SuppressWarnings("unchecked") + public static Collection> getAnnotationTerms(final List annotations) { + final List> res = new ArrayList>(); + + for (ODataAnnotation annotation : annotations) { + res.add((Class) getTermTypeRef(annotation)); + } + + return res; } - private static Class getComplexTypeRef(final CommonODataProperty property) { - return getTypeRef(property, "META-INF/" + Constants.PROXY_COMPLEX_CLASS_LIST, ComplexType.class); + private static Class getTermTypeRef(final ODataAnnotation annotation) { + try { + final List pkgs = IOUtils.readLines(Thread.currentThread().getContextClassLoader(). + getResourceAsStream("META-INF/" + Constants.PROXY_TERM_CLASS_LIST), + Constants.UTF8); + for (String pkg : pkgs) { + final Class clazz = Class.forName(pkg); + final Term term = clazz.getAnnotation(Term.class); + final Namespace ns = clazz.getAnnotation(Namespace.class); + + if (ns != null && term != null + && annotation.getTerm().equals(new FullQualifiedName(ns.value(), term.name()).toString())) { + + return clazz; + } + } + } catch (Exception e) { + LOG.warn("Error retrieving class list for {}", Term.class.getName(), e); + } + + throw new IllegalArgumentException("Could not find Term class for " + annotation.getTerm()); + } + + private static Class getEnumTypeRef(final ODataValue value) { + return getTypeRef(value, "META-INF/" + Constants.PROXY_ENUM_CLASS_LIST, EnumType.class); + } + + private static Class getComplexTypeRef(final ODataValue value) { + return getTypeRef(value, "META-INF/" + Constants.PROXY_COMPLEX_CLASS_LIST, ComplexType.class); } private static Class getTypeRef( - final CommonODataProperty property, + final ODataValue value, final String proxyClassListFile, final Class annType) { @@ -549,7 +612,7 @@ public final class CoreUtils { try { final List pkgs = IOUtils.readLines( - CoreUtils.class.getClassLoader().getResourceAsStream(proxyClassListFile), + Thread.currentThread().getContextClassLoader().getResourceAsStream(proxyClassListFile), Constants.UTF8); for (String pkg : pkgs) { @@ -557,20 +620,19 @@ public final class CoreUtils { final Annotation ann = clazz.getAnnotation(annType); final Namespace ns = clazz.getAnnotation(Namespace.class); - if (ns != null && ann != null) { - if (property.getValue().getTypeName().replaceAll("^Collection\\(", "").replaceAll("\\)$", "").equals( - new FullQualifiedName(ns.value(), annType.isAssignableFrom(EnumType.class) - ? EnumType.class.cast(ann).name() - : ComplexType.class.cast(ann).name()).toString())) { - return clazz; - } + if (ns != null && ann != null + && value.getTypeName().replaceAll("^Collection\\(", "").replaceAll("\\)$", ""). + equals(new FullQualifiedName(ns.value(), annType.isAssignableFrom(EnumType.class) + ? EnumType.class.cast(ann).name() + : ComplexType.class.cast(ann).name()).toString())) { + return clazz; } } } catch (Exception e) { - LOG.warn("Error retrieving proxy complex class list", e); + LOG.warn("Error retrieving class list for {}", annType.getName(), e); } - throw new IllegalArgumentException("Provided property '" + property + "' is not complex"); + throw new IllegalArgumentException("Provided value '" + value + "' is not annotated as " + annType.getName()); } private static String firstValidEntityKey(final Class entityTypeRef) { 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 f8ab5f231..ee09e659f 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 @@ -47,6 +47,7 @@ import org.apache.olingo.commons.api.edm.EdmEnumType; import org.apache.olingo.commons.api.edm.EdmNavigationProperty; 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.velocity.Template; import org.apache.velocity.VelocityContext; @@ -231,6 +232,7 @@ public abstract class AbstractPOJOGenMojo extends AbstractMojo { namespaces.add(schema.getNamespace().toLowerCase()); } + final StringBuilder termNames = new StringBuilder(); final StringBuilder complexTypeNames = new StringBuilder(); final StringBuilder enumTypeNames = new StringBuilder(); @@ -250,7 +252,14 @@ public abstract class AbstractPOJOGenMojo extends AbstractMojo { final Map objs = new HashMap(); - // write types into types package + for (EdmTerm term : schema.getTerms()) { + final String className = utility.capitalize(term.getName()); + termNames.append(typesPkg).append('.').append(className).append('\n'); + objs.clear(); + objs.put("term", term); + parseObj(typesBaseDir, typesPkg, "term", className + ".java", objs); + } + for (EdmEnumType enumType : schema.getEnumTypes()) { final String className = utility.capitalize(enumType.getName()); enumTypeNames.append(typesPkg).append('.').append(className).append('\n'); @@ -275,7 +284,7 @@ public abstract class AbstractPOJOGenMojo extends AbstractMojo { || edm.getEntityType(complex.getBaseType().getFullQualifiedName()). getNavigationProperty(navPropName) == null) && navProp.containsTarget()) { - + objs.clear(); objs.put("navProp", navProp); parseObj(base, pkg, "containedEntitySet", @@ -364,6 +373,8 @@ public abstract class AbstractPOJOGenMojo extends AbstractMojo { } final File metaInf = mkdir("META-INF"); + FileUtils.fileWrite( + metaInf.getPath() + File.separator + Constants.PROXY_TERM_CLASS_LIST, termNames.toString()); FileUtils.fileWrite( metaInf.getPath() + File.separator + Constants.PROXY_ENUM_CLASS_LIST, enumTypeNames.toString()); FileUtils.fileWrite( diff --git a/ext/pojogen-maven-plugin/src/main/resources/entityCollection.vm b/ext/pojogen-maven-plugin/src/main/resources/entityCollection.vm index c2d49c81d..8df366f86 100644 --- a/ext/pojogen-maven-plugin/src/main/resources/entityCollection.vm +++ b/ext/pojogen-maven-plugin/src/main/resources/entityCollection.vm @@ -20,6 +20,7 @@ package ${package}; import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -92,4 +93,8 @@ public interface $utility.capitalize($entityType.Name)Collection extends Abstrac #end } #end + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/ext/pojogen-maven-plugin/src/main/resources/entityType.vm b/ext/pojogen-maven-plugin/src/main/resources/entityType.vm index aeebe7bb7..e66f936b4 100644 --- a/ext/pojogen-maven-plugin/src/main/resources/entityType.vm +++ b/ext/pojogen-maven-plugin/src/main/resources/entityType.vm @@ -28,6 +28,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -62,7 +63,7 @@ import javax.xml.datatype.Duration; isAbstract = $entityType.Abstract#if($entityType.getBaseType()), baseType = "$entityType.getBaseType().getFullQualifiedName().toString()"#end) public interface $utility.capitalize($entityType.Name) - extends #if( $entityType.getBaseType() )$utility.getJavaType($entityType.getBaseType())#{elseif}( $entityType.isOpenType() )AbstractOpenType#{else}Serializable#end { + extends AbstractAnnotatable,#if( $entityType.getBaseType() )$utility.getJavaType($entityType.getBaseType())#{elseif}( $entityType.isOpenType() )AbstractOpenType#{else}Serializable#end { #set( $keys = [] ) #foreach($key in $entityType.KeyPropertyRefs) diff --git a/ext/pojogen-maven-plugin/src/main/resources/term.vm b/ext/pojogen-maven-plugin/src/main/resources/term.vm new file mode 100644 index 000000000..c51620937 --- /dev/null +++ b/ext/pojogen-maven-plugin/src/main/resources/term.vm @@ -0,0 +1,34 @@ +#* + * 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}; + +import org.apache.olingo.ext.proxy.api.annotations.Namespace; +import org.apache.olingo.ext.proxy.api.annotations.Term; +import org.apache.olingo.ext.proxy.api.AbstractTerm; +#foreach($ns in $namespaces) +import ${basePackage}.${ns}.*; +import ${basePackage}.${ns}.types.*; +#end + +@Namespace("$namespace") +@Term(name = "$term.Name", + type="$term.Type"#if($term.getBaseTerm()), + baseTerm = "$term.getBaseTerm().getFullQualifiedName().toString()"#end) +public interface $utility.capitalize($term.Name) extends AbstractTerm { +} diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/SingletonTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/SingletonTestITCase.java index d9467bc31..946029795 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/SingletonTestITCase.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/SingletonTestITCase.java @@ -20,8 +20,12 @@ package org.apache.olingo.fit.proxy.v4; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company; import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.CompanyCategory; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.IsBoss; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person; import org.junit.Test; public class SingletonTestITCase extends AbstractTestITCase { @@ -42,4 +46,18 @@ public class SingletonTestITCase extends AbstractTestITCase { assertEquals(132520L, container.getCompany().get().getRevenue(), 0); } + + @Test + public void readWithAnnotations() { + final Company company = container.getCompany().get(); + assertTrue(company.getAnnotationTerms().isEmpty()); + + final Person boss = container.getBoss().get(); + assertEquals(2, boss.getPersonID(), 0); + + assertEquals(1, boss.getAnnotationTerms().size()); + final Object isBoss = boss.getAnnotation(IsBoss.class); + assertTrue(isBoss instanceof Boolean); + assertTrue((Boolean) isBoss); + } } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Account.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Account.java index 4c68b8b5a..82d61078b 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Account.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Account.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface Account - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccountCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccountCollection.java index 00ec845f6..b4f069a07 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccountCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccountCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface AccountCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Asset.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Asset.java index 6fdc75a0b..ba5be3181 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Asset.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Asset.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface Asset - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AssetCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AssetCollection.java index 12b8ef127..acc55d1e4 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AssetCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AssetCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface AssetCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Club.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Club.java index f5dd65834..6016e77c2 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Club.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Club.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface Club - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ClubCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ClubCollection.java index 4647fed33..e04aa4a11 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ClubCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ClubCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface ClubCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Company.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Company.java index 38d6e9321..1b16a5a94 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Company.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Company.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface Company - extends AbstractOpenType { + extends AbstractAnnotatable,AbstractOpenType { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyCollection.java index 7eb03e441..a5d0931f7 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface CompanyCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPI.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPI.java index 98139ef6a..d005712e0 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPI.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPI.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -58,7 +59,7 @@ import javax.xml.datatype.Duration; isAbstract = false, baseType = "Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument") public interface CreditCardPI - extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.PaymentInstrument { + extends AbstractAnnotatable,org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.PaymentInstrument { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPICollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPICollection.java index d673c514c..07139aeb5 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPICollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPICollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface CreditCardPICollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecord.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecord.java index d63a19976..ca1c5934a 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecord.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecord.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface CreditRecord - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecordCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecordCollection.java index 24542010e..93bdfbe98 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecordCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecordCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface CreditRecordCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Customer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Customer.java index 461cdd39e..d545c8703 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Customer.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Customer.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -58,7 +59,7 @@ import javax.xml.datatype.Duration; isAbstract = false, baseType = "Microsoft.Test.OData.Services.ODataWCFService.Person") public interface Customer - extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person { + extends AbstractAnnotatable,org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CustomerCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CustomerCollection.java index 2b0ce94c0..d4584e26b 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CustomerCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CustomerCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface CustomerCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Department.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Department.java index dd7ba2709..6eed1d3d4 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Department.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Department.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface Department - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/DepartmentCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/DepartmentCollection.java index 27b40de0f..498bf5b60 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/DepartmentCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/DepartmentCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface DepartmentCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Employee.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Employee.java index aff7b3618..87c1486d9 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Employee.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Employee.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -58,7 +59,7 @@ import javax.xml.datatype.Duration; isAbstract = false, baseType = "Microsoft.Test.OData.Services.ODataWCFService.Person") public interface Employee - extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person { + extends AbstractAnnotatable,org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/EmployeeCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/EmployeeCollection.java index 9ed998727..536d1a090 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/EmployeeCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/EmployeeCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface EmployeeCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCard.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCard.java index 4c2c83fce..e4ccfe2a2 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCard.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCard.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface GiftCard - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCardCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCardCollection.java index 5ca4350d6..eb03afd4c 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCardCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCardCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface GiftCardCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/IsBoss.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/IsBoss.java new file mode 100644 index 000000000..f37419b91 --- /dev/null +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/IsBoss.java @@ -0,0 +1,31 @@ +/* + * 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.types; + +import org.apache.olingo.ext.proxy.api.annotations.Namespace; +import org.apache.olingo.ext.proxy.api.annotations.Term; +import org.apache.olingo.ext.proxy.api.AbstractTerm; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.*; +import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.*; + +@Namespace("Microsoft.Test.OData.Services.ODataWCFService") +@Term(name = "IsBoss", + type="Edm.Boolean") +public interface IsBoss extends AbstractTerm { +} diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnion.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnion.java index 5170a41b4..699b417ec 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnion.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnion.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface LabourUnion - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnionCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnionCollection.java index 644f6d865..fcbbd30d4 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnionCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnionCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface LabourUnionCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Order.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Order.java index 6e4c5395b..2d3ea17e9 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Order.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Order.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface Order - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderCollection.java index 3e3712cdb..5c4fc2876 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface OrderCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetail.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetail.java index 15a0b9bdb..f8b0ca396 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetail.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetail.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface OrderDetail - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetailCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetailCollection.java index a0d2058f7..5e258a87e 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetailCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetailCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface OrderDetailCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrument.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrument.java index 3ecaedfc6..2915a94cf 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrument.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrument.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface PaymentInstrument - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrumentCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrumentCollection.java index 878a3ffee..44e8f23c0 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrumentCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrumentCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface PaymentInstrumentCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Person.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Person.java index f197b3c06..ec17476a3 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Person.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Person.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface Person - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PersonCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PersonCollection.java index 778e8cc93..9f159dcef 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PersonCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PersonCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface PersonCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Product.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Product.java index 574e98dc1..88e84bc90 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Product.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Product.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface Product - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductCollection.java index 88cd63d34..1f408e024 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -56,4 +57,8 @@ public interface ProductCollection extends AbstractEntityCollection { ); } + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetail.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetail.java index 945bb2be0..adb1b8446 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetail.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetail.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface ProductDetail - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetailCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetailCollection.java index 31b8c1b1e..55ce7a252 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetailCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetailCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface ProductDetailCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReview.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReview.java index 32bfa8f88..5c982a787 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReview.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReview.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface ProductReview - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReviewCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReviewCollection.java index 9825a7005..1c987969b 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReviewCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReviewCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface ProductReviewCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompany.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompany.java index a3c971315..31aa47015 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompany.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompany.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -58,7 +59,7 @@ import javax.xml.datatype.Duration; isAbstract = false, baseType = "Microsoft.Test.OData.Services.ODataWCFService.Company") public interface PublicCompany - extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company { + extends AbstractAnnotatable,org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompanyCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompanyCollection.java index b90e82f90..2257e2bfa 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompanyCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompanyCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface PublicCompanyCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Statement.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Statement.java index 4b7e86f65..e12c0f16b 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Statement.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Statement.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface Statement - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StatementCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StatementCollection.java index 2f4c0a6de..6f325a76f 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StatementCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StatementCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface StatementCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPI.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPI.java index a99ff85f9..0a31c18aa 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPI.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPI.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface StoredPI - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPICollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPICollection.java index ba7ab8f6c..d4d34fe66 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPICollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPICollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface StoredPICollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Subscription.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Subscription.java index de3de5d83..17dd86562 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Subscription.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Subscription.java @@ -27,6 +27,7 @@ import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty; import org.apache.olingo.ext.proxy.api.annotations.Property; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; +import org.apache.olingo.ext.proxy.api.AbstractAnnotatable; import org.apache.olingo.ext.proxy.api.AbstractOpenType; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.commons.api.edm.constants.EdmContentKind; @@ -57,7 +58,7 @@ import javax.xml.datatype.Duration; hasStream = false, isAbstract = false) public interface Subscription - extends Serializable { + extends AbstractAnnotatable,Serializable { @Key diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/SubscriptionCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/SubscriptionCollection.java index 08393e72e..5e8083b59 100644 --- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/SubscriptionCollection.java +++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/SubscriptionCollection.java @@ -20,6 +20,7 @@ package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.servic import org.apache.olingo.client.api.http.HttpMethod; import org.apache.olingo.ext.proxy.api.AbstractEntityCollection; +import org.apache.olingo.ext.proxy.api.AbstractTerm; import org.apache.olingo.ext.proxy.api.OperationType; import org.apache.olingo.ext.proxy.api.annotations.Operation; import org.apache.olingo.ext.proxy.api.annotations.Parameter; @@ -43,4 +44,8 @@ import java.util.Calendar; import javax.xml.datatype.Duration; public interface SubscriptionCollection extends AbstractEntityCollection { + + Object getAnnotation(Class term); + + Collection> getAnnotationTerms(); } diff --git a/fit/src/test/resources/META-INF/org.apache.olingo.ext.proxy.term b/fit/src/test/resources/META-INF/org.apache.olingo.ext.proxy.term new file mode 100644 index 000000000..4eccd958b --- /dev/null +++ b/fit/src/test/resources/META-INF/org.apache.olingo.ext.proxy.term @@ -0,0 +1 @@ +org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.IsBoss diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java index acd0fb9b5..2eacd47fd 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java @@ -35,6 +35,8 @@ public interface Constants { public final static Integer DEFAULT_SCALE = 25; + public final static String PROXY_TERM_CLASS_LIST = "org.apache.olingo.ext.proxy.term"; + public final static String PROXY_ENUM_CLASS_LIST = "org.apache.olingo.ext.proxy.enum"; public final static String PROXY_COMPLEX_CLASS_LIST = "org.apache.olingo.ext.proxy.complex";