olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chanda...@apache.org
Subject [04/50] [abbrv] olingo-odata4 git commit: [OLINGO-575] Edm cleanup part 1
Date Sat, 04 Apr 2015 17:05:10 GMT
[OLINGO-575] Edm cleanup part 1


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/4d059b94
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/4d059b94
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/4d059b94

Branch: refs/heads/OLINGO-549-ODataV4-JPA
Commit: 4d059b94d6fab23bf6a8a1b1df9839ee9d88cbb6
Parents: 3a6293b
Author: Christian Amend <chrisam@apache.org>
Authored: Wed Mar 25 17:19:42 2015 +0100
Committer: Christian Amend <chrisam@apache.org>
Committed: Wed Mar 25 17:19:42 2015 +0100

----------------------------------------------------------------------
 .../api/edm/provider/FunctionImport.java        |  1 +
 .../api/edm/provider/OperationImport.java       |  2 -
 .../core/edm/provider/EdmAnnotationHelper.java  | 24 -----------
 .../edm/provider/EdmAnnotationHelperImpl.java   |  3 +-
 .../core/edm/provider/EdmAnnotationImpl.java    |  6 +--
 .../core/edm/provider/EdmBindingTargetImpl.java |  2 +-
 .../core/edm/provider/EdmComplexTypeImpl.java   |  5 +--
 .../edm/provider/EdmEntityContainerImpl.java    |  2 +-
 .../core/edm/provider/EdmEntityTypeImpl.java    |  4 +-
 .../core/edm/provider/EdmEnumTypeImpl.java      | 44 ++++++++++----------
 .../core/edm/provider/EdmMemberImpl.java        |  2 +-
 .../edm/provider/EdmNavigationPropertyImpl.java |  2 +-
 .../core/edm/provider/EdmOperationImpl.java     |  2 +-
 .../edm/provider/EdmOperationImportImpl.java    |  2 +-
 .../core/edm/provider/EdmParameterImpl.java     |  2 +-
 .../core/edm/provider/EdmPropertyImpl.java      |  2 +-
 .../provider/EdmReferentialConstraintImpl.java  |  3 +-
 .../edm/provider/EdmStructuredTypeHelper.java   | 35 ----------------
 .../provider/EdmStructuredTypeHelperImpl.java   |  6 +--
 .../commons/core/edm/provider/EdmTermImpl.java  |  9 +---
 .../edm/provider/EdmTypeDefinitionImpl.java     | 27 ++++++------
 .../commons/core/edm/provider/EdmTypeImpl.java  |  1 -
 .../tecsvc/provider/ContainerProvider.java      |  1 +
 23 files changed, 57 insertions(+), 130 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/FunctionImport.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/FunctionImport.java
