You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2013/12/05 13:30:58 UTC
[05/52] git commit: Simplified annotations
Simplified 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/648d0b40
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/648d0b40
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/648d0b40
Branch: refs/heads/master
Commit: 648d0b409fbe5380fdf46fe7980bd3cb6e55fd24
Parents: ae0d7d1
Author: Michael Bolz <mi...@sap.com>
Authored: Fri Oct 11 20:59:39 2013 +0200
Committer: Michael Bolz <mi...@sap.com>
Committed: Fri Oct 11 20:59:39 2013 +0200
----------------------------------------------------------------------
.../api/annotation/edm/EdmComplexProperty.java | 32 ---------------
.../odata2/api/annotation/edm/EdmEntitySet.java | 31 ---------------
.../api/annotation/edm/EdmEntityType.java | 3 ++
.../odata2/api/annotation/edm/EdmFacets.java | 33 +++++++++++++++
.../odata2/api/annotation/edm/EdmProperty.java | 5 ++-
.../odata2/api/annotation/edm/Facets.java | 36 -----------------
.../api/annotation/edm/ds/EntityDataSource.java | 1 -
.../annotation/edm/AnnotationEdmProvider.java | 42 ++++++++++++--------
.../odata2/core/annotation/edm/ClassHelper.java | 1 -
.../processor/AnnotationProcessor.java | 4 ++
.../processor/json/EdmAnnotationSerializer.java | 7 ++--
.../odata2/core/annotation/model/Building.java | 5 +--
.../odata2/core/annotation/model/Employee.java | 10 ++---
.../odata2/core/annotation/model/Location.java | 3 +-
.../odata2/core/annotation/model/Manager.java | 5 +--
.../odata2/core/annotation/model/Room.java | 5 +--
.../odata2/core/annotation/model/Team.java | 5 +--
.../odata2/ref/annotation/model/Building.java | 7 ++--
.../odata2/ref/annotation/model/Employee.java | 10 ++---
.../odata2/ref/annotation/model/Location.java | 3 +-
.../odata2/ref/annotation/model/Manager.java | 5 +--
.../odata2/ref/annotation/model/Photo.java | 6 +--
.../odata2/ref/annotation/model/Room.java | 6 +--
.../odata2/ref/annotation/model/Team.java | 5 +--
24 files changed, 102 insertions(+), 168 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmComplexProperty.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmComplexProperty.java b/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmComplexProperty.java
deleted file mode 100644
index 3af0227..0000000
--- a/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmComplexProperty.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- ******************************************************************************/
-package org.apache.olingo.odata2.api.annotation.edm;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
-public @interface EdmComplexProperty {
- String name() default "";
- String namespace() default "";
- String facet() default "";
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntitySet.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntitySet.java b/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntitySet.java
deleted file mode 100644
index b62d986..0000000
--- a/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntitySet.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- ******************************************************************************/
-package org.apache.olingo.odata2.api.annotation.edm;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface EdmEntitySet {
- String name();
- String container();
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntityType.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntityType.java b/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntityType.java
index 67a363d..ed5d802 100644
--- a/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntityType.java
+++ b/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmEntityType.java
@@ -28,4 +28,7 @@ import java.lang.annotation.Target;
public @interface EdmEntityType {
String name() default "";
String namespace();
+ /* If set this entity is exposed as entity set with given name. If not set theire will be no entity set generated. */
+ String entitySetName() default "";
+ String container() default "";
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFacets.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFacets.java b/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFacets.java
new file mode 100644
index 0000000..4ea2bd5
--- /dev/null
+++ b/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmFacets.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * 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;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.ANNOTATION_TYPE)
+public @interface EdmFacets {
+ int maxLength() default 0;
+ int scale() default -1;
+ int precision() default 0;
+ boolean nullable() default false;
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmProperty.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmProperty.java b/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmProperty.java
index 68c411b..66c5282 100644
--- a/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmProperty.java
+++ b/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/EdmProperty.java
@@ -29,5 +29,8 @@ import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
public @interface EdmProperty {
EdmSimpleTypeKind type() default EdmSimpleTypeKind.Null;
String name() default "";
- String facet() default "";
+ /* only for complex property */
+ String namespace() default "";
+ EdmFacets facets() default @EdmFacets;
+
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Facets.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Facets.java b/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Facets.java
deleted file mode 100644
index 24a3be6..0000000
--- a/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/Facets.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- ******************************************************************************/
-package org.apache.olingo.odata2.api.annotation.edm;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.ANNOTATION_TYPE)
-public @interface Facets {
- int maxLength() default 0;
-
- int scale() default -1;
-
- int precision() default 0;
-
- boolean nullable() default false;
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/ds/EntityDataSource.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/ds/EntityDataSource.java b/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/ds/EntityDataSource.java
index aa2aff6..e21c81f 100644
--- a/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/ds/EntityDataSource.java
+++ b/odata2-edm-annotation/edm-annotation-api/src/main/java/org/apache/olingo/odata2/api/annotation/edm/ds/EntityDataSource.java
@@ -27,6 +27,5 @@ import java.lang.annotation.Target;
@Target(ElementType.TYPE)
public @interface EntityDataSource {
String name() default "";
- Class<?> entityClass() default Object.class;
Class<?> entityType();
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/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 419eedd..8bd80ad 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
@@ -27,13 +27,12 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.olingo.odata2.api.annotation.edm.EdmComplexEntity;
-import org.apache.olingo.odata2.api.annotation.edm.EdmComplexProperty;
-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;
import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
import org.apache.olingo.odata2.api.annotation.edm.NavigationEnd;
+import org.apache.olingo.odata2.api.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.edm.EdmMultiplicity;
import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
import org.apache.olingo.odata2.api.edm.FullQualifiedName;
@@ -270,24 +269,22 @@ public class AnnotationEdmProvider extends EdmProvider {
}
private void handleEntityContainer(Class<?> aClass) {
- EdmEntitySet entitySet = aClass.getAnnotation(EdmEntitySet.class);
- if (entitySet != null) {
- EdmEntityType entity = aClass.getAnnotation(EdmEntityType.class);
- String containerName = entitySet.container();
+ EdmEntityType entity = aClass.getAnnotation(EdmEntityType.class);
+ if (entity != null && !entity.entitySetName().isEmpty()) {
+ String containerName = entity.container();
ContainerBuilder builder = containerName2ContainerBuilder.get(containerName);
if (builder == null) {
builder = ContainerBuilder.init(entity.namespace(), containerName);
containerName2ContainerBuilder.put(containerName, builder);
}
- builder.addEntitySet(createEntitySet(entitySet, entity));
+ builder.addEntitySet(createEntitySet(entity));
}
}
- private EntitySet createEntitySet(EdmEntitySet et, EdmEntityType entity) {
- String name = et.name();
+ private EntitySet createEntitySet(EdmEntityType entity) {
FullQualifiedName typeName = new FullQualifiedName(entity.namespace(), entity.name());
- return new EntitySet().setName(name).setEntityType(typeName);
+ return new EntitySet().setName(entity.entitySetName()).setEntityType(typeName);
}
private void finish() {
@@ -349,16 +346,12 @@ public class AnnotationEdmProvider extends EdmProvider {
for (Field field : fields) {
EdmProperty ep = field.getAnnotation(EdmProperty.class);
if (ep != null) {
- properties.add(createProperty(ep, field));
+ properties.add(createProperty(ep, field, namespace));
EdmKey eti = field.getAnnotation(EdmKey.class);
if (eti != null) {
keyProperties.add(createKeyProperty(ep, field));
}
}
- EdmComplexProperty ecp = field.getAnnotation(EdmComplexProperty.class);
- if (ecp != null) {
- properties.add(createComplexProperty(ecp, field, namespace));
- }
EdmNavigationProperty enp = field.getAnnotation(EdmNavigationProperty.class);
if (enp != null) {
final NavigationProperty navProperty = createNavigationProperty(namespace, enp, field);
@@ -429,7 +422,16 @@ public class AnnotationEdmProvider extends EdmProvider {
return keyProperty.setName(entityName);
}
- private Property createProperty(EdmProperty ep, Field field) {
+ private Property createProperty(EdmProperty ep, Field field, String defaultNamespace) {
+ if(isAnnotatedEntity(field.getType())) {
+ return createComplexProperty(ep, field, defaultNamespace);
+ } else {
+ return createSimpleProperty(ep, field);
+ }
+ }
+
+
+ private Property createSimpleProperty(EdmProperty ep, Field field) {
SimpleProperty sp = new SimpleProperty();
String entityName = ep.name();
if (entityName.isEmpty()) {
@@ -446,7 +448,7 @@ public class AnnotationEdmProvider extends EdmProvider {
return sp;
}
- private Property createComplexProperty(EdmComplexProperty ep, Field field, String defaultNamespace) {
+ private Property createComplexProperty(EdmProperty ep, Field field, String defaultNamespace) {
ComplexProperty cp = new ComplexProperty();
String entityName = ep.name();
if (entityName.isEmpty()) {
@@ -578,6 +580,12 @@ public class AnnotationEdmProvider extends EdmProvider {
private String getCanonicalName(Field field) {
return ANNOTATION_HELPER.getCanonicalName(field);
}
+
+ private boolean isAnnotatedEntity(Class<?> clazz) {
+ boolean isComplexEntity = clazz.getAnnotation(EdmComplexEntity.class) != null;
+ boolean isEntity = clazz.getAnnotation(EdmEntityType.class) != null;
+ return isComplexEntity || isEntity;
+ }
}
static class SchemaBuilder {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/edm/ClassHelper.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/edm/ClassHelper.java b/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/edm/ClassHelper.java
index baf4626..2094591 100644
--- a/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/edm/ClassHelper.java
+++ b/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/edm/ClassHelper.java
@@ -23,7 +23,6 @@ import java.io.FileFilter;
import java.io.FilenameFilter;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
/**
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/processor/AnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/processor/AnnotationProcessor.java b/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/processor/AnnotationProcessor.java
index b97d897..faf129c 100644
--- a/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/processor/AnnotationProcessor.java
+++ b/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/processor/AnnotationProcessor.java
@@ -58,6 +58,7 @@ import org.apache.olingo.odata2.core.annotation.processor.json.JsonConsumer;
*/
public class AnnotationProcessor extends ODataSingleProcessor {
+ private static final Object[] EMPTY_ARRAY = new Object[0];
private static final AnnotationHelper ANNOTATION_HELPER = new AnnotationHelper();
private final List<Class<?>> foundClasses;
@@ -368,6 +369,9 @@ public class AnnotationProcessor extends ODataSingleProcessor {
}
private Object[] mapParameterKeys(Method method, List<KeyPredicate> keys) throws IllegalStateException {
+ if(method == null) {
+ return EMPTY_ARRAY;
+ }
Class<?>[] pTypes = method.getParameterTypes();
if (pTypes.length != keys.size()) {
throw new IllegalStateException("Wrong amount of key properties. Expected read keys = "
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/processor/json/EdmAnnotationSerializer.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/processor/json/EdmAnnotationSerializer.java b/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/processor/json/EdmAnnotationSerializer.java
index 310e197..01ccf2c 100644
--- a/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/processor/json/EdmAnnotationSerializer.java
+++ b/odata2-edm-annotation/edm-annotation-core/src/main/java/org/apache/olingo/odata2/core/annotation/processor/json/EdmAnnotationSerializer.java
@@ -29,13 +29,12 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
-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.EdmNavigationProperty;
import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
import org.apache.olingo.odata2.api.annotation.edm.EdmKey;
import org.apache.olingo.odata2.core.annotation.edm.AnnotationHelper;
-import org.apache.olingo.odata2.core.annotation.edm.ClassHelper;
import org.apache.olingo.odata2.core.exception.ODataRuntimeException;
public class EdmAnnotationSerializer {
@@ -124,11 +123,11 @@ public class EdmAnnotationSerializer {
private boolean writeEdmNavigationProperty(Object entity, JsonWriter json, Field field)
throws IllegalArgumentException, IllegalAccessException {
EdmNavigationProperty navProperty = field.getAnnotation(EdmNavigationProperty.class);
- EdmEntitySet property = entity.getClass().getAnnotation(EdmEntitySet.class);
+ EdmEntityType entityType = entity.getClass().getAnnotation(EdmEntityType.class);
if (navProperty != null) {
field.setAccessible(true);
Object keyValue = extractEdmKey(entity);
- json.writeProperty("uri", baseUri + property.name() + "('" + keyValue.toString() + "')"
+ json.writeProperty("uri", baseUri + entityType.entitySetName() + "('" + keyValue.toString() + "')"
+ "/" + navProperty.relationship());
return true;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Building.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Building.java b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Building.java
index 1da4bdb..9889c2e 100644
--- a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Building.java
+++ b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Building.java
@@ -24,7 +24,6 @@ import java.util.List;
import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
import org.apache.olingo.odata2.api.annotation.edm.EdmKey;
import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
-import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
import org.apache.olingo.odata2.api.annotation.edm.NavigationEnd;
import org.apache.olingo.odata2.api.edm.EdmMultiplicity;
@@ -33,8 +32,8 @@ import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
/**
*
*/
-@EdmEntityType(name="Building", namespace=ModelSharedConstants.NAMESPACE_1)
-@EdmEntitySet(name="Buildings", container="Container1")
+@EdmEntityType(name="Building", namespace=ModelSharedConstants.NAMESPACE_1,
+ entitySetName = "Buildings", container="Container1")
public class Building {
@EdmKey
@EdmProperty(type = EdmSimpleTypeKind.String)
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Employee.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Employee.java b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Employee.java
index 0323ecc..5247448 100644
--- a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Employee.java
+++ b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Employee.java
@@ -20,9 +20,7 @@ package org.apache.olingo.odata2.core.annotation.model;
import java.text.DateFormat;
import java.util.Calendar;
-import org.apache.olingo.odata2.api.annotation.edm.EdmComplexProperty;
import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
-import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
import org.apache.olingo.odata2.api.annotation.edm.EdmKey;
@@ -33,12 +31,12 @@ import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
/**
*
*/
-@EdmEntityType(name="Employee", namespace=ModelSharedConstants.NAMESPACE_1)
-@EdmEntitySet(name="Employees", container=ModelSharedConstants.CONTAINER_1)
+@EdmEntityType(name="Employee", namespace=ModelSharedConstants.NAMESPACE_1,
+ entitySetName = "Employees", container=ModelSharedConstants.CONTAINER_1)
public class Employee {
private static int counter = 1;
- @EdmProperty(name="EmployeeId", type = EdmSimpleTypeKind.Int32)
@EdmKey
+ @EdmProperty(name="EmployeeId", type = EdmSimpleTypeKind.Int32)
private int employeeId;
@EdmProperty(name="EmployeeName")
private String employeeName;
@@ -54,7 +52,7 @@ public class Employee {
private byte[] image;
private String imageUrl;
private Calendar entryDate;
- @EdmComplexProperty(name="Location")
+ @EdmProperty(name="Location")
private Location location;
public Employee(final int employeeId, final String name) {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Location.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Location.java b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Location.java
index 3b74c30..b8b9725 100644
--- a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Location.java
+++ b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Location.java
@@ -19,7 +19,6 @@
package org.apache.olingo.odata2.core.annotation.model;
import org.apache.olingo.odata2.api.annotation.edm.EdmComplexEntity;
-import org.apache.olingo.odata2.api.annotation.edm.EdmComplexProperty;
import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
/**
@@ -29,7 +28,7 @@ import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
public class Location {
@EdmProperty
private String country;
- @EdmComplexProperty
+ @EdmProperty
private City city;
public Location(final String country, final String postalCode, final String cityName) {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Manager.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Manager.java b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Manager.java
index 1408c9c..1000822 100644
--- a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Manager.java
+++ b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Manager.java
@@ -21,15 +21,14 @@ package org.apache.olingo.odata2.core.annotation.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
-import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
import org.apache.olingo.odata2.api.annotation.edm.NavigationEnd;
/**
*
*/
-@EdmEntityType(name = "Manager", namespace = ModelSharedConstants.NAMESPACE_1)
-@EdmEntitySet(name = "Managers", container = ModelSharedConstants.CONTAINER_1)
+@EdmEntityType(name = "Manager", namespace = ModelSharedConstants.NAMESPACE_1,
+ entitySetName = "Managers", container = ModelSharedConstants.CONTAINER_1)
public class Manager extends Employee {
@EdmNavigationProperty(name = "nm_Employees", relationship = "ManagerEmployees",
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Room.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Room.java b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Room.java
index 8c8a62d..e1c55ed 100644
--- a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Room.java
+++ b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Room.java
@@ -17,7 +17,6 @@ package org.apache.olingo.odata2.core.annotation.model;
import java.util.ArrayList;
import java.util.List;
-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.EdmNavigationProperty;
import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
@@ -27,8 +26,8 @@ import org.apache.olingo.odata2.api.edm.EdmMultiplicity;
/**
*
*/
-@EdmEntityType(name = "Room", namespace = ModelSharedConstants.NAMESPACE_1)
-@EdmEntitySet(name = "Rooms", container = ModelSharedConstants.CONTAINER_1)
+@EdmEntityType(name = "Room", namespace = ModelSharedConstants.NAMESPACE_1,
+ entitySetName = "Rooms", container = ModelSharedConstants.CONTAINER_1)
public class Room extends RefBase {
@EdmProperty
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Team.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Team.java b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Team.java
index 363ad7a..529ed5a 100644
--- a/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Team.java
+++ b/odata2-edm-annotation/edm-annotation-core/src/test/java/org/apache/olingo/odata2/core/annotation/model/Team.java
@@ -21,7 +21,6 @@ package org.apache.olingo.odata2.core.annotation.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
-import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
import org.apache.olingo.odata2.api.annotation.edm.NavigationEnd;
@@ -31,8 +30,8 @@ import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
/**
*
*/
-@EdmEntityType(name="Team", namespace = ModelSharedConstants.NAMESPACE_1)
-@EdmEntitySet(name="Teams", container = ModelSharedConstants.CONTAINER_1)
+@EdmEntityType(name="Team", namespace = ModelSharedConstants.NAMESPACE_1,
+ entitySetName = "Teams", container = ModelSharedConstants.CONTAINER_1)
public class Team extends RefBase {
@EdmProperty(type = EdmSimpleTypeKind.Boolean)
private Boolean isScrumTeam;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Building.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Building.java b/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Building.java
index 4035b24..5dca34d 100644
--- a/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Building.java
+++ b/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Building.java
@@ -24,7 +24,6 @@ import java.util.List;
import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
import org.apache.olingo.odata2.api.annotation.edm.EdmKey;
import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
-import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
import org.apache.olingo.odata2.api.annotation.edm.NavigationEnd;
import org.apache.olingo.odata2.api.edm.EdmMultiplicity;
@@ -33,11 +32,11 @@ import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
/**
*
*/
-@EdmEntityType(name="Building", namespace=ModelSharedConstants.NAMESPACE_1)
-@EdmEntitySet(name="Buildings", container="Container1")
+@EdmEntityType(name="Building", namespace=ModelSharedConstants.NAMESPACE_1,
+ entitySetName = "Buildings", container="Container1")
public class Building {
@EdmKey
- @EdmProperty(type = EdmSimpleTypeKind.String)
+ @EdmProperty(type = EdmSimpleTypeKind.Int32)
private int id;
@EdmProperty
private String name;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Employee.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Employee.java b/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Employee.java
index 0ef9e3b..02a1530 100644
--- a/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Employee.java
+++ b/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Employee.java
@@ -20,9 +20,7 @@ package org.apache.olingo.odata2.ref.annotation.model;
import java.text.DateFormat;
import java.util.Calendar;
-import org.apache.olingo.odata2.api.annotation.edm.EdmComplexProperty;
import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
-import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
import org.apache.olingo.odata2.api.annotation.edm.EdmKey;
@@ -33,12 +31,12 @@ import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
/**
*
*/
-@EdmEntityType(name="Employee", namespace=ModelSharedConstants.NAMESPACE_1)
-@EdmEntitySet(name="Employees", container=ModelSharedConstants.CONTAINER_1)
+@EdmEntityType(name="Employee", namespace=ModelSharedConstants.NAMESPACE_1,
+ entitySetName = "Employees", container=ModelSharedConstants.CONTAINER_1)
public class Employee {
private static int counter = 1;
- @EdmProperty(name="EmployeeId", type = EdmSimpleTypeKind.Int32)
@EdmKey
+ @EdmProperty(name="EmployeeId", type = EdmSimpleTypeKind.Int32)
private int employeeId;
@EdmProperty(name="EmployeeName")
private String employeeName;
@@ -54,7 +52,7 @@ public class Employee {
private byte[] image;
private String imageUrl;
private Calendar entryDate;
- @EdmComplexProperty(name="Location")
+ @EdmProperty(name="Location")
private Location location;
public Employee(final int employeeId, final String name) {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Location.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Location.java b/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Location.java
index f63e8a4..809accf 100644
--- a/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Location.java
+++ b/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Location.java
@@ -19,7 +19,6 @@
package org.apache.olingo.odata2.ref.annotation.model;
import org.apache.olingo.odata2.api.annotation.edm.EdmComplexEntity;
-import org.apache.olingo.odata2.api.annotation.edm.EdmComplexProperty;
import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
/**
@@ -29,7 +28,7 @@ import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
public class Location {
@EdmProperty
private String country;
- @EdmComplexProperty
+ @EdmProperty
private City city;
public Location(final String country, final String postalCode, final String cityName) {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Manager.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Manager.java b/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Manager.java
index 521c43d..e3b2631 100644
--- a/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Manager.java
+++ b/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Manager.java
@@ -21,15 +21,14 @@ package org.apache.olingo.odata2.ref.annotation.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
-import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
import org.apache.olingo.odata2.api.annotation.edm.NavigationEnd;
/**
*
*/
-@EdmEntityType(name = "Manager", namespace = ModelSharedConstants.NAMESPACE_1)
-@EdmEntitySet(name = "Managers", container = ModelSharedConstants.CONTAINER_1)
+@EdmEntityType(name = "Manager", namespace = ModelSharedConstants.NAMESPACE_1,
+ entitySetName = "Managers", container = ModelSharedConstants.CONTAINER_1)
public class Manager extends Employee {
@EdmNavigationProperty(name = "nm_Employees", relationship = "ManagerEmployees",
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Photo.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Photo.java b/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Photo.java
index 92d1ac6..fd74c30 100644
--- a/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Photo.java
+++ b/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Photo.java
@@ -27,7 +27,7 @@ public class Photo {
private static final String RESOURCE = "/male_1_WinterW.jpg";
private static byte[] defaultImage = ResourceHelper.loadAsByte(RESOURCE);
- private final int id;
+ private int id;
private String name;
private String type = "image/jpeg";
private String imageUrl = "http://localhost" + RESOURCE;
@@ -38,8 +38,8 @@ public class Photo {
public Photo(final int id, final String name, final String type) {
this.id = id;
- setName(name);
- setType(type);
+ this.name = name;
+ this.type = type;
}
public int getId() {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Room.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Room.java b/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Room.java
index 2feb5cd..28373b9 100644
--- a/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Room.java
+++ b/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Room.java
@@ -21,18 +21,16 @@ package org.apache.olingo.odata2.ref.annotation.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
-import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
-import org.apache.olingo.odata2.api.annotation.edm.EdmKey;
import org.apache.olingo.odata2.api.annotation.edm.NavigationEnd;
import org.apache.olingo.odata2.api.edm.EdmMultiplicity;
/**
*
*/
-@EdmEntityType(name = "Room", namespace = ModelSharedConstants.NAMESPACE_1)
-@EdmEntitySet(name = "Rooms", container = ModelSharedConstants.CONTAINER_1)
+@EdmEntityType(name = "Room", namespace = ModelSharedConstants.NAMESPACE_1,
+ entitySetName = "Rooms", container = ModelSharedConstants.CONTAINER_1)
public class Room extends RefBase {
@EdmProperty
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/648d0b40/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Team.java
----------------------------------------------------------------------
diff --git a/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Team.java b/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Team.java
index b805b77..2bf6701 100644
--- a/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Team.java
+++ b/odata2-edm-annotation/edm-annotation-webref/src/main/java/org/apache/olingo/odata2/ref/annotation/model/Team.java
@@ -21,7 +21,6 @@ package org.apache.olingo.odata2.ref.annotation.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
-import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
import org.apache.olingo.odata2.api.annotation.edm.NavigationEnd;
@@ -31,8 +30,8 @@ import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
/**
*
*/
-@EdmEntityType(name="Team", namespace = ModelSharedConstants.NAMESPACE_1)
-@EdmEntitySet(name="Teams", container = ModelSharedConstants.CONTAINER_1)
+@EdmEntityType(name="Team", namespace = ModelSharedConstants.NAMESPACE_1,
+ entitySetName = "Teams", container = ModelSharedConstants.CONTAINER_1)
public class Team extends RefBase {
@EdmProperty(type = EdmSimpleTypeKind.Boolean)
private Boolean isScrumTeam;