olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chri...@apache.org
Subject [1/2] olingo-odata4 git commit: [OLINGO-575] Delete EDM abstract classes
Date Fri, 27 Feb 2015 13:18:28 GMT
Repository: olingo-odata4
Updated Branches:
  refs/heads/master 59766b23b -> d088866e9


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsImpl.java
index 0f0907e..e5450fe 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AnnotationsImpl.java
@@ -24,15 +24,40 @@ import java.util.List;
 import org.apache.olingo.client.api.edm.xml.Annotation;
 import org.apache.olingo.client.api.edm.xml.Annotations;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = AnnotationsDeserializer.class)
-public class AnnotationsImpl extends AbstractAnnotations implements Annotations {
+public class AnnotationsImpl extends AbstractEdmItem implements Annotations {
 
   private static final long serialVersionUID = -5961207981571644200L;
 
   private final List<Annotation> annotations = new ArrayList<Annotation>();
 
+  @JsonProperty(value = "Target", required = true)
+  private String target;
+
+  @JsonProperty("Qualifier")
+  private String qualifier;
+
+  @Override
+  public String getTarget() {
+    return target;
+  }
+
+  public void setTarget(final String target) {
+    this.target = target;
+  }
+
+  @Override
+  public String getQualifier() {
+    return qualifier;
+  }
+
+  public void setQualifier(final String qualifier) {
+    this.qualifier = qualifier;
+  }
+  
   @Override
   public List<Annotation> getAnnotations() {
     return annotations;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java
index fbd16ab..fe143ec 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java
@@ -27,10 +27,10 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 
-public class ComplexTypeDeserializer extends AbstractEdmDeserializer<AbstractComplexType> {
+public class ComplexTypeDeserializer extends AbstractEdmDeserializer<AbstractStructuralType> {
 
   @Override
-  protected AbstractComplexType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+  protected AbstractStructuralType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
       throws IOException, JsonProcessingException {
 
     final ComplexTypeImpl complexType = new ComplexTypeImpl();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeImpl.java
index 86d171b..4fc0ce9 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeImpl.java
@@ -26,7 +26,10 @@ import org.apache.olingo.client.api.edm.xml.ComplexType;
 import org.apache.olingo.client.api.edm.xml.NavigationProperty;
 import org.apache.olingo.client.api.edm.xml.Property;
 
-public class ComplexTypeImpl extends AbstractComplexType implements ComplexType {
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = ComplexTypeDeserializer.class)
+public class ComplexTypeImpl extends AbstractStructuralType implements ComplexType {
 
   private static final long serialVersionUID = 4076944306925840115L;
 
@@ -43,7 +46,7 @@ public class ComplexTypeImpl extends AbstractComplexType implements ComplexType
   private final List<Annotation> annotations = new ArrayList<Annotation>();
 
   @Override
-  public boolean isAbstractEntityType() {
+  public boolean isAbstractType() {
     return abstractEntityType;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java
index 14298ea..efbea76 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java
@@ -25,10 +25,10 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 
-public class DataServicesDeserializer extends AbstractEdmDeserializer<AbstractDataServices> {
+public class DataServicesDeserializer extends AbstractEdmDeserializer<DataServicesImpl> {
 
   @Override
-  protected AbstractDataServices doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+  protected DataServicesImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
       throws IOException, JsonProcessingException {
 
     final DataServicesImpl dataServices = new DataServicesImpl();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesImpl.java
index a04385a..00460a7 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesImpl.java
@@ -1,18 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
@@ -21,13 +21,39 @@ package org.apache.olingo.client.core.edm.xml;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.olingo.client.api.edm.xml.DataServices;
 import org.apache.olingo.client.api.edm.xml.Schema;
 
-public class DataServicesImpl extends AbstractDataServices {
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = DataServicesDeserializer.class)
+public class DataServicesImpl extends AbstractEdmItem implements DataServices {
 
   private static final long serialVersionUID = 4200317286476885204L;
 
   private final List<Schema> schemas = new ArrayList<Schema>();
+  
+  private String dataServiceVersion;
+
+  private String maxDataServiceVersion;
+
+  @Override
+  public String getDataServiceVersion() {
+    return dataServiceVersion;
+  }
+
+  public void setDataServiceVersion(final String version) {
+    this.dataServiceVersion = version;
+  }
+
+  @Override
+  public String getMaxDataServiceVersion() {
+    return maxDataServiceVersion;
+  }
+
+  public void setMaxDataServiceVersion(final String version) {
+    this.maxDataServiceVersion = version;
+  }
 
   @Override
   public List<Schema> getSchemas() {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java
index 96943a4..854077f 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java
@@ -25,13 +25,13 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 
-public class EdmxDeserializer extends AbstractEdmDeserializer<AbstractEdmx> {
+public class EdmxDeserializer extends AbstractEdmDeserializer<EdmxImpl> {
 
   @Override
-  protected AbstractEdmx doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+  protected EdmxImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
       throws IOException, JsonProcessingException {
 
-    final AbstractEdmx edmx = new org.apache.olingo.client.core.edm.xml.EdmxImpl();
+    final EdmxImpl edmx = new EdmxImpl();
 
     for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
       final JsonToken token = jp.getCurrentToken();
@@ -40,15 +40,10 @@ public class EdmxDeserializer extends AbstractEdmDeserializer<AbstractEdmx> {
           edmx.setVersion(jp.nextTextValue());
         } else if ("DataServices".equals(jp.getCurrentName())) {
           jp.nextToken();
-
-          ((org.apache.olingo.client.core.edm.xml.EdmxImpl) edmx).
-              setDataServices(jp.readValueAs(
-                  org.apache.olingo.client.core.edm.xml.DataServicesImpl.class));
-
+          edmx.setDataServices(jp.readValueAs(DataServicesImpl.class));
         } else if ("Reference".equals(jp.getCurrentName())) {
           jp.nextToken();
-          ((org.apache.olingo.client.core.edm.xml.EdmxImpl) edmx).getReferences().
-              add(jp.readValueAs(ReferenceImpl.class));
+          edmx.getReferences().add(jp.readValueAs(ReferenceImpl.class));
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxImpl.java
index b1abbec..eaa658a 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxImpl.java
@@ -21,21 +21,42 @@ package org.apache.olingo.client.core.edm.xml;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.olingo.client.api.edm.xml.DataServices;
 import org.apache.olingo.client.api.edm.xml.Edmx;
 import org.apache.olingo.client.api.edm.xml.Reference;
 
-public class EdmxImpl extends AbstractEdmx implements Edmx {
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = EdmxDeserializer.class)
+public class EdmxImpl extends AbstractEdmItem implements Edmx {
 
   private static final long serialVersionUID = -6293476719276092572L;
 
   private final List<Reference> references = new ArrayList<Reference>();
 
+  private String version;
+
+  private DataServices dataServices;
+
   @Override
-  public DataServicesImpl getDataServices() {
-    return (DataServicesImpl) super.getDataServices();
+  public String getVersion() {
+    return version;
+  }
+
+  public void setVersion(final String version) {
+    this.version = version;
   }
 
   @Override
+  public DataServices getDataServices() {
+    return dataServices;
+  }
+
+  public void setDataServices(final DataServices dataServices) {
+    this.dataServices = dataServices;
+  }
+  
+  @Override
   public List<Reference> getReferences() {
     return references;
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java
index c8a647f..3a308e0 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java
@@ -27,13 +27,13 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 
-public class EntityContainerDeserializer extends AbstractEdmDeserializer<AbstractEntityContainer> {
+public class EntityContainerDeserializer extends AbstractEdmDeserializer<EntityContainerImpl> {
 
   @Override
-  protected AbstractEntityContainer doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+  protected EntityContainerImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
       throws IOException, JsonProcessingException {
 
-    final AbstractEntityContainer entityContainer = new org.apache.olingo.client.core.edm.xml.EntityContainerImpl();
+    final EntityContainerImpl entityContainer = new EntityContainerImpl();
 
     for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
       final JsonToken token = jp.getCurrentToken();
@@ -44,34 +44,21 @@ public class EntityContainerDeserializer extends AbstractEdmDeserializer<Abstrac
           entityContainer.setExtends(jp.nextTextValue());
         } else if ("LazyLoadingEnabled".equals(jp.getCurrentName())) {
           entityContainer.setLazyLoadingEnabled(BooleanUtils.toBoolean(jp.nextTextValue()));
-        } else if ("IsDefaultEntityContainer".equals(jp.getCurrentName())) {
-          entityContainer.setDefaultEntityContainer(BooleanUtils.toBoolean(jp.nextTextValue()));
         } else if ("EntitySet".equals(jp.getCurrentName())) {
           jp.nextToken();
-
-          ((org.apache.olingo.client.core.edm.xml.EntityContainerImpl) entityContainer).
-              getEntitySets().add(jp.readValueAs(
-                  org.apache.olingo.client.core.edm.xml.EntitySetImpl.class));
-
+          entityContainer.getEntitySets().add(jp.readValueAs(EntitySetImpl.class));
         } else if ("Singleton".equals(jp.getCurrentName())) {
           jp.nextToken();
-          ((org.apache.olingo.client.core.edm.xml.EntityContainerImpl) entityContainer).
-              getSingletons().add(jp.readValueAs(SingletonImpl.class));
+          entityContainer.getSingletons().add(jp.readValueAs(SingletonImpl.class));
         } else if ("ActionImport".equals(jp.getCurrentName())) {
           jp.nextToken();
-          ((org.apache.olingo.client.core.edm.xml.EntityContainerImpl) entityContainer).
-              getActionImports().add(jp.readValueAs(ActionImportImpl.class));
+          entityContainer.getActionImports().add(jp.readValueAs(ActionImportImpl.class));
         } else if ("FunctionImport".equals(jp.getCurrentName())) {
           jp.nextToken();
-
-          ((org.apache.olingo.client.core.edm.xml.EntityContainerImpl) entityContainer).
-              getFunctionImports().add(jp.readValueAs(
-                  org.apache.olingo.client.core.edm.xml.FunctionImportImpl.class));
-
+          entityContainer.getFunctionImports().add(jp.readValueAs(FunctionImportImpl.class));
         } else if ("Annotation".equals(jp.getCurrentName())) {
           jp.nextToken();
-          ((org.apache.olingo.client.core.edm.xml.EntityContainerImpl) entityContainer).getAnnotations().
-              add(jp.readValueAs(AnnotationImpl.class));
+          entityContainer.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerImpl.java
index 238f636..ac503e9 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerImpl.java
@@ -28,7 +28,10 @@ import org.apache.olingo.client.api.edm.xml.EntitySet;
 import org.apache.olingo.client.api.edm.xml.FunctionImport;
 import org.apache.olingo.client.api.edm.xml.Singleton;
 
-public class EntityContainerImpl extends AbstractEntityContainer implements EntityContainer {
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = EntityContainerDeserializer.class)
+public class EntityContainerImpl extends AbstractEdmItem implements EntityContainer {
 
   private static final long serialVersionUID = 5631432527646955795L;
 
@@ -42,19 +45,70 @@ public class EntityContainerImpl extends AbstractEntityContainer implements Enti
 
   private final List<Annotation> annotations = new ArrayList<Annotation>();
 
+  private String name;
+
+  private String _extends;
+
+  private boolean lazyLoadingEnabled;
+
   @Override
-  public void setDefaultEntityContainer(final boolean defaultEntityContainer) {
-    // no action: a single entity container MUST be available as per OData 4.0
+  public String getName() {
+    return name;
+  }
+
+  public void setName(final String name) {
+    this.name = name;
   }
 
   @Override
-  public boolean isDefaultEntityContainer() {
-    return true;
+  public String getExtends() {
+    return _extends;
+  }
+
+  public void setExtends(final String _extends) {
+    this._extends = _extends;
+  }
+
+  @Override
+  public boolean isLazyLoadingEnabled() {
+    return lazyLoadingEnabled;
+  }
+
+  public void setLazyLoadingEnabled(final boolean lazyLoadingEnabled) {
+    this.lazyLoadingEnabled = lazyLoadingEnabled;
   }
 
   @Override
   public EntitySet getEntitySet(final String name) {
-    return (EntitySet) super.getEntitySet(name);
+    return getOneByName(name, getEntitySets());
+  }
+  
+  /**
+   * Gets the first function import with given name.
+   *
+   * @param name name.
+   * @return function import.
+   */
+  @Override
+  public FunctionImport getFunctionImport(final String name) {
+    return getOneByName(name, getFunctionImports());
+  }
+
+  /**
+   * Gets all function imports with given name.
+   *
+   * @param name name.
+   * @return function imports.
+   */
+  @Override
+  public List<FunctionImport> getFunctionImports(final String name) {
+    return getAllByName(name, getFunctionImports());
+  }
+  
+  //TODO: No default container in V4 so we should delete this.
+  @Override
+  public boolean isDefaultEntityContainer() {
+    return true;
   }
 
   @Override
@@ -72,17 +126,6 @@ public class EntityContainerImpl extends AbstractEntityContainer implements Enti
     return getOneByName(name, getSingletons());
   }
 
-  @Override
-  public FunctionImport getFunctionImport(final String name) {
-    return (FunctionImport) super.getFunctionImport(name);
-  }
-
-  @Override
-  @SuppressWarnings("unchecked")
-  public List<FunctionImport> getFunctionImports(final String name) {
-    return (List<FunctionImport>) super.getFunctionImports(name);
-  }
-
   /**
    * Gets the first action import with given name.
    *

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java
index f4e8cc1..bae65b3 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java
@@ -1,18 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
@@ -21,19 +21,20 @@ package org.apache.olingo.client.core.edm.xml;
 import java.io.IOException;
 
 import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.client.api.edm.xml.EntitySet;
 
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 
-public class EntitySetDeserializer extends AbstractEdmDeserializer<AbstractEntitySet> {
+public class EntitySetDeserializer extends AbstractEdmDeserializer<EntitySet> {
 
   @Override
-  protected AbstractEntitySet doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
-          throws IOException, JsonProcessingException {
+  protected EntitySet doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+      throws IOException, JsonProcessingException {
 
-    final AbstractEntitySet entitySet = new org.apache.olingo.client.core.edm.xml.EntitySetImpl();
+    final EntitySetImpl entitySet = new EntitySetImpl();
 
     for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
       final JsonToken token = jp.getCurrentToken();
@@ -43,17 +44,13 @@ public class EntitySetDeserializer extends AbstractEdmDeserializer<AbstractEntit
         } else if ("EntityType".equals(jp.getCurrentName())) {
           entitySet.setEntityType(jp.nextTextValue());
         } else if ("IncludeInServiceDocument".equals(jp.getCurrentName())) {
-          ((org.apache.olingo.client.core.edm.xml.EntitySetImpl) entitySet).
-                  setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue()));
+          entitySet.setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue()));
         } else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
           jp.nextToken();
-          ((org.apache.olingo.client.core.edm.xml.EntitySetImpl) entitySet).
-                  getNavigationPropertyBindings().add(
-                          jp.readValueAs(NavigationPropertyBindingImpl.class));
+          entitySet.getNavigationPropertyBindings().add(jp.readValueAs(NavigationPropertyBindingImpl.class));
         } else if ("Annotation".equals(jp.getCurrentName())) {
           jp.nextToken();
-          ((org.apache.olingo.client.core.edm.xml.EntitySetImpl) entitySet).getAnnotations().
-                  add(jp.readValueAs(AnnotationImpl.class));
+          entitySet.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetImpl.java
index ec132dd..078af9b 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetImpl.java
@@ -25,7 +25,10 @@ import org.apache.olingo.client.api.edm.xml.Annotation;
 import org.apache.olingo.client.api.edm.xml.EntitySet;
 import org.apache.olingo.client.api.edm.xml.NavigationPropertyBinding;
 
-public class EntitySetImpl extends AbstractEntitySet implements EntitySet {
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = EntitySetDeserializer.class)
+public class EntitySetImpl extends AbstractEdmItem implements EntitySet {
 
   private static final long serialVersionUID = -5553885465204370676L;
 
@@ -35,6 +38,28 @@ public class EntitySetImpl extends AbstractEntitySet implements EntitySet {
 
   private final List<NavigationPropertyBinding> navigationPropertyBindings = new ArrayList<NavigationPropertyBinding>();
 
+  private String name;
+
+  private String entityType;
+
+  @Override
+  public String getName() {
+    return name;
+  }
+
+  public void setName(final String name) {
+    this.name = name;
+  }
+
+  @Override
+  public String getEntityType() {
+    return entityType;
+  }
+
+  public void setEntityType(final String entityType) {
+    this.entityType = entityType;
+  }
+  
   @Override
   public boolean isIncludeInServiceDocument() {
     return includeInServiceDocument;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java
index 79d82f0..c1639b3 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java
@@ -21,19 +21,20 @@ package org.apache.olingo.client.core.edm.xml;
 import java.io.IOException;
 
 import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.client.api.edm.xml.EntityType;
 
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 
-public class EntityTypeDeserializer extends AbstractEdmDeserializer<AbstractEntityType> {
+public class EntityTypeDeserializer extends AbstractEdmDeserializer<EntityType> {
 
   @Override
-  protected AbstractEntityType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+  protected EntityType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
       throws IOException, JsonProcessingException {
 
-    final AbstractEntityType entityType = new org.apache.olingo.client.core.edm.xml.EntityTypeImpl();
+    final EntityTypeImpl entityType = new EntityTypeImpl();
 
     for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
       final JsonToken token = jp.getCurrentToken();
@@ -53,17 +54,13 @@ public class EntityTypeDeserializer extends AbstractEdmDeserializer<AbstractEnti
           entityType.setKey(jp.readValueAs(EntityKeyImpl.class));
         } else if ("Property".equals(jp.getCurrentName())) {
           jp.nextToken();
-          ((org.apache.olingo.client.core.edm.xml.EntityTypeImpl) entityType).
-              getProperties().add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.PropertyImpl.class));
+          entityType.getProperties().add(jp.readValueAs(PropertyImpl.class));
         } else if ("NavigationProperty".equals(jp.getCurrentName())) {
           jp.nextToken();
-          ((org.apache.olingo.client.core.edm.xml.EntityTypeImpl) entityType).
-              getNavigationProperties().add(jp.readValueAs(
-                  org.apache.olingo.client.core.edm.xml.NavigationPropertyImpl.class));
+          entityType.getNavigationProperties().add(jp.readValueAs(NavigationPropertyImpl.class));
         } else if ("Annotation".equals(jp.getCurrentName())) {
           jp.nextToken();
-          ((org.apache.olingo.client.core.edm.xml.EntityTypeImpl) entityType).getAnnotations().
-              add(jp.readValueAs(AnnotationImpl.class));
+          entityType.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeImpl.java
index 2e0c7fa..0567506 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeImpl.java
@@ -22,11 +22,15 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.olingo.client.api.edm.xml.Annotation;
+import org.apache.olingo.client.api.edm.xml.EntityKey;
 import org.apache.olingo.client.api.edm.xml.EntityType;
 import org.apache.olingo.client.api.edm.xml.NavigationProperty;
 import org.apache.olingo.client.api.edm.xml.Property;
 
-public class EntityTypeImpl extends AbstractEntityType implements EntityType {
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = EntityTypeDeserializer.class)
+public class EntityTypeImpl extends AbstractStructuralType implements EntityType {
 
   private static final long serialVersionUID = -3986417775876689669L;
 
@@ -36,6 +40,61 @@ public class EntityTypeImpl extends AbstractEntityType implements EntityType {
 
   private final List<Annotation> annotations = new ArrayList<Annotation>();
 
+  private boolean abstractEntityType = false;
+
+  private String baseType;
+
+  private boolean openType = false;
+
+  private boolean hasStream = false;
+
+  private EntityKeyImpl key;
+
+  @Override
+  public boolean isAbstractType() {
+    return abstractEntityType;
+  }
+
+  public void setAbstractEntityType(final boolean abstractEntityType) {
+    this.abstractEntityType = abstractEntityType;
+  }
+
+  @Override
+  public String getBaseType() {
+    return baseType;
+  }
+
+  public void setBaseType(final String baseType) {
+    this.baseType = baseType;
+  }
+
+  @Override
+  public boolean isOpenType() {
+    return openType;
+  }
+
+  public void setOpenType(final boolean openType) {
+    this.openType = openType;
+  }
+
+  @Override
+  public EntityKeyImpl getKey() {
+    return key;
+  }
+
+  public void setKey(final EntityKey key) {
+    this.key = (EntityKeyImpl) key;
+  }
+
+  @Override
+  public boolean isHasStream() {
+    return hasStream;
+  }
+
+  public void setHasStream(final boolean hasStream) {
+    this.hasStream = hasStream;
+  }
+  
   @Override
   public Property getProperty(final String name) {
     return (Property) super.getProperty(name);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java
index 8b70c13..8559813 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java
@@ -1,18 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
@@ -27,13 +27,13 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 
-public class EnumTypeDeserializer extends AbstractEdmDeserializer<AbstractEnumType> {
+public class EnumTypeDeserializer extends AbstractEdmDeserializer<EnumTypeImpl> {
 
   @Override
-  protected AbstractEnumType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
-          throws IOException, JsonProcessingException {
+  protected EnumTypeImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+      throws IOException, JsonProcessingException {
 
-    final AbstractEnumType enumType = new org.apache.olingo.client.core.edm.xml.EnumTypeImpl();
+    final EnumTypeImpl enumType = new EnumTypeImpl();
 
     for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
       final JsonToken token = jp.getCurrentToken();
@@ -46,13 +46,10 @@ public class EnumTypeDeserializer extends AbstractEdmDeserializer<AbstractEnumTy
           enumType.setFlags(BooleanUtils.toBoolean(jp.nextTextValue()));
         } else if ("Member".equals(jp.getCurrentName())) {
           jp.nextToken();
-            ((org.apache.olingo.client.core.edm.xml.EnumTypeImpl) enumType).
-                    getMembers().add(jp.readValueAs(
-                                    org.apache.olingo.client.core.edm.xml.MemberImpl.class));
+          enumType.getMembers().add(jp.readValueAs(MemberImpl.class));
         } else if ("Annotation".equals(jp.getCurrentName())) {
           jp.nextToken();
-          ((org.apache.olingo.client.core.edm.xml.EnumTypeImpl) enumType).getAnnotations().
-                  add(jp.readValueAs(AnnotationImpl.class));
+          enumType.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeImpl.java
index 68e0fb6..ea9783a 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeImpl.java
@@ -23,13 +23,80 @@ import java.util.List;
 
 import org.apache.olingo.client.api.edm.xml.Annotatable;
 import org.apache.olingo.client.api.edm.xml.Annotation;
+import org.apache.olingo.client.api.edm.xml.EnumType;
+import org.apache.olingo.client.api.edm.xml.Member;
 
-public class EnumTypeImpl extends AbstractEnumType implements Annotatable {
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = EnumTypeDeserializer.class)
+public class EnumTypeImpl extends AbstractEdmItem implements EnumType, Annotatable {
 
   private static final long serialVersionUID = 9191189755592743333L;
 
   private final List<Annotation> annotations = new ArrayList<Annotation>();
 
+  private String name;
+
+  private String underlyingType;
+
+  private boolean flags;
+
+  private final List<Member> members = new ArrayList<Member>();
+
+  @Override
+  public String getName() {
+    return name;
+  }
+
+  public void setName(final String name) {
+    this.name = name;
+  }
+
+  @Override
+  public String getUnderlyingType() {
+    return underlyingType;
+  }
+
+  public void setUnderlyingType(final String underlyingType) {
+    this.underlyingType = underlyingType;
+  }
+
+  @Override
+  public boolean isFlags() {
+    return flags;
+  }
+
+  public void setFlags(final boolean flags) {
+    this.flags = flags;
+  }
+
+  @Override
+  public Member getMember(final String name) {
+    Member result = null;
+    for (Member member : getMembers()) {
+      if (name.equals(member.getName())) {
+        result = member;
+      }
+    }
+    return result;
+  }
+
+  @Override
+  public Member getMember(final Integer value) {
+    Member result = null;
+    for (Member member : getMembers()) {
+      if (value.equals(member.getValue())) {
+        result = member;
+      }
+    }
+    return result;
+  }
+
+  @Override
+  public List<Member> getMembers() {
+    return members;
+  }
+  
   @Override
   public List<Annotation> getAnnotations() {
     return annotations;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/MemberImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/MemberImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/MemberImpl.java
index bc48e9f..2221804 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/MemberImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/MemberImpl.java
@@ -1,18 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
@@ -23,13 +23,40 @@ import java.util.List;
 
 import org.apache.olingo.client.api.edm.xml.Annotatable;
 import org.apache.olingo.client.api.edm.xml.Annotation;
+import org.apache.olingo.client.api.edm.xml.Member;
 
-public class MemberImpl extends AbstractMember implements Annotatable {
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class MemberImpl extends AbstractEdmItem implements Member, Annotatable {
 
   private static final long serialVersionUID = -6138606817225829791L;
 
   private final List<Annotation> annotations = new ArrayList<Annotation>();
 
+  @JsonProperty(value = "Name", required = true)
+  private String name;
+
+  @JsonProperty("Value")
+  private String value;
+
+  @Override
+  public String getName() {
+    return name;
+  }
+
+  public void setName(final String name) {
+    this.name = name;
+  }
+
+  @Override
+  public String getValue() {
+    return value;
+  }
+
+  public void setValue(final String value) {
+    this.value = value;
+  }
+
   @Override
   public List<Annotation> getAnnotations() {
     return annotations;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyImpl.java
index deb20e5..75b366e 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/NavigationPropertyImpl.java
@@ -26,13 +26,20 @@ import org.apache.olingo.client.api.edm.xml.NavigationProperty;
 import org.apache.olingo.client.api.edm.xml.OnDelete;
 import org.apache.olingo.client.api.edm.xml.ReferentialConstraint;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = NavigationPropertyDeserializer.class)
-public class NavigationPropertyImpl extends AbstractNavigationProperty implements NavigationProperty {
+public class NavigationPropertyImpl extends AbstractEdmItem implements NavigationProperty {
 
-  private static final long serialVersionUID = 4503112988794432940L;
+  private static final long serialVersionUID = 6240231735592427582L;
 
+  @JsonProperty(value = "Name", required = true)
+  private String name;
+  
+  @JsonProperty(value = "ContainsTarget")
+  private boolean containsTarget = false;
+  
   private String type;
 
   private boolean nullable = true;
@@ -91,4 +98,22 @@ public class NavigationPropertyImpl extends AbstractNavigationProperty implement
     return annotations;
   }
 
+  @Override
+  public String getName() {
+    return name;
+  }
+
+  public void setName(final String name) {
+    this.name = name;
+  }
+
+  @Override
+  public boolean isContainsTarget() {
+    return containsTarget;
+  }
+
+  public void setContainsTarget(final boolean containsTarget) {
+    this.containsTarget = containsTarget;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterDeserializer.java
index 16353f5..d0430d9 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterDeserializer.java
@@ -1,18 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
@@ -28,13 +28,13 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 
-public class ParameterDeserializer extends AbstractEdmDeserializer<AbstractParameter> {
+public class ParameterDeserializer extends AbstractEdmDeserializer<ParameterImpl> {
 
   @Override
-  protected AbstractParameter doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
-          throws IOException, JsonProcessingException {
+  protected ParameterImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+      throws IOException, JsonProcessingException {
 
-    final AbstractParameter parameter = new org.apache.olingo.client.core.edm.xml.ParameterImpl();
+    final ParameterImpl parameter = new ParameterImpl();
 
     for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
       final JsonToken token = jp.getCurrentToken();
@@ -56,12 +56,11 @@ public class ParameterDeserializer extends AbstractEdmDeserializer<AbstractParam
         } else if ("SRID".equals(jp.getCurrentName())) {
           final String srid = jp.nextTextValue();
           if (srid != null) {
-            ((org.apache.olingo.client.core.edm.xml.ParameterImpl) parameter).setSrid(SRID.valueOf(srid));
+            parameter.setSrid(SRID.valueOf(srid));
           }
         } else if ("Annotation".equals(jp.getCurrentName())) {
           jp.nextToken();
-          ((org.apache.olingo.client.core.edm.xml.ParameterImpl) parameter).getAnnotations().
-                  add(jp.readValueAs(AnnotationImpl.class));
+          parameter.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterImpl.java
index ec2a08e..4fc1a20 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterImpl.java
@@ -1,18 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
@@ -25,7 +25,10 @@ import org.apache.olingo.client.api.edm.xml.Annotation;
 import org.apache.olingo.client.api.edm.xml.Parameter;
 import org.apache.olingo.commons.api.edm.geo.SRID;
 
-public class ParameterImpl extends AbstractParameter implements Parameter {
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = ParameterDeserializer.class)
+public class ParameterImpl extends AbstractEdmItem implements Parameter {
 
   private static final long serialVersionUID = 7119478691341167904L;
 
@@ -33,6 +36,72 @@ public class ParameterImpl extends AbstractParameter implements Parameter {
 
   private final List<Annotation> annotations = new ArrayList<Annotation>();
 
+  private String name;
+
+  private String type;
+
+  private boolean nullable = true;
+
+  private Integer maxLength;
+
+  private Integer precision;
+
+  private Integer scale;
+
+  @Override
+  public String getName() {
+    return name;
+  }
+
+  public void setName(final String name) {
+    this.name = name;
+  }
+
+  @Override
+  public String getType() {
+    return type;
+  }
+
+  public void setType(final String type) {
+    this.type = type;
+  }
+
+  @Override
+  public boolean isNullable() {
+    return nullable;
+  }
+
+  public void setNullable(final boolean nullable) {
+    this.nullable = nullable;
+  }
+
+  @Override
+  public Integer getMaxLength() {
+    return maxLength;
+  }
+
+  public void setMaxLength(final Integer maxLength) {
+    this.maxLength = maxLength;
+  }
+
+  @Override
+  public Integer getPrecision() {
+    return precision;
+  }
+
+  public void setPrecision(final Integer precision) {
+    this.precision = precision;
+  }
+
+  @Override
+  public Integer getScale() {
+    return scale;
+  }
+
+  public void setScale(final Integer scale) {
+    this.scale = scale;
+  }
+
   @Override
   public SRID getSrid() {
     return srid;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyDeserializer.java
index 02c3c3e..283b35c 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyDeserializer.java
@@ -28,13 +28,13 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 
-public class PropertyDeserializer extends AbstractEdmDeserializer<AbstractProperty> {
+public class PropertyDeserializer extends AbstractEdmDeserializer<PropertyImpl> {
 
   @Override
-  protected AbstractProperty doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+  protected PropertyImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
       throws IOException, JsonProcessingException {
 
-    final AbstractProperty property = new org.apache.olingo.client.core.edm.xml.PropertyImpl();
+    final PropertyImpl property = new org.apache.olingo.client.core.edm.xml.PropertyImpl();
 
     for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
       final JsonToken token = jp.getCurrentToken();
@@ -64,8 +64,7 @@ public class PropertyDeserializer extends AbstractEdmDeserializer<AbstractProper
           }
         } else if ("Annotation".equals(jp.getCurrentName())) {
           jp.nextToken();
-          ((org.apache.olingo.client.core.edm.xml.PropertyImpl) property).getAnnotations().
-              add(jp.readValueAs(AnnotationImpl.class));
+          property.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyImpl.java
index 1cbdfb1..17a6b7c 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyImpl.java
@@ -23,13 +23,116 @@ import java.util.List;
 
 import org.apache.olingo.client.api.edm.xml.Annotation;
 import org.apache.olingo.client.api.edm.xml.Property;
+import org.apache.olingo.commons.api.edm.geo.SRID;
 
-public class PropertyImpl extends AbstractProperty implements Property {
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = PropertyDeserializer.class)
+public class PropertyImpl extends AbstractEdmItem implements Property {
 
   private static final long serialVersionUID = 4544336801968719526L;
 
   private final List<Annotation> annotations = new ArrayList<Annotation>();
 
+  private String name;
+
+  private String type;
+
+  private boolean nullable = true;
+
+  private String defaultValue;
+
+  private Integer maxLength;
+
+  private Integer precision;
+
+  private Integer scale;
+
+  private boolean unicode = true;
+
+  private SRID srid;
+
+  @Override
+  public String getName() {
+    return name;
+  }
+
+  public void setName(final String name) {
+    this.name = name;
+  }
+
+  @Override
+  public String getType() {
+    return type;
+  }
+
+  public void setType(final String type) {
+    this.type = type;
+  }
+
+  @Override
+  public boolean isNullable() {
+    return nullable;
+  }
+
+  public void setNullable(final boolean nullable) {
+    this.nullable = nullable;
+  }
+
+  @Override
+  public String getDefaultValue() {
+    return defaultValue;
+  }
+
+  public void setDefaultValue(final String defaultValue) {
+    this.defaultValue = defaultValue;
+  }
+
+  @Override
+  public Integer getMaxLength() {
+    return maxLength;
+  }
+
+  public void setMaxLength(final Integer maxLength) {
+    this.maxLength = maxLength;
+  }
+
+  @Override
+  public Integer getPrecision() {
+    return precision;
+  }
+
+  public void setPrecision(final Integer precision) {
+    this.precision = precision;
+  }
+
+  @Override
+  public Integer getScale() {
+    return scale;
+  }
+
+  public void setScale(final Integer scale) {
+    this.scale = scale;
+  }
+
+  @Override
+  public boolean isUnicode() {
+    return unicode;
+  }
+
+  public void setUnicode(final boolean unicode) {
+    this.unicode = unicode;
+  }
+
+  @Override
+  public SRID getSrid() {
+    return srid;
+  }
+
+  public void setSrid(final SRID srid) {
+    this.srid = srid;
+  }
+  
   @Override
   public List<Annotation> getAnnotations() {
     return annotations;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceImpl.java
index f9efbf9..ab7a4d8 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferenceImpl.java
@@ -22,6 +22,7 @@ import java.net.URI;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.olingo.client.api.edm.xml.Annotation;
 import org.apache.olingo.client.api.edm.xml.Include;
 import org.apache.olingo.client.api.edm.xml.IncludeAnnotations;
 import org.apache.olingo.client.api.edm.xml.Reference;
@@ -29,7 +30,7 @@ import org.apache.olingo.client.api.edm.xml.Reference;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = ReferenceDeserializer.class)
-public class ReferenceImpl extends AbstractAnnotatable implements Reference {
+public class ReferenceImpl extends AbstractEdmItem implements Reference {
 
   private static final long serialVersionUID = 7720274712545267654L;
 
@@ -39,6 +40,13 @@ public class ReferenceImpl extends AbstractAnnotatable implements Reference {
 
   private final List<IncludeAnnotations> includeAnnotations = new ArrayList<IncludeAnnotations>();
 
+  private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+  @Override
+  public List<Annotation> getAnnotations() {
+    return annotations;
+  }
+  
   @Override
   public URI getUri() {
     return uri;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferentialConstraintImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferentialConstraintImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferentialConstraintImpl.java
index 61b2642..fd34fce 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferentialConstraintImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ReferentialConstraintImpl.java
@@ -18,11 +18,15 @@
  */
 package org.apache.olingo.client.core.edm.xml;
 
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.client.api.edm.xml.Annotation;
 import org.apache.olingo.client.api.edm.xml.ReferentialConstraint;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 
-public class ReferentialConstraintImpl extends AbstractAnnotatable implements ReferentialConstraint {
+public class ReferentialConstraintImpl extends AbstractEdmItem implements ReferentialConstraint {
 
   private static final long serialVersionUID = -5822115908069878139L;
 
@@ -32,6 +36,13 @@ public class ReferentialConstraintImpl extends AbstractAnnotatable implements Re
   @JsonProperty(value = "ReferencedProperty", required = true)
   private String referencedProperty;
 
+  private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+  @Override
+  public List<Annotation> getAnnotations() {
+    return annotations;
+  }
+  
   @Override
   public String getProperty() {
     return property;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaDeserializer.java
index 0b042ad..ea7718a 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaDeserializer.java
@@ -25,13 +25,13 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.DeserializationContext;
 
-public class SchemaDeserializer extends AbstractEdmDeserializer<AbstractSchema> {
+public class SchemaDeserializer extends AbstractEdmDeserializer<SchemaImpl> {
 
   @Override
-  protected AbstractSchema doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+  protected SchemaImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
       throws IOException, JsonProcessingException {
 
-    final AbstractSchema schema = new org.apache.olingo.client.core.edm.xml.SchemaImpl();
+    final SchemaImpl schema = new SchemaImpl();
 
     for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
       final JsonToken token = jp.getCurrentToken();
@@ -42,62 +42,36 @@ public class SchemaDeserializer extends AbstractEdmDeserializer<AbstractSchema>
           schema.setAlias(jp.nextTextValue());
         } else if ("ComplexType".equals(jp.getCurrentName())) {
           jp.nextToken();
-
-          ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).
-              getComplexTypes().add(jp.readValueAs(
-                  org.apache.olingo.client.core.edm.xml.ComplexTypeImpl.class));
-
+          schema.getComplexTypes().add(jp.readValueAs(ComplexTypeImpl.class));
         } else if ("EntityType".equals(jp.getCurrentName())) {
           jp.nextToken();
-
-          ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).
-              getEntityTypes().add(jp.readValueAs(
-                  org.apache.olingo.client.core.edm.xml.EntityTypeImpl.class));
-
+          schema.getEntityTypes().add(jp.readValueAs(EntityTypeImpl.class));
         } else if ("EnumType".equals(jp.getCurrentName())) {
           jp.nextToken();
-
-          ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).
-              getEnumTypes().add(jp.readValueAs(
-                  org.apache.olingo.client.core.edm.xml.EnumTypeImpl.class));
-
+          schema.getEnumTypes().add(jp.readValueAs(EnumTypeImpl.class));
         } else if ("EntityContainer".equals(jp.getCurrentName())) {
           jp.nextToken();
-
-          org.apache.olingo.client.core.edm.xml.EntityContainerImpl entityContainer =
-              jp.readValueAs(
-                  org.apache.olingo.client.core.edm.xml.EntityContainerImpl.class);
-          entityContainer.setDefaultEntityContainer(true);
-          ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).
-              setEntityContainer(entityContainer);
-
+          EntityContainerImpl entityContainer = jp.readValueAs(EntityContainerImpl.class);
+          schema.setEntityContainer(entityContainer);
         } else if ("Action".equals(jp.getCurrentName())) {
           jp.nextToken();
-          ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).getActions().
-              add(jp.readValueAs(ActionImpl.class));
+          schema.getActions().add(jp.readValueAs(ActionImpl.class));
         } else if ("Function".equals(jp.getCurrentName())) {
           jp.nextToken();
-          ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).getFunctions().
-              add(jp.readValueAs(FunctionImpl.class));
+          schema.getFunctions().add(jp.readValueAs(FunctionImpl.class));
         } else if ("TypeDefinition".equals(jp.getCurrentName())) {
           jp.nextToken();
-          ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).
-              getTypeDefinitions().add(jp.readValueAs(TypeDefinitionImpl.class));
+          schema.getTypeDefinitions().add(jp.readValueAs(TypeDefinitionImpl.class));
         }
       } else if ("Annotations".equals(jp.getCurrentName())) {
         jp.nextToken();
-
-        ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).getAnnotationGroups().
-            add(jp.readValueAs(org.apache.olingo.client.core.edm.xml.AnnotationsImpl.class));
-
+        schema.getAnnotationGroups().add(jp.readValueAs(AnnotationsImpl.class));
       } else if ("Annotation".equals(jp.getCurrentName())) {
         jp.nextToken();
-        ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).getAnnotations().
-            add(jp.readValueAs(AnnotationImpl.class));
+        schema.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
       } else if ("Term".equals(jp.getCurrentName())) {
         jp.nextToken();
-        ((org.apache.olingo.client.core.edm.xml.SchemaImpl) schema).getTerms().
-            add(jp.readValueAs(TermImpl.class));
+        schema.getTerms().add(jp.readValueAs(TermImpl.class));
       }
     }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaImpl.java
index f44e558..77b7412 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaImpl.java
@@ -41,7 +41,10 @@ import org.apache.olingo.client.api.edm.xml.Singleton;
 import org.apache.olingo.client.api.edm.xml.Term;
 import org.apache.olingo.client.api.edm.xml.TypeDefinition;
 
-public class SchemaImpl extends AbstractSchema implements Schema {
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = SchemaDeserializer.class)
+public class SchemaImpl extends AbstractEdmItem implements Schema {
 
   private static final long serialVersionUID = 1911087363912024939L;
 
@@ -67,6 +70,43 @@ public class SchemaImpl extends AbstractSchema implements Schema {
 
   private Map<String, Annotatable> annotatables;
 
+  private String namespace;
+
+  private String alias;
+
+  @Override
+  public String getNamespace() {
+    return namespace;
+  }
+
+  public void setNamespace(final String namespace) {
+    this.namespace = namespace;
+  }
+
+  @Override
+  public String getAlias() {
+    return alias;
+  }
+
+  public void setAlias(final String alias) {
+    this.alias = alias;
+  }
+
+  @Override
+  public EnumType getEnumType(final String name) {
+    return getOneByName(name, getEnumTypes());
+  }
+
+  @Override
+  public ComplexType getComplexType(final String name) {
+    return getOneByName(name, getComplexTypes());
+  }
+
+  @Override
+  public EntityType getEntityType(final String name) {
+    return getOneByName(name, getEntityTypes());
+  }
+  
   @Override
   public List<Action> getActions() {
     return actions;
@@ -173,21 +213,11 @@ public class SchemaImpl extends AbstractSchema implements Schema {
   }
 
   @Override
-  public ComplexType getComplexType(final String name) {
-    return (ComplexType) super.getComplexType(name);
-  }
-
-  @Override
   public List<ComplexType> getComplexTypes() {
     return complexTypes;
   }
 
   @Override
-  public EntityType getEntityType(final String name) {
-    return (EntityType) super.getEntityType(name);
-  }
-
-  @Override
   public List<EntityType> getEntityTypes() {
     return entityTypes;
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonImpl.java
index ea26cf5..216e735 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SingletonImpl.java
@@ -21,13 +21,14 @@ package org.apache.olingo.client.core.edm.xml;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.olingo.client.api.edm.xml.Annotation;
 import org.apache.olingo.client.api.edm.xml.NavigationPropertyBinding;
 import org.apache.olingo.client.api.edm.xml.Singleton;
 
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = SingletonDeserializer.class)
-public class SingletonImpl extends AbstractAnnotatable implements Singleton {
+public class SingletonImpl extends AbstractEdmItem implements Singleton {
 
   private static final long serialVersionUID = 1656749615107151921L;
 
@@ -37,6 +38,13 @@ public class SingletonImpl extends AbstractAnnotatable implements Singleton {
 
   private final List<NavigationPropertyBinding> navigationPropertyBindings = new ArrayList<NavigationPropertyBinding>();
 
+  private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+  @Override
+  public List<Annotation> getAnnotations() {
+    return annotations;
+  }
+  
   @Override
   public String getName() {
     return name;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermImpl.java
index a9212aa..7e7b740 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/TermImpl.java
@@ -21,13 +21,14 @@ package org.apache.olingo.client.core.edm.xml;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.olingo.client.api.edm.xml.Annotation;
 import org.apache.olingo.client.api.edm.xml.Term;
 import org.apache.olingo.commons.api.edm.geo.SRID;
 
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
 @JsonDeserialize(using = TermDeserializer.class)
-public class TermImpl extends AbstractAnnotatable implements Term {
+public class TermImpl extends AbstractEdmItem implements Term {
 
   private static final long serialVersionUID = -8350072064720586186L;
 
@@ -51,6 +52,13 @@ public class TermImpl extends AbstractAnnotatable implements Term {
 
   private final List<String> appliesTo = new ArrayList<String>();
 
+  private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+  @Override
+  public List<Annotation> getAnnotations() {
+    return annotations;
+  }
+  
   @Override
   public String getName() {
     return name;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/XMLMetadataImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/XMLMetadataImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/XMLMetadataImpl.java
index 35de525..df633f5 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/XMLMetadataImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/XMLMetadataImpl.java
@@ -1,52 +1,70 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
 package org.apache.olingo.client.core.edm.xml;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.olingo.client.api.edm.xml.Edmx;
 import org.apache.olingo.client.api.edm.xml.Reference;
 import org.apache.olingo.client.api.edm.xml.Schema;
 import org.apache.olingo.client.api.edm.xml.XMLMetadata;
 
-public class XMLMetadataImpl extends AbstractXMLMetadata implements XMLMetadata {
+/**
+ * Entry point for access information about EDM metadata.
+ */
+public class XMLMetadataImpl extends AbstractEdmItem implements XMLMetadata {
 
   private static final long serialVersionUID = 6025723060298454901L;
+  protected final Edmx edmx;
 
-  public XMLMetadataImpl(final EdmxImpl edmx) {
-    super(edmx);
+  public XMLMetadataImpl(final Edmx edmx) {
+    this.edmx = edmx;
   }
 
   @Override
-  @SuppressWarnings("unchecked")
   public List<Schema> getSchemas() {
-    return (List<Schema>) super.getSchemas();
+    return this.edmx.getDataServices().getSchemas();
   }
 
   @Override
   public Schema getSchema(final int index) {
-    return (Schema) super.getSchema(index);
+    return getSchemas().get(index);
   }
 
   @Override
   public Schema getSchema(final String key) {
-    return (Schema) super.getSchema(key);
+    return getSchemaByNsOrAlias().get(key);
+  }
+
+  @Override
+  public Map<String, Schema> getSchemaByNsOrAlias() {
+    final Map<String, Schema> schemaByNsOrAlias = new HashMap<String, Schema>();
+    for (Schema schema : getSchemas()) {
+      schemaByNsOrAlias.put(schema.getNamespace(), schema);
+      if (StringUtils.isNotBlank(schema.getAlias())) {
+        schemaByNsOrAlias.put(schema.getAlias(), schema);
+      }
+    }
+    return schemaByNsOrAlias;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AbstractODataBinder.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AbstractODataBinder.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AbstractODataBinder.java
index 3a0024e..cc4594d 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AbstractODataBinder.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/AbstractODataBinder.java
@@ -42,17 +42,17 @@ import org.apache.olingo.commons.api.data.LinkedComplexValue;
 import org.apache.olingo.commons.api.data.Property;
 import org.apache.olingo.commons.api.data.ResWrap;
 import org.apache.olingo.commons.api.data.Valuable;
-import org.apache.olingo.commons.api.domain.ODataEntity;
-import org.apache.olingo.commons.api.domain.ODataEntitySet;
-import org.apache.olingo.commons.api.domain.ODataProperty;
 import org.apache.olingo.commons.api.domain.ODataCollectionValue;
 import org.apache.olingo.commons.api.domain.ODataComplexValue;
+import org.apache.olingo.commons.api.domain.ODataEntity;
+import org.apache.olingo.commons.api.domain.ODataEntitySet;
 import org.apache.olingo.commons.api.domain.ODataInlineEntity;
 import org.apache.olingo.commons.api.domain.ODataInlineEntitySet;
 import org.apache.olingo.commons.api.domain.ODataLink;
 import org.apache.olingo.commons.api.domain.ODataLinkType;
 import org.apache.olingo.commons.api.domain.ODataLinked;
 import org.apache.olingo.commons.api.domain.ODataOperation;
+import org.apache.olingo.commons.api.domain.ODataProperty;
 import org.apache.olingo.commons.api.domain.ODataServiceDocument;
 import org.apache.olingo.commons.api.domain.ODataValue;
 import org.apache.olingo.commons.api.edm.Edm;
@@ -598,7 +598,6 @@ public abstract class AbstractODataBinder implements CommonODataBinder {
                       : EdmPrimitiveTypeKind.valueOfFQN(client.getServiceVersion(), type.toString())).
               build();
     } else if (valuable.isComplex()) {
-      @SuppressWarnings("unchecked")
       final ODataComplexValue<ODataProperty> cValue =
               (ODataComplexValue<ODataProperty>) client.getObjectFactory().
               newComplexValue(type == null ? null : type.toString());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d088866e/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataComplexValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataComplexValueImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataComplexValueImpl.java
index 9c96ace..553ed79 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataComplexValueImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataComplexValueImpl.java
@@ -179,7 +179,6 @@ public class ODataComplexValueImpl extends AbstractODataValue implements ODataCo
    * @param field field to be added.
    */
   @Override
-  @SuppressWarnings("unchecked")
   public ODataComplexValue<ODataProperty> add(final ODataProperty field) {
     fields.put(field.getName(), field);
     return getThis();


Mime
View raw message