You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by tb...@apache.org on 2013/12/06 17:53:03 UTC
[21/50] [abbrv] git commit: Minor refactoring and javadoc for
'api-annotations'
Minor refactoring and javadoc for 'api-annotations'
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/3eb58544
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/3eb58544
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/3eb58544
Branch: refs/heads/ODataServlet
Commit: 3eb585444a56035ea7b68b5532a9aabf27b35ff8
Parents: a68b401
Author: Michael Bolz <mi...@apache.org>
Authored: Mon Dec 2 10:15:37 2013 +0100
Committer: Tamara Boehm <ta...@sap.com>
Committed: Fri Dec 6 17:49:24 2013 +0100
----------------------------------------------------------------------
.../annotation/edm/AnnotationEdmProvider.java | 52 ++++++------
.../core/annotation/edm/AnnotationHelper.java | 44 ++++++++++-
.../edm/AnnotationEdmProviderTest.java | 83 +++++++++++++++++++-
.../odata2/core/annotation/model/Photo.java | 3 +-
.../api/annotation/edm/Documentation.java | 4 +
.../api/annotation/edm/EdmComplexType.java | 19 ++++-
.../annotation/edm/EdmConcurrencyControl.java | 3 +-
.../api/annotation/edm/EdmDocumentation.java | 44 +++++++++++
.../odata2/api/annotation/edm/EdmEntitySet.java | 20 ++++-
.../api/annotation/edm/EdmEntityType.java | 21 ++++-
.../odata2/api/annotation/edm/EdmFacets.java | 28 +++++++
.../api/annotation/edm/EdmFunctionImport.java | 75 +++++++++++++++---
.../edm/EdmFunctionImportParameter.java | 55 +++++++++----
.../odata2/api/annotation/edm/EdmKey.java | 9 ++-
.../annotation/edm/EdmMediaResourceContent.java | 13 ++-
.../edm/EdmMediaResourceMimeType.java | 13 ++-
.../annotation/edm/EdmMediaResourceSource.java | 10 ++-
.../annotation/edm/EdmNavigationProperty.java | 47 ++++++++++-
.../odata2/api/annotation/edm/EdmProperty.java | 26 ++++++
.../odata2/api/annotation/edm/Facets.java | 4 +
.../api/annotation/edm/FunctionImport.java | 4 +
.../odata2/api/annotation/edm/Parameter.java | 5 ++
.../odata2/api/annotation/edmx/HttpMethod.java | 6 ++
23 files changed, 508 insertions(+), 80 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/edm/AnnotationEdmProvider.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/edm/AnnotationEdmProvider.java b/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/edm/AnnotationEdmProvider.java
index 5d705dc..7dfbd0e 100644
--- a/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/edm/AnnotationEdmProvider.java
+++ b/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/edm/AnnotationEdmProvider.java
@@ -79,7 +79,6 @@ public class AnnotationEdmProvider extends EdmProvider {
private final Map<String, ContainerBuilder> containerName2ContainerBuilder = new HashMap<String, ContainerBuilder>();
private final Map<String, Schema> namespace2Schema = new HashMap<String, Schema>();
private EntityContainer defaultContainer;
- private String DEFAULT_CONTAINER_NAME = "DefaultContainer";
public AnnotationEdmProvider(Collection<Class<?>> annotatedClasses) {
@@ -251,24 +250,27 @@ public class AnnotationEdmProvider extends EdmProvider {
}
private void updateSchema(Class<?> aClass, EdmEntityType et) {
- String namespace = et.namespace();
- SchemaBuilder b = namespace2SchemaBuilder.get(namespace);
- if (b == null) {
- b = SchemaBuilder.init(namespace);
- namespace2SchemaBuilder.put(namespace, b);
- }
+ SchemaBuilder b = getSchemaBuilder(et.namespace(), aClass);
TypeBuilder typeBuilder = TypeBuilder.init(et, aClass);
b.addEntityType(typeBuilder.buildEntityType());
b.addAssociations(typeBuilder.buildAssociations());
}
- private void updateSchema(Class<?> aClass, EdmComplexType et) {
- String namespace = et.namespace();
- SchemaBuilder b = namespace2SchemaBuilder.get(namespace);
- if (b == null) {
- b = SchemaBuilder.init(namespace);
- namespace2SchemaBuilder.put(namespace, b);
+ private SchemaBuilder getSchemaBuilder(String namespace, Class<?> aClass) {
+ String usedNamespace = namespace;
+ if(usedNamespace.isEmpty()) {
+ usedNamespace = ANNOTATION_HELPER.getCanonicalNamespace(aClass);
}
+ SchemaBuilder builder = namespace2SchemaBuilder.get(usedNamespace);
+ if (builder == null) {
+ builder = SchemaBuilder.init(usedNamespace);
+ namespace2SchemaBuilder.put(usedNamespace, builder);
+ }
+ return builder;
+ }
+
+ private void updateSchema(Class<?> aClass, EdmComplexType et) {
+ SchemaBuilder b = getSchemaBuilder(et.namespace(), aClass);
TypeBuilder typeBuilder = TypeBuilder.init(et, aClass);
b.addComplexType(typeBuilder.buildComplexType());
}
@@ -276,15 +278,15 @@ public class AnnotationEdmProvider extends EdmProvider {
private void handleEntityContainer(Class<?> aClass) {
EdmEntityType entityType = aClass.getAnnotation(EdmEntityType.class);
if (entityType != null) {
- String containerName = DEFAULT_CONTAINER_NAME;
+ FullQualifiedName typeName = createFqnForEntityType(aClass, entityType);
+ String containerName = ANNOTATION_HELPER.extractContainerName(aClass);
ContainerBuilder builder = containerName2ContainerBuilder.get(containerName);
if (builder == null) {
- builder = ContainerBuilder.init(entityType.namespace(), containerName);
+ builder = ContainerBuilder.init(typeName.getNamespace(), containerName);
containerName2ContainerBuilder.put(containerName, builder);
}
EdmEntitySet entitySet = aClass.getAnnotation(EdmEntitySet.class);
if (entitySet != null) {
- FullQualifiedName typeName = createFqnForEntityType(aClass, entityType);
builder.addEntitySet(createEntitySet(typeName, entitySet));
}
}
@@ -295,12 +297,7 @@ public class AnnotationEdmProvider extends EdmProvider {
}
private FullQualifiedName createFqnForEntityType(Class<?> annotatedClass, EdmEntityType entityType) {
- String name = entityType.name();
- if (name.isEmpty()) {
- return new FullQualifiedName(entityType.namespace(), annotatedClass.getSimpleName());
- } else {
- return new FullQualifiedName(entityType.namespace(), entityType.name());
- }
+ return ANNOTATION_HELPER.extractEntityTypeFqn(annotatedClass);
}
private void finish() {
@@ -339,21 +336,17 @@ public class AnnotationEdmProvider extends EdmProvider {
private final List<NavigationProperty> navProperties = new ArrayList<NavigationProperty>();
private final List<Association> associations = new ArrayList<Association>();
- // public TypeBuilder(String namespace, String name) {
- // this.namespace = namespace;
- // this.name = name;
- // }
public TypeBuilder(FullQualifiedName fqn) {
this.namespace = fqn.getNamespace();
this.name = fqn.getName();
}
public static TypeBuilder init(EdmEntityType entity, Class<?> aClass) {
- return new TypeBuilder(ANNOTATION_HELPER.extractEntityTypeFqn(aClass)).withClass(aClass);
+ return new TypeBuilder(ANNOTATION_HELPER.extractEntityTypeFqn(entity, aClass)).withClass(aClass);
}
public static TypeBuilder init(EdmComplexType entity, Class<?> aClass) {
- return new TypeBuilder(ANNOTATION_HELPER.extractComplexTypeFqn(aClass)).withClass(aClass);
+ return new TypeBuilder(ANNOTATION_HELPER.extractComplexTypeFqn(entity, aClass)).withClass(aClass);
}
private TypeBuilder withClass(Class<?> aClass) {
@@ -414,8 +407,7 @@ public class AnnotationEdmProvider extends EdmProvider {
if (baseEntityType != null) {
complexType.setBaseType(baseEntityType);
}
- return complexType.setName(name)
- .setProperties(properties);
+ return complexType.setName(name).setProperties(properties);
}
public EntityType buildEntityType() {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/edm/AnnotationHelper.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/edm/AnnotationHelper.java b/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/edm/AnnotationHelper.java
index 7e92284..462a0bc 100644
--- a/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/edm/AnnotationHelper.java
+++ b/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/edm/AnnotationHelper.java
@@ -44,6 +44,8 @@ import org.apache.olingo.odata2.core.exception.ODataRuntimeException;
*/
public class AnnotationHelper {
+ public static final String DEFAULT_CONTAINER_NAME = "DefaultContainer";
+
/**
* Compare keys of both instances.
*
@@ -131,19 +133,44 @@ public class AnnotationHelper {
return extractTypeName(annotatedClass, EdmEntityType.class);
}
+ public FullQualifiedName extractEntityTypeFqn(EdmEntityType type, Class<?> annotatedClass) {
+ if(type.namespace().isEmpty()) {
+ return new FullQualifiedName(generateNamespace(annotatedClass), extractEntityTypeName(annotatedClass));
+ }
+ return new FullQualifiedName(type.namespace(), extractEntityTypeName(annotatedClass));
+ }
+
public FullQualifiedName extractEntityTypeFqn(Class<?> annotatedClass) {
EdmEntityType type = annotatedClass.getAnnotation(EdmEntityType.class);
- return new FullQualifiedName(type.namespace(), extractEntityTypeName(annotatedClass));
+ if(type == null) {
+ return null;
+ }
+ return extractEntityTypeFqn(type, annotatedClass);
}
public FullQualifiedName extractComplexTypeFqn(Class<?> annotatedClass) {
EdmComplexType type = annotatedClass.getAnnotation(EdmComplexType.class);
+ if(type == null) {
+ return null;
+ }
+ return extractComplexTypeFqn(type, annotatedClass);
+ }
+
+ public FullQualifiedName extractComplexTypeFqn(EdmComplexType type, Class<?> annotatedClass) {
+ if(type.namespace().isEmpty()) {
+ return new FullQualifiedName(generateNamespace(annotatedClass), extractComplexTypeName(annotatedClass));
+ }
return new FullQualifiedName(type.namespace(), extractComplexTypeName(annotatedClass));
}
public String extractComplexTypeName(Class<?> annotatedClass) {
return extractTypeName(annotatedClass, EdmComplexType.class);
}
+
+ public String generateNamespace(Class<?> annotatedClass) {
+ String packageName = annotatedClass.getPackage().getName();
+ return packageName;
+ }
/**
*
@@ -601,4 +628,19 @@ public class AnnotationHelper {
super(message);
}
}
+
+ public String getCanonicalNamespace(Class<?> aClass) {
+ return generateNamespace(aClass);
+ }
+
+ public String extractContainerName(Class<?> aClass) {
+ EdmEntitySet entitySet = aClass.getAnnotation(EdmEntitySet.class);
+ if(entitySet != null) {
+ String containerName = entitySet.container();
+ if(!containerName.isEmpty()) {
+ return containerName;
+ }
+ }
+ return DEFAULT_CONTAINER_NAME;
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/edm/AnnotationEdmProviderTest.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/edm/AnnotationEdmProviderTest.java b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/edm/AnnotationEdmProviderTest.java
index b772d6c..494a090 100644
--- a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/edm/AnnotationEdmProviderTest.java
+++ b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/edm/AnnotationEdmProviderTest.java
@@ -16,15 +16,20 @@
package org.apache.olingo.odata2.core.annotation.edm;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
+import org.apache.olingo.odata2.api.annotation.edm.EdmComplexType;
+import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
import org.apache.olingo.odata2.api.edm.EdmMultiplicity;
import org.apache.olingo.odata2.api.edm.FullQualifiedName;
import org.apache.olingo.odata2.api.edm.provider.Association;
@@ -41,6 +46,7 @@ import org.apache.olingo.odata2.api.edm.provider.NavigationProperty;
import org.apache.olingo.odata2.api.edm.provider.Property;
import org.apache.olingo.odata2.api.edm.provider.PropertyRef;
import org.apache.olingo.odata2.api.edm.provider.Schema;
+import org.apache.olingo.odata2.api.exception.ODataException;
import org.apache.olingo.odata2.core.annotation.model.Building;
import org.apache.olingo.odata2.core.annotation.model.City;
import org.apache.olingo.odata2.core.annotation.model.Employee;
@@ -51,7 +57,6 @@ import org.apache.olingo.odata2.core.annotation.model.Photo;
import org.apache.olingo.odata2.core.annotation.model.RefBase;
import org.apache.olingo.odata2.core.annotation.model.Room;
import org.apache.olingo.odata2.core.annotation.model.Team;
-import static org.junit.Assert.assertFalse;
import org.junit.Test;
/**
@@ -59,8 +64,19 @@ import org.junit.Test;
*/
public class AnnotationEdmProviderTest {
- private final Collection<Class<?>> annotatedClasses = new ArrayList<Class<?>>();
+ @EdmEntityType
+ @EdmEntitySet
+ private static final class GeneratedNamesTestClass {}
+
+ @EdmComplexType
+ private static final class GeneratedNamesComplexTestClass {}
+
+ @EdmEntityType(namespace="MyTestNamespace")
+ @EdmEntitySet(container="MyTestContainer")
+ private static final class DefinedNamesTestClass {}
+
private final AnnotationEdmProvider aep;
+ private final Collection<Class<?>> annotatedClasses = new ArrayList<Class<?>>();
public AnnotationEdmProviderTest() {
annotatedClasses.add(RefBase.class);
@@ -77,6 +93,69 @@ public class AnnotationEdmProviderTest {
}
@Test
+ public void defaultNamespaceGeneration() throws ODataException {
+ Collection<Class<?>> localAnnotatedClasses = new ArrayList<Class<?>>();
+ localAnnotatedClasses.add(GeneratedNamesTestClass.class);
+ AnnotationEdmProvider localAep = new AnnotationEdmProvider(localAnnotatedClasses);
+ // validate
+ EntityType testType = localAep.getEntityType(new FullQualifiedName(
+ GeneratedNamesTestClass.class.getPackage().getName(),
+ GeneratedNamesTestClass.class.getSimpleName()));
+ assertNotNull("Requested entity not found.", testType);
+ assertEquals("GeneratedNamesTestClass", testType.getName());
+ assertNull("This should not have a base type", testType.getBaseType());
+ }
+
+ @Test
+ public void defaultNamespaceGenerationComplexType() throws ODataException {
+ Collection<Class<?>> localAnnotatedClasses = new ArrayList<Class<?>>();
+ localAnnotatedClasses.add(GeneratedNamesComplexTestClass.class);
+ AnnotationEdmProvider localAep = new AnnotationEdmProvider(localAnnotatedClasses);
+ // validate
+ ComplexType testType = localAep.getComplexType(new FullQualifiedName(
+ GeneratedNamesComplexTestClass.class.getPackage().getName(),
+ GeneratedNamesComplexTestClass.class.getSimpleName()));
+ assertNotNull("Requested entity not found.", testType);
+ assertEquals("GeneratedNamesComplexTestClass", testType.getName());
+ assertNull("This should not have a base type", testType.getBaseType());
+ }
+
+ @Test
+ public void defaultContainerNameGeneration() throws ODataException {
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ AnnotationEdmProvider localAep =
+ new AnnotationEdmProvider((Collection) Arrays.asList(GeneratedNamesTestClass.class));
+
+ EntityContainerInfo containerInfo = localAep.getEntityContainerInfo(null);
+ assertNotNull(containerInfo);
+ assertEquals("DefaultContainer", containerInfo.getName());
+ }
+
+
+ @Test
+ public void defaultNamespaceDefined() throws ODataException {
+ Collection<Class<?>> localAnnotatedClasses = new ArrayList<Class<?>>();
+ localAnnotatedClasses.add(DefinedNamesTestClass.class);
+ AnnotationEdmProvider localAep = new AnnotationEdmProvider(localAnnotatedClasses);
+ // validate
+ EntityType testClass = localAep.getEntityType(new FullQualifiedName("MyTestNamespace",
+ DefinedNamesTestClass.class.getSimpleName()));
+ assertNotNull("Requested entity not found.", testClass);
+ assertEquals("DefinedNamesTestClass", testClass.getName());
+ assertNull("This should not have a base type", testClass.getBaseType());
+ }
+
+ @Test
+ public void defaultContainerNameDefined() throws ODataException {
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ AnnotationEdmProvider localAep = new AnnotationEdmProvider((Collection) Arrays.asList(DefinedNamesTestClass.class));
+
+ EntityContainerInfo containerInfo = localAep.getEntityContainerInfo(null);
+ assertNotNull(containerInfo);
+ assertEquals("MyTestContainer", containerInfo.getName());
+ }
+
+ @Test
public void loadAnnotatedClassesFromPackage() throws Exception {
AnnotationEdmProvider localAep = new AnnotationEdmProvider("org.apache.olingo.odata2.core.annotation.model");
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Photo.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Photo.java b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Photo.java
index 52cb2cc..df7d687 100644
--- a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Photo.java
+++ b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Photo.java
@@ -19,6 +19,7 @@
package org.apache.olingo.odata2.core.annotation.model;
import java.util.Arrays;
+
import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
import org.apache.olingo.odata2.api.annotation.edm.EdmKey;
@@ -27,8 +28,6 @@ import org.apache.olingo.odata2.api.annotation.edm.EdmMediaResourceMimeType;
import org.apache.olingo.odata2.api.annotation.edm.EdmMediaResourceSource;
import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
-import org.apache.olingo.odata2.core.annotation.model.ModelSharedConstants;
-import org.apache.olingo.odata2.core.annotation.model.ResourceHelper;
/**
*
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Documentation.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Documentation.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Documentation.java
index f37c766..25fff56 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Documentation.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Documentation.java
@@ -23,6 +23,10 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+/**
+ * @deprecated: As of Olingo version 1.1.x, replaced by {@link EdmDocumentation}.
+ */
+@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface Documentation {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmComplexType.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmComplexType.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmComplexType.java
index b6b52f3..9b135ef 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmComplexType.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmComplexType.java
@@ -23,9 +23,26 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+/**
+ * <p>Annotation for a EDM/CSDL ComplexType element.</p>
+ * <p>EdmComplexType holds a set of related information like EdmPrimitiveType
+ * properties and EdmComplexType properties.</p>
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface EdmComplexType {
+ /**
+ * Define the name for the ComplexType.
+ * If not set a default value has to be generated by the EDM provider.
+ *
+ * @return name for the ComplexType
+ */
String name() default "";
- String namespace();
+ /**
+ * Define the namespace for the ComplexType.
+ * If not set a default value has to be generated by the EDM provider.
+ *
+ * @return namespace for the ComplexType
+ */
+ String namespace() default "";
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmConcurrencyControl.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmConcurrencyControl.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmConcurrencyControl.java
index a94e369..d9475f8 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmConcurrencyControl.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmConcurrencyControl.java
@@ -32,5 +32,4 @@ import java.lang.annotation.Target;
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
-public @interface EdmConcurrencyControl {
-}
+public @interface EdmConcurrencyControl {}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmDocumentation.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmDocumentation.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmDocumentation.java
new file mode 100644
index 0000000..bb4059b
--- /dev/null
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmDocumentation.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * 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.odata2.api.annotation.edm;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * <p>Additional documentation for an EDM element.</p>
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.ANNOTATION_TYPE)
+public @interface EdmDocumentation {
+ /**
+ * Define a summary for this documentation.
+ *
+ * @return summary of documentation for EDM element
+ */
+ String summary() default "";
+ /**
+ * Complete description for this documentation.
+ *
+ * @return description of documentation for EDM element
+ */
+ String longDescription() default "";
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntitySet.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntitySet.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntitySet.java
index 4a7fa6e..ed00268 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntitySet.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntitySet.java
@@ -23,9 +23,27 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+/**
+ * <p>Annotation for a EDM/CSDL EntitySet element.</p>
+ * <p>EdmEntitySet is the container for entity type instances as described in the OData protocol.
+ * The {@link EdmEntitySet} annotation defines the annotated class as entity set and must be used
+ * in conjunction with an {@link EdmEntityType} annotation on a class.</p>
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface EdmEntitySet {
+ /**
+ * Define the name for the EDM Entity Set.
+ * If not set a default value has to be generated by the EDM provider.
+ *
+ * @return name for the EDM Entity Set
+ */
String name() default "";
-// String container() default "";
+ /**
+ * Define the container name for the EDM Entity Set.
+ * If not set a default value has to be generated by the EDM provider.
+ *
+ * @return container name for the EDM Entity Set
+ */
+ String container() default "";
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntityType.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntityType.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntityType.java
index 67a363d..765ba6c 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntityType.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntityType.java
@@ -23,9 +23,26 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+/**
+ * <p>Annotation for a EDM/CSDL EntityType element.</p>
+ * <p>EdmEntityType holds a set of related information like EdmPrimitiveType, EdmComplexType
+ * and EdmNavigation properties.</p>
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface EdmEntityType {
+ /**
+ * Define the name for the EDM EntityType.
+ * If not set a default value has to be generated by the EDM provider.
+ *
+ * @return name for the EDM EntityType
+ */
String name() default "";
- String namespace();
-}
+ /**
+ * Define the namespace for the EDM EntityType.
+ * If not set a default value has to be generated by the EDM provider.
+ *
+ * @return namespace for the EDM EntityType
+ */
+ String namespace() default "";
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFacets.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFacets.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFacets.java
index 98edf8c..2b7c591 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFacets.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFacets.java
@@ -23,11 +23,39 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+/**
+ * <p>Annotation for definition of EdmFactes on an EdmProperty (for an EdmEntityType or EdmComplexType
+ * which contains the EdmProperty as a field).</p>
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface EdmFacets {
+ /**
+ * The maximum length of the type in use.
+ * A negative value indicates for the EDM provider an unset/default value.
+ *
+ * @return the maximum length of the type in use as Integer
+ */
int maxLength() default -1;
+ /**
+ * The scale of the type in use.
+ * A negative value indicates for the EDM provider an unset/default value.
+ *
+ * @return the scale of the type in use as Integer
+ */
int scale() default -1;
+ /**
+ * The precision of the type in use.
+ * A negative value indicates for the EDM provider an unset/default value.
+ *
+ * @return the precision of the type in use as Integer
+ */
int precision() default -1;
+ /**
+ * The information if the type in use is nullable.
+ * The default value for nullable is <code>false</code>.
+ *
+ * @return <code>true</code> if the type in use is nullable, <code>false</code> otherwise.
+ */
boolean nullable() default false;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFunctionImport.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFunctionImport.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFunctionImport.java
index dd85784..1972cb4 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFunctionImport.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFunctionImport.java
@@ -23,27 +23,78 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import org.apache.olingo.odata2.api.annotation.edmx.HttpMethod;
-import org.apache.olingo.odata2.api.annotation.edmx.HttpMethod.Name;
-
+/**
+ * <p>Annotation for definition of an method as an {@link EdmFunctionImport} call/endpoint.</p>
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface EdmFunctionImport {
- enum Type {
- SIMPLE, ENTITY, COMPLEX
- }
-
+ /**
+ * <p>Annotation for definition of the return type of an {@link EdmFunctionImport} method.</p>
+ */
@interface ReturnType {
+ /**
+ * Concrete return types as specified in OData.
+ */
+ enum Type {
+ SIMPLE, ENTITY, COMPLEX
+ }
+
+ /**
+ * Define the return type for the function import.
+ *
+ * @return return type for the function import
+ */
Type type();
+ /**
+ * Define if the return type for the function import is a collection (entity set) or
+ * an single entity (entity).
+ *
+ * @return <code>true</code> if a collection is returned,
+ * otherwise <code>false</code> if a single entity is returned.
+ */
boolean isCollection() default false;
}
+ /**
+ * Concrete HttpMethods for a function import as specified in OData.
+ */
+ enum HttpMethod {
+ POST, PUT, GET, MERGE, DELETE, PATCH
+ };
+
+ /**
+ * Define the name for the function import.
+ * If not set a default value has to be generated by the EDM provider.
+ *
+ * @return name for the function import
+ */
String name() default "";
-
+ /**
+ * Define the name for the according entity set of the function import.
+ * If not set a default value has to be generated by the EDM provider.
+ *
+ * @return name for the according entity set of the function import
+ */
String entitySet() default "";
-
+ /**
+ * Define the return type of this function import
+ *
+ * @return return type of this function import
+ */
ReturnType returnType();
-
- HttpMethod httpMethod() default @HttpMethod(name = Name.GET);
-}
+ /**
+ * Define the http method for which this function import is used
+ * If not set the default http method <code>GET</code> is used.
+ *
+ * @return http method for which this function import is used
+ */
+ HttpMethod httpMethod() default HttpMethod.GET;
+ /**
+ * Defines additional documentation for this function import.
+ *
+ * @return additional documentation for this function import.
+ */
+ EdmDocumentation documentation() default @EdmDocumentation;
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFunctionImportParameter.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFunctionImportParameter.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFunctionImportParameter.java
index d5b2e80..74d1072 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFunctionImportParameter.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFunctionImportParameter.java
@@ -1,20 +1,20 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * 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.odata2.api.annotation.edm;
@@ -22,12 +22,37 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+
import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
+/**
+ * <p>Annotation for definition of an {@link EdmFunctionImportParameter} for an {@link EdmFunctionImport}
+ * which contains the {@link EdmFunctionImportParameter} as a parameter.</p>
+ * The EdmProperty annotation has to be used on a parameter within a {@link EdmFunctionImport} annotated method.
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface EdmFunctionImportParameter {
+ /**
+ * Define the name for the Function Import Parameter.
+ * If not set a default value has to be generated by the EDM provider.
+ *
+ * @return name for the Function Import Parameter
+ */
String name();
+ /**
+ * Define the EdmSimpleType which is used for the Function Import Parameter in the EDM.
+ * If not set a default value has to be generated by the EDM provider (which should be compatible to the
+ * java type of the annotated field).
+ *
+ * @return type for the Function Import Parameter as used in the EDM
+ */
EdmSimpleTypeKind type() default EdmSimpleTypeKind.Null;
- Facets facets() default @Facets;
-}
+ /**
+ * Define the EdmFacets for the Function Import Parameter in the EDM.
+ * If not set the default EdmFacet values are used (see {@link EdmFacets}).
+ *
+ * @return facets for the Function Import Parameter as used in the EDM
+ */
+ EdmFacets facets() default @EdmFacets;
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmKey.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmKey.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmKey.java
index 48db91f..d6495e7 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmKey.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmKey.java
@@ -23,7 +23,12 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+/**
+ * <p>Annotation for definition of an EdmProperty as EdmKey for the EdmEntityType which contains the EdmProperty.</p>
+ * This annotation can not be parameterized, all values like name are defined via the {@link EdmProperty} annotation.
+ * In addition the EdmKey annotation has to be used in conjunction with an EdmProperty annotation on a field
+ * within a EdmEntityType annotated class.
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
-public @interface EdmKey {
-}
+public @interface EdmKey {}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmMediaResourceContent.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmMediaResourceContent.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmMediaResourceContent.java
index 80e9cd8..ccdcac3 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmMediaResourceContent.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmMediaResourceContent.java
@@ -23,7 +23,16 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+/**
+ * <p>Annotation for definition of an {@link EdmProperty} as <b>media resource content</b> for the
+ * {@link EdmEntityType}
+ * which contains the {@link EdmProperty}. Additionally an {@link EdmEntityType} will be flagged in the EDM as
+ * <code>hasStream == true</code> if an {@link EdmProperty} in conjunction with the {@link EdmMediaResourceContent}
+ * annotation is defined.</p>
+ * This annotation can not be parameterized, all values like name are defined via the {@link EdmProperty} annotation.
+ * In addition the {@link EdmMediaResourceContent} annotation has to be used in conjunction with an
+ * {@link EdmProperty} annotation on a field within an {@link EdmEntityType} annotated class.
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
-public @interface EdmMediaResourceContent {
-}
+public @interface EdmMediaResourceContent {}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmMediaResourceMimeType.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmMediaResourceMimeType.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmMediaResourceMimeType.java
index d255ff4..67068bb 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmMediaResourceMimeType.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmMediaResourceMimeType.java
@@ -23,7 +23,16 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+/**
+ * <p>Annotation for definition of an {@link EdmProperty} as <b>mime type for the media resource</b>
+ * of the {@link EdmEntityType} which contains the {@link EdmProperty}.
+ * The value of the {@link EdmMediaResourceMimeType} annotated field will be used as <code>Content-Type</code>
+ * of the media content response (of an OData <code>$value</code> request).
+ * </p>
+ * This annotation can not be parameterized, all values like name are defined via the {@link EdmProperty} annotation.
+ * In addition the {@link EdmMediaResourceMimeType} annotation has to be used in conjunction with an
+ * {@link EdmProperty} annotation on a field within an {@link EdmEntityType} annotated class.
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
-public @interface EdmMediaResourceMimeType {
-}
+public @interface EdmMediaResourceMimeType {}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmMediaResourceSource.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmMediaResourceSource.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmMediaResourceSource.java
index 78e72b5..f9ea72d 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmMediaResourceSource.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmMediaResourceSource.java
@@ -23,7 +23,13 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+/**
+ * <p>Annotation for definition of an {@link EdmProperty} as <b>media resource source</b> for the {@link EdmEntityType}
+ * which contains the {@link EdmProperty}.
+ * This annotation can not be parameterized, all values like name are defined via the {@link EdmProperty} annotation.
+ * In addition the {@link EdmMediaResourceSource} annotation has to be used in conjunction with an
+ * {@link EdmProperty} annotation on a field within an {@link EdmEntityType} annotated class.
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
-public @interface EdmMediaResourceSource {
-}
+public @interface EdmMediaResourceSource {}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmNavigationProperty.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmNavigationProperty.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmNavigationProperty.java
index 7cdad48..c193e13 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmNavigationProperty.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmNavigationProperty.java
@@ -25,13 +25,52 @@ import java.lang.annotation.Target;
import org.apache.olingo.odata2.api.edm.EdmMultiplicity;
+/**
+ * <p>Annotation for definition of an EdmNavigationProperty for an EdmEntityType
+ * which contains the navigation property as a field.</p>
+ * The EdmNavigationProperty annotation has to be used on a field within a EdmEntityType annotated class.
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface EdmNavigationProperty {
-
+ /**
+ * Define the name for the Navigation Property.
+ * If not set a default value has to be generated by the EDM provider.
+ *
+ * @return name for the Navigation Property
+ */
String name() default "";
+ /**
+ * Define the target entity in form of a java class for the Navigation Property.
+ * The referenced java class must be annotated with {@link EdmEntityType}.
+ * If not set a EDM provider should be able to determine the corresponding type or
+ * to handle the default setting.
+ *
+ * @return referenced java class which must be annotated with {@link EdmEntityType}.
+ */
Class<?> toType() default Object.class;
- String association() default ""; // if not set -> will be generated
- String toRole() default ""; // if not set -> will be generated
+ /**
+ * Define the name for the related Edm Association Set (of the Navigation Property).
+ * If not set a default value has to be generated by the EDM provider.
+ *
+ * @return name for the related Edm Association Set (of the Navigation Property).
+ */
+ String association() default "";
+ /**
+ * Define the name for the related Edm Role (of the Navigation Property).
+ * If not set a default value has to be generated by the EDM provider.
+ *
+ * @return name for the related Edm Role (of the Navigation Property).
+ */
+ String toRole() default "";
+ /**
+ * Define the multiplicity to the target EdmEntity of the Navigation Property.
+ * If not set a default multiplicity of <code>ONE</code> is assumed.
+ * This could be overwritten by the EDM provider if the correct multiplicity can be determined.
+ * As example: The default multiplicity of <code>ONE</code> on a field (EdmProperty) with
+ * a java type <code>Collection</code> can be overwritten by a multiplicity of <code>MANY</code>.
+ *
+ * @return multiplicity to the target EdmEntity of the Navigation Property.
+ */
EdmMultiplicity toMultiplicity() default EdmMultiplicity.ONE;
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmProperty.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmProperty.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmProperty.java
index 14911ce..6e45598 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmProperty.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmProperty.java
@@ -22,12 +22,38 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+
import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
+/**
+ * <p>Annotation for definition of an EdmProperty for an EdmEntityType or EdmComplexType
+ * which contains the EdmProperty as a field.</p>
+ * The EdmProperty annotation has to be used on a field within a EdmEntityType or EdmComplexType annotated class.
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface EdmProperty {
+ /**
+ * Define the EdmSimpleType which is used for the Property in the EDM.
+ * If not set a default value has to be generated by the EDM provider (which should be compatible to the
+ * java type of the annotated field).
+ * If the property is a EdmComplexType (and no EdmSimpleType) the default value has to be used.
+ *
+ * @return type for the Property as used in the EDM
+ */
EdmSimpleTypeKind type() default EdmSimpleTypeKind.Null;
+ /**
+ * Define the name for the Property.
+ * If not set a default value has to be generated by the EDM provider.
+ *
+ * @return name for the Property
+ */
String name() default "";
+ /**
+ * Define the EdmFacets for the Property in the EDM.
+ * If not set the default EdmFacet values are used (see {@link EdmFacets}).
+ *
+ * @return facets for the Property as used in the EDM
+ */
EdmFacets facets() default @EdmFacets;
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Facets.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Facets.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Facets.java
index d59a3de..fec2f8d 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Facets.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Facets.java
@@ -23,6 +23,10 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+/**
+ * @deprecated: As of Olingo version 1.1.x, replaced by {@link EdmFacets}.
+ */
+@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface Facets {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/FunctionImport.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/FunctionImport.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/FunctionImport.java
index 5101cc3..0704a66 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/FunctionImport.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/FunctionImport.java
@@ -26,6 +26,10 @@ import java.lang.annotation.Target;
import org.apache.olingo.odata2.api.annotation.edmx.HttpMethod;
import org.apache.olingo.odata2.api.annotation.edmx.HttpMethod.Name;
+/**
+ * * @deprecated: As of Olingo version 1.1.x, replaced by {@link EdmFunctionImport}.
+ */
+@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface FunctionImport {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Parameter.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Parameter.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Parameter.java
index ee685e4..a5aeb35 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Parameter.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Parameter.java
@@ -23,6 +23,11 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+/**
+ * @deprecated: As of Olingo version 1.1.x, replaced by @link {@link EdmFunctionImportParameter}
+ * within {@link EdmFunctionImport}.
+ */
+@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface Parameter {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3eb58544/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edmx/HttpMethod.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edmx/HttpMethod.java b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edmx/HttpMethod.java
index 9e8321a..6912e47 100644
--- a/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edmx/HttpMethod.java
+++ b/odata2-lib/odata-annotation/src/main/java/org/apache/olingo/odata2/api/annotation/edmx/HttpMethod.java
@@ -23,6 +23,12 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import org.apache.olingo.odata2.api.annotation.edm.EdmFunctionImport;
+
+/**
+ * @deprecated: As of Olingo version 1.1.x, replaced by HttpMethod enum within {@link EdmFunctionImport}.
+ */
+@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface HttpMethod {