b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/FunctionImport.java
index 71223ae..84d6789 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/FunctionImport.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/FunctionImport.java
@@ -27,6 +27,7 @@ public class FunctionImport extends OperationImport {
 
   private FullQualifiedName function;
 
+  //Default include in service document is false for function imports
   private boolean includeInServiceDocument;
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OperationImport.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OperationImport.java
b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OperationImport.java
index 8aa29db..7de9623 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OperationImport.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/OperationImport.java
@@ -26,9 +26,7 @@ public abstract class OperationImport extends AbstractEdmItem implements
Named,
   private static final long serialVersionUID = -8928186067970681061L;
 
   protected String name;
-
   protected String entitySet;
-
   protected final List<Annotation> annotations = new ArrayList<Annotation>();
 
   public String getName() {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationHelper.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationHelper.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationHelper.java
deleted file mode 100644
index bbbf136..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationHelper.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.commons.core.edm.provider;
-
-import org.apache.olingo.commons.api.edm.EdmAnnotatable;
-
-public interface EdmAnnotationHelper extends EdmAnnotatable {
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationHelperImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationHelperImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationHelperImpl.java
index 106584a..e4b9d9b 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationHelperImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationHelperImpl.java
@@ -22,12 +22,13 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmAnnotatable;
 import org.apache.olingo.commons.api.edm.EdmAnnotation;
 import org.apache.olingo.commons.api.edm.EdmTerm;
 import org.apache.olingo.commons.api.edm.provider.Annotatable;
 import org.apache.olingo.commons.api.edm.provider.Annotation;
 
-public class EdmAnnotationHelperImpl implements EdmAnnotationHelper {
+public class EdmAnnotationHelperImpl implements EdmAnnotatable {
 
   private final Edm edm;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationImpl.java
index cd32570..60eb0b4 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmAnnotationImpl.java
@@ -63,13 +63,9 @@ import org.apache.olingo.commons.core.edm.annotation.EdmUrlRefImpl;
 public class EdmAnnotationImpl implements EdmAnnotation {
 
   private final Edm edm;
-
   private final Annotation annotation;
-
-  private final EdmAnnotationHelper helper;
-
+  private final EdmAnnotationHelperImpl helper;
   private EdmTerm term;
-
   private EdmAnnotationExpression expression;
 
   public EdmAnnotationImpl(final Edm edm, final Annotation annotation) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmBindingTargetImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmBindingTargetImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmBindingTargetImpl.java
index e4a1ba7..b4b035f 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmBindingTargetImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmBindingTargetImpl.java
@@ -38,7 +38,7 @@ import org.apache.olingo.commons.api.edm.provider.NavigationPropertyBinding;
 public abstract class EdmBindingTargetImpl extends EdmNamedImpl implements EdmBindingTarget
{
 
   private final BindingTarget target;
-  private final EdmAnnotationHelper helper;
+  private final EdmAnnotationHelperImpl helper;
   private final EdmEntityContainer container;
 
   private List<EdmNavigationPropertyBinding> navigationPropertyBindings;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmComplexTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmComplexTypeImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmComplexTypeImpl.java
index 432a09f..7fdc0b8 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmComplexTypeImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmComplexTypeImpl.java
@@ -35,13 +35,12 @@ import org.apache.olingo.commons.api.edm.provider.ComplexType;
 
 public class EdmComplexTypeImpl extends EdmStructuredTypeImpl implements EdmComplexType {
 
-  private final EdmStructuredTypeHelper helper;
+  private final EdmStructuredTypeHelperImpl helper;
   
-  private EdmAnnotationHelper annotationHelper;
+  private EdmAnnotationHelperImpl annotationHelper;
 
   public static EdmComplexTypeImpl getInstance(
       final Edm edm, final FullQualifiedName name, final ComplexType complexType) {
-
     return new EdmComplexTypeImpl(edm, name, complexType);
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityContainerImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityContainerImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityContainerImpl.java
index 94b7d4d..5d3eef3 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityContainerImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityContainerImpl.java
@@ -47,7 +47,7 @@ public class EdmEntityContainerImpl extends EdmNamedImpl implements EdmEntityCon
 
   private final EdmProvider provider;
   private EntityContainer container;
-  private EdmAnnotationHelper helper;
+  private EdmAnnotationHelperImpl helper;
 
   protected final FullQualifiedName entityContainerName;
   private final FullQualifiedName parentContainerName;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityTypeImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityTypeImpl.java
index 0ee22e7..b561151 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityTypeImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEntityTypeImpl.java
@@ -39,10 +39,10 @@ import org.apache.olingo.commons.api.edm.provider.PropertyRef;
 
 public class EdmEntityTypeImpl extends EdmStructuredTypeImpl implements EdmEntityType {
 
-  private final EdmStructuredTypeHelper helper;
+  private final EdmStructuredTypeHelperImpl helper;
   private EntityType entityType;
   private boolean baseTypeChecked = false;
-  private EdmAnnotationHelper annotationHelper;
+  private EdmAnnotationHelperImpl annotationHelper;
   private final boolean hasStream;
   protected EdmEntityType entityBaseType;
   private final List<String> keyPredicateNames = new ArrayList<String>();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEnumTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEnumTypeImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEnumTypeImpl.java
index 1fdf73b..df09c3c 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEnumTypeImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmEnumTypeImpl.java
@@ -19,10 +19,10 @@
 package org.apache.olingo.commons.core.edm.provider;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 import org.apache.olingo.commons.api.edm.Edm;
@@ -55,8 +55,7 @@ public class EdmEnumTypeImpl extends EdmTypeImpl implements EdmEnumType
{
   private final String uriPrefix;
   private final String uriSuffix;
   private List<String> memberNames;
-  private List<EdmMember> members;
-  private Map<String, EdmMember> membersMap;
+  private LinkedHashMap<String, EdmMember> membersMap;
 
   public EdmEnumTypeImpl(final Edm edm, final FullQualifiedName enumName, final EnumType
enumType) {
     super(edm, enumName, EdmTypeKind.ENUM);
@@ -81,14 +80,11 @@ public class EdmEnumTypeImpl extends EdmTypeImpl implements EdmEnumType
{
   public EdmPrimitiveType getUnderlyingType() {
     return underlyingType;
   }
-  
+
   @Override
   public EdmMember getMember(final String name) {
     if (membersMap == null) {
-      membersMap = new LinkedHashMap<String, EdmMember>();
-      for (final EdmMember member : getMembers()) {
-        membersMap.put(member.getName(), member);
-      }
+      createEdmMembers();
     }
     return membersMap.get(name);
   }
@@ -96,12 +92,20 @@ public class EdmEnumTypeImpl extends EdmTypeImpl implements EdmEnumType
{
   @Override
   public List<String> getMemberNames() {
     if (memberNames == null) {
-      memberNames = new ArrayList<String>();
-      for (final EdmMember member : getMembers()) {
+      createEdmMembers();
+    }
+    return memberNames;
+  }
+
+  private void createEdmMembers() {
+    membersMap = new LinkedHashMap<String, EdmMember>();
+    memberNames = new ArrayList<String>();
+    if (enumType.getMembers() != null) {
+      for (final EnumMember member : enumType.getMembers()) {
+        membersMap.put(member.getName(), new EdmMemberImpl(edm, getFullQualifiedName(), member));
         memberNames.add(member.getName());
       }
     }
-    return memberNames;
   }
 
   @Override
@@ -186,6 +190,13 @@ public class EdmEnumTypeImpl extends EdmTypeImpl implements EdmEnumType
{
     return result.toString();
   }
 
+  private Collection<EdmMember> getMembers() {
+   if(membersMap == null){
+     createEdmMembers();
+   }
+    return membersMap.values();
+  }
+
   @Override
   public String valueToString(final Object value, final Boolean isNullable, final Integer
maxLength,
       final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException
{
@@ -242,15 +253,4 @@ public class EdmEnumTypeImpl extends EdmTypeImpl implements EdmEnumType
{
   public FullQualifiedName getAnnotationsTargetFQN() {
     return getFullQualifiedName();
   }
-
-  protected List<EdmMember> getMembers() {
-    if (members == null) {
-      members = new ArrayList<EdmMember>(enumType.getMembers().size());
-      for (EnumMember member : enumType.getMembers()) {
-        members.add(new EdmMemberImpl(edm, getFullQualifiedName(), member));
-      }
-    }
-    return members;
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmMemberImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmMemberImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmMemberImpl.java
index 0bdf441..a7d1366 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmMemberImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmMemberImpl.java
@@ -29,7 +29,7 @@ import org.apache.olingo.commons.api.edm.provider.EnumMember;
 
 public class EdmMemberImpl extends EdmNamedImpl implements EdmMember {
 
-  private final EdmAnnotationHelper helper;
+  private final EdmAnnotationHelperImpl helper;
   private final FullQualifiedName enumFQN;
   private final EnumMember member;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmNavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmNavigationPropertyImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmNavigationPropertyImpl.java
index a8bb8d9..e72a98e 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmNavigationPropertyImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmNavigationPropertyImpl.java
@@ -37,8 +37,8 @@ public class EdmNavigationPropertyImpl extends EdmElementImpl implements
EdmNavi
 
   private final FullQualifiedName structuredTypeName;
   private final NavigationProperty navigationProperty;
+  private final EdmAnnotationHelperImpl helper;
   private List<EdmReferentialConstraint> referentialConstraints;
-  private final EdmAnnotationHelper helper;
   private EdmEntityType typeImpl;
   private EdmNavigationProperty partnerNavigationProperty;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmOperationImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmOperationImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmOperationImpl.java
index f8d69bf..217c732 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmOperationImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmOperationImpl.java
@@ -40,7 +40,7 @@ import org.apache.olingo.commons.api.edm.provider.Parameter;
 public abstract class EdmOperationImpl extends EdmTypeImpl implements EdmOperation {
 
   protected final Operation operation;
-  protected final EdmAnnotationHelper helper;
+  protected final EdmAnnotationHelperImpl helper;
   private final Map<String, EdmParameter> parameters = new LinkedHashMap<String,
EdmParameter>();
   private String entitySetPath;
   private boolean isBound;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmOperationImportImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmOperationImportImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmOperationImportImpl.java
index ee5891d..3ace167 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmOperationImportImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmOperationImportImpl.java
@@ -36,7 +36,7 @@ public abstract class EdmOperationImportImpl extends EdmNamedImpl implements
Edm
   protected final EdmEntityContainer container;
   private final Target entitySet;
   private EdmEntitySet returnedEntitySet;
-  private final EdmAnnotationHelper helper;
+  private final EdmAnnotationHelperImpl helper;
 
   public EdmOperationImportImpl(final Edm edm, final EdmEntityContainer container,
       final OperationImport operationImport) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmParameterImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmParameterImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmParameterImpl.java
index f5a25fa..157a779 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmParameterImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmParameterImpl.java
@@ -33,7 +33,7 @@ import org.apache.olingo.commons.api.edm.provider.Parameter;
 public class EdmParameterImpl extends EdmElementImpl implements EdmParameter {
 
   private final Parameter parameter;
-  private final EdmAnnotationHelper helper;
+  private final EdmAnnotationHelperImpl helper;
   private final EdmTypeInfo typeInfo;
   private EdmType typeImpl;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmPropertyImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmPropertyImpl.java
index 61b6a22..973640e 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmPropertyImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmPropertyImpl.java
@@ -36,7 +36,7 @@ public class EdmPropertyImpl extends EdmElementImpl implements EdmProperty
{
   private final FullQualifiedName structuredTypeName;
   private final Property property;
   private final EdmTypeInfo typeInfo;
-  private EdmAnnotationHelper helper;
+  private EdmAnnotationHelperImpl helper;
   private EdmType propertyType;
 
   public EdmPropertyImpl(final Edm edm, final FullQualifiedName structuredTypeName, final
Property property) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmReferentialConstraintImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmReferentialConstraintImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmReferentialConstraintImpl.java
index e8dbc23..4a8d7d8 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmReferentialConstraintImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmReferentialConstraintImpl.java
@@ -28,10 +28,9 @@ import org.apache.olingo.commons.api.edm.provider.ReferentialConstraint;
 
 public class EdmReferentialConstraintImpl implements EdmReferentialConstraint {
 
-  private final EdmAnnotationHelper helper;
+  private final EdmAnnotationHelperImpl helper;
   private final ReferentialConstraint constraint;
   
-  
   public EdmReferentialConstraintImpl(final Edm edm, final ReferentialConstraint constraint)
{
     this.constraint = constraint;
     this.helper = new EdmAnnotationHelperImpl(edm, constraint);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmStructuredTypeHelper.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmStructuredTypeHelper.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmStructuredTypeHelper.java
deleted file mode 100644
index e00a28b..0000000
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmStructuredTypeHelper.java
+++ /dev/null
@@ -1,35 +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.commons.core.edm.provider;
-
-import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
-import org.apache.olingo.commons.api.edm.EdmProperty;
-
-import java.util.Map;
-
-public interface EdmStructuredTypeHelper {
-
-  Map<String, EdmProperty> getProperties();
-
-  Map<String, EdmNavigationProperty> getNavigationProperties();
-
-  boolean isOpenType();
-
-  boolean isAbstract();
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmStructuredTypeHelperImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmStructuredTypeHelperImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmStructuredTypeHelperImpl.java
index f72eef1..9a78bcd 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmStructuredTypeHelperImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmStructuredTypeHelperImpl.java
@@ -29,7 +29,7 @@ import org.apache.olingo.commons.api.edm.provider.StructuralType;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
-public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper {
+public class EdmStructuredTypeHelperImpl {
 
   private final Edm edm;
   private final FullQualifiedName structuredTypeName;
@@ -44,7 +44,6 @@ public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper
{
     this.structuredType = structuredType;
   }
 
-  @Override
   public Map<String, EdmProperty> getProperties() {
     if (properties == null) {
       properties = new LinkedHashMap<String, EdmProperty>();
@@ -57,7 +56,6 @@ public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper
{
     return properties;
   }
 
-  @Override
   public Map<String, EdmNavigationProperty> getNavigationProperties() {
     if (navigationProperties == null) {
       navigationProperties = new LinkedHashMap<String, EdmNavigationProperty>();
@@ -71,12 +69,10 @@ public class EdmStructuredTypeHelperImpl implements EdmStructuredTypeHelper
{
     return navigationProperties;
   }
 
-  @Override
   public boolean isOpenType() {
     return structuredType.isOpenType();
   }
 
-  @Override
   public boolean isAbstract() {
     return structuredType.isAbstract();
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTermImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTermImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTermImpl.java
index cc3f11f..e1f7ce0 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTermImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTermImpl.java
@@ -37,19 +37,12 @@ import org.slf4j.LoggerFactory;
 public class EdmTermImpl extends EdmNamedImpl implements EdmTerm {
 
   private static final Logger LOG = LoggerFactory.getLogger(EdmTermImpl.class);
-
   private final Term term;
-
   private final FullQualifiedName fqn;
-
   private final EdmTypeInfo typeInfo;
-
-  private final EdmAnnotationHelper helper;
-
+  private final EdmAnnotationHelperImpl helper;
   private EdmType termType;
-
   private EdmTerm baseTerm;
-
   private List<Class<?>> appliesTo;
 
   public EdmTermImpl(final Edm edm, final String namespace, final Term term) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTypeDefinitionImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTypeDefinitionImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTypeDefinitionImpl.java
index d04f6dd..6831f07 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTypeDefinitionImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTypeDefinitionImpl.java
@@ -37,25 +37,16 @@ import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
 public class EdmTypeDefinitionImpl extends EdmNamedImpl implements EdmTypeDefinition {
 
   private TypeDefinition typeDefinition;
-  private final EdmPrimitiveType edmPrimitiveTypeInstance;
-  private final EdmAnnotationHelper helper;
   private FullQualifiedName typeDefinitionName;
+  private EdmPrimitiveType edmPrimitiveTypeInstance;
+  private final EdmAnnotationHelperImpl helper;
 
   public EdmTypeDefinitionImpl(final Edm edm, final FullQualifiedName typeDefinitionName,
       final TypeDefinition typeDefinition) {
     super(edm, typeDefinitionName.getName());
     this.typeDefinitionName = typeDefinitionName;
     this.typeDefinition = typeDefinition;
-    try {
-      if (typeDefinition.getUnderlyingType() == null) {
-        throw new EdmException("Underlying Type for type definition: "
-            + typeDefinitionName.getFullQualifiedNameAsString() + " must not be null.");
-      }
-      this.edmPrimitiveTypeInstance = EdmPrimitiveTypeFactory.getInstance(
-          EdmPrimitiveTypeKind.valueOfFQN(typeDefinition.getUnderlyingType()));
-    } catch (IllegalArgumentException e) {
-      throw new EdmException("Invalid underlying type: " + typeDefinition.getUnderlyingType(),
e);
-    }
+  
     this.helper = new EdmAnnotationHelperImpl(edm, typeDefinition);
   }
 
@@ -76,6 +67,18 @@ public class EdmTypeDefinitionImpl extends EdmNamedImpl implements EdmTypeDefini
   
   @Override
   public EdmPrimitiveType getUnderlyingType() {
+    if(edmPrimitiveTypeInstance == null){
+      try {
+        if (typeDefinition.getUnderlyingType() == null) {
+          throw new EdmException("Underlying Type for type definition: "
+              + typeDefinitionName.getFullQualifiedNameAsString() + " must not be null.");
+        }
+        this.edmPrimitiveTypeInstance = EdmPrimitiveTypeFactory.getInstance(
+            EdmPrimitiveTypeKind.valueOfFQN(typeDefinition.getUnderlyingType()));
+      } catch (IllegalArgumentException e) {
+        throw new EdmException("Invalid underlying type: " + typeDefinition.getUnderlyingType(),
e);
+      }
+    }
     return edmPrimitiveTypeInstance;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTypeImpl.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTypeImpl.java
index ea05c24..337d700 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTypeImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/provider/EdmTypeImpl.java
@@ -26,7 +26,6 @@ import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
 public class EdmTypeImpl extends EdmNamedImpl implements EdmType {
 
   protected final FullQualifiedName typeName;
-
   protected final EdmTypeKind kind;
 
   public EdmTypeImpl(final Edm edm, final FullQualifiedName typeName, final EdmTypeKind kind)
{

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/4d059b94/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
index 3882705..90ffca1 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
@@ -251,6 +251,7 @@ public class ContainerProvider {
       } else if (name.equals("ESInvisible")) {
         return new EntitySet()
             .setName("ESInvisible")
+            .setIncludeInServiceDocument(false)
             .setType(EntityTypeProvider.nameETAllPrim);
 
       } else if (name.equals("ESServerSidePaging")) {


Mime
View raw message