You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by il...@apache.org on 2014/03/29 16:58:51 UTC

[4/9] [OLINGO-200] Introducing specialization for V3 and V4 domain objects

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntityRetrieveTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntityRetrieveTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntityRetrieveTestITCase.java
index 6d2a89d..7806fd0 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntityRetrieveTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntityRetrieveTestITCase.java
@@ -19,11 +19,6 @@
 package org.apache.olingo.client.core.it.v4;
 
 import java.net.URI;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
 import java.util.LinkedHashMap;
 import java.util.List;
 import org.apache.commons.lang3.StringUtils;
@@ -31,17 +26,24 @@ import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRe
 import org.apache.olingo.client.api.communication.request.retrieve.ODataRawRequest;
 import org.apache.olingo.client.api.communication.response.ODataRawResponse;
 import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
-import org.apache.olingo.commons.api.domain.ODataEntity;
-import org.apache.olingo.commons.api.domain.ODataEntitySet;
+import org.apache.olingo.client.api.uri.CommonURIBuilder;
+import static org.apache.olingo.client.core.it.v4.AbstractTestITCase.client;
+import org.apache.olingo.commons.api.domain.CommonODataEntity;
+import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
+import org.apache.olingo.commons.api.domain.CommonODataProperty;
 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.ODataProperty;
+import org.apache.olingo.commons.api.domain.v4.ODataEntity;
+import org.apache.olingo.commons.api.domain.v4.ODataEntitySet;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
-import org.apache.olingo.client.api.uri.CommonURIBuilder;
-import static org.apache.olingo.client.core.it.v4.AbstractTestITCase.client;
 import org.apache.olingo.commons.core.op.ResourceFactory;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -58,11 +60,12 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
     final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(getServiceRoot()).
             appendEntitySetSegment("Customers").appendKeySegment(1).expand("Company");
 
-    final ODataEntityRequest req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
+    final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().
+            getEntityRequest(uriBuilder.build());
     req.setFormat(format);
 
     final ODataRetrieveResponse<ODataEntity> res = req.execute();
-    final ODataEntity entity = res.getBody();
+    final CommonODataEntity entity = res.getBody();
 
     assertNotNull(entity);
     assertEquals("#Microsoft.Test.OData.Services.ODataWCFService.Customer", entity.getName());
@@ -75,13 +78,13 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
 
     for (ODataLink link : entity.getNavigationLinks()) {
       if (link instanceof ODataInlineEntity) {
-        final ODataEntity inline = ((ODataInlineEntity) link).getEntity();
+        final CommonODataEntity inline = ((ODataInlineEntity) link).getEntity();
         assertNotNull(inline);
 
         debugEntry(client.getBinder().getEntry(
                 inline, ResourceFactory.entryClassForFormat(format == ODataPubFormat.ATOM)), "Just read");
 
-        final List<ODataProperty> properties = inline.getProperties();
+        final List<? extends CommonODataProperty> properties = inline.getProperties();
         assertEquals(5, properties.size());
 
         assertTrue(properties.get(0).getName().equals("CompanyID")
@@ -118,18 +121,19 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
     final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(getServiceRoot()).
             appendEntitySetSegment("Customers").appendKeySegment(1).expand("Orders");
 
-    final ODataEntityRequest req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
+    final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().
+            getEntityRequest(uriBuilder.build());
     req.setFormat(format);
 
     final ODataRetrieveResponse<ODataEntity> res = req.execute();
-    final ODataEntity entity = res.getBody();
+    final CommonODataEntity entity = res.getBody();
     assertNotNull(entity);
 
     boolean found = false;
 
     for (ODataLink link : entity.getNavigationLinks()) {
       if (link instanceof ODataInlineEntitySet) {
-        final ODataEntitySet inline = ((ODataInlineEntitySet) link).getEntitySet();
+        final CommonODataEntitySet inline = ((ODataInlineEntitySet) link).getEntitySet();
         assertNotNull(inline);
 
         debugFeed(client.getBinder().getFeed(inline, ResourceFactory.feedClassForFormat(
@@ -191,11 +195,11 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
     final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(getServiceRoot()).
             appendEntitySetSegment("ProductDetails").appendKeySegment(multiKey);
 
-    final ODataEntityRequest req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
+    final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
     req.setFormat(format);
 
     final ODataRetrieveResponse<ODataEntity> res = req.execute();
-    final ODataEntity entity = res.getBody();
+    final CommonODataEntity entity = res.getBody();
     assertNotNull(entity);
     assertEquals(Integer.valueOf(1),
             entity.getProperty("ProductDetailID").getPrimitiveValue().toCastValue(Integer.class));
@@ -227,7 +231,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
     final CommonURIBuilder<?> uriBuilder =
             client.getURIBuilder(getServiceRoot()).appendEntitySetSegment("Orders").appendKeySegment(8);
 
-    final ODataEntityRequest req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
+    final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
     req.setFormat(format);
 
     final ODataRetrieveResponse<ODataEntity> res = req.execute();
@@ -236,7 +240,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
     final String etag = res.getEtag();
     assertTrue(StringUtils.isNotBlank(etag));
 
-    final ODataEntity order = res.getBody();
+    final CommonODataEntity order = res.getBody();
     assertEquals(etag, order.getETag());
   }
 
@@ -245,7 +249,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
   public void issue99() {
     final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(getServiceRoot()).appendEntitySetSegment("Car");
 
-    final ODataEntityRequest req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
+    final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
     req.setFormat(ODataPubFormat.JSON);
 
     // this statement should cause an IllegalArgumentException bearing JsonParseException
@@ -269,7 +273,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
             appendEntitySetSegment("Orders").appendKeySegment(8).appendNavigationSegment("CustomerForOrder").
             appendRefSegment();
 
-    ODataEntityRequest req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
+    ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(uriBuilder.build());
     req.setFormat(format);
 
     ODataRetrieveResponse<ODataEntity> res = req.execute();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntitySetTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntitySetTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntitySetTestITCase.java
index 2d78a6d..a73ce7a 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntitySetTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/EntitySetTestITCase.java
@@ -18,10 +18,6 @@
  */
 package org.apache.olingo.client.core.it.v4;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 import java.io.IOException;
 import java.net.URI;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataEntitySetIteratorRequest;
@@ -32,9 +28,14 @@ import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse
 import org.apache.olingo.client.api.domain.ODataEntitySetIterator;
 import org.apache.olingo.client.api.uri.CommonURIBuilder;
 import org.apache.olingo.client.core.uri.URIUtils;
-import org.apache.olingo.commons.api.domain.ODataEntitySet;
+import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
+import org.apache.olingo.commons.api.domain.v4.ODataEntitySet;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
 import org.apache.olingo.commons.core.op.ResourceFactory;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -96,11 +97,12 @@ public class EntitySetTestITCase extends AbstractTestITCase {
     final CommonURIBuilder<?> uriBuilder = client.getURIBuilder(getServiceRoot());
     uriBuilder.appendEntitySetSegment("People");
 
-    final ODataEntitySetRequest req = client.getRetrieveRequestFactory().getEntitySetRequest(uriBuilder.build());
+    final ODataEntitySetRequest<ODataEntitySet> req = client.getRetrieveRequestFactory().
+            getEntitySetRequest(uriBuilder.build());
     req.setFormat(format);
 
     final ODataRetrieveResponse<ODataEntitySet> res = req.execute();
-    final ODataEntitySet feed = res.getBody();
+    final CommonODataEntitySet feed = res.getBody();
 
     assertNotNull(feed);
 
@@ -151,7 +153,7 @@ public class EntitySetTestITCase extends AbstractTestITCase {
     final ODataRawResponse res = req.execute();
     assertNotNull(res);
 
-    final ODataEntitySet entitySet = res.getBodyAs(ODataEntitySet.class);
+    final CommonODataEntitySet entitySet = res.getBodyAs(CommonODataEntitySet.class);
     assertNotNull(entitySet);
     assertTrue(res.getContextURL().toASCIIString().endsWith("$metadata#People"));
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/PropertyValueTestITCase.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/PropertyValueTestITCase.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/PropertyValueTestITCase.java
index 93ee5fe..cddd66d 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/PropertyValueTestITCase.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/it/v4/PropertyValueTestITCase.java
@@ -18,20 +18,20 @@
  */
 package org.apache.olingo.client.core.it.v4;
 
-import static org.junit.Assert.*;
 import java.io.IOException;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.olingo.client.api.communication.ODataClientErrorException;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataPropertyRequest;
 import org.apache.olingo.client.api.communication.request.retrieve.ODataValueRequest;
-import org.apache.olingo.commons.api.format.ODataValueFormat;
 import org.apache.olingo.client.api.uri.CommonURIBuilder;
 import org.apache.olingo.commons.api.domain.ODataPrimitiveValue;
-import org.apache.olingo.commons.api.domain.ODataProperty;
+import org.apache.olingo.commons.api.domain.v4.ODataProperty;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
 import org.apache.olingo.commons.api.format.ODataFormat;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.apache.olingo.commons.api.format.ODataValueFormat;
+import static org.junit.Assert.*;
 import org.junit.Test;
 
 public class PropertyValueTestITCase extends AbstractTestITCase {
@@ -124,7 +124,8 @@ public class PropertyValueTestITCase extends AbstractTestITCase {
   public void retrieveCollectionPropertyValueTest() {
     CommonURIBuilder<?> uriBuilder = client.getURIBuilder(testStaticServiceRootURL).
             appendEntitySetSegment("People").appendKeySegment(5).appendPropertySegment("Numbers");
-    final ODataPropertyRequest req = client.getRetrieveRequestFactory().getPropertyRequest(uriBuilder.build());
+    final ODataPropertyRequest<ODataProperty> req = client.getRetrieveRequestFactory().
+            getPropertyRequest(uriBuilder.build());
     req.setFormat(ODataFormat.XML);
     final ODataProperty property = req.execute().getBody();
     assertTrue(property.getValue().isCollection());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntitySetTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntitySetTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntitySetTest.java
index 0812c6d..1f02432 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntitySetTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntitySetTest.java
@@ -24,7 +24,7 @@ import static org.junit.Assert.assertEquals;
 import java.io.IOException;
 import java.io.InputStream;
 import org.apache.olingo.client.api.v3.ODataClient;
-import org.apache.olingo.commons.api.domain.ODataEntitySet;
+import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
 import org.apache.olingo.client.core.AbstractTest;
 import org.apache.olingo.commons.core.op.ResourceFactory;
@@ -39,14 +39,14 @@ public class EntitySetTest extends AbstractTest {
 
   private void read(final ODataPubFormat format) throws IOException {
     final InputStream input = getClass().getResourceAsStream("Customer." + getSuffix(format));
-    final ODataEntitySet entitySet = getClient().getBinder().getODataEntitySet(
+    final CommonODataEntitySet entitySet = getClient().getBinder().getODataEntitySet(
             getClient().getDeserializer().toFeed(input, format).getObject());
     assertNotNull(entitySet);
 
     assertEquals(2, entitySet.getEntities().size());
     assertNotNull(entitySet.getNext());
 
-    final ODataEntitySet written = getClient().getBinder().getODataEntitySet(getClient().
+    final CommonODataEntitySet written = getClient().getBinder().getODataEntitySet(getClient().
             getBinder().getFeed(entitySet, ResourceFactory.feedClassForFormat(format == ODataPubFormat.ATOM)));
     assertEquals(entitySet, written);
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntityTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntityTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntityTest.java
index 80c56c2..fe5b148 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntityTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/EntityTest.java
@@ -24,9 +24,9 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.InputStream;
 import org.apache.olingo.client.api.v3.ODataClient;
-import org.apache.olingo.commons.api.domain.ODataEntity;
+import org.apache.olingo.commons.api.domain.CommonODataEntity;
 import org.apache.olingo.commons.api.domain.ODataLink;
-import org.apache.olingo.commons.api.domain.ODataProperty;
+import org.apache.olingo.commons.api.domain.CommonODataProperty;
 import org.apache.olingo.commons.api.format.ODataPubFormat;
 import org.apache.olingo.client.core.AbstractTest;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
@@ -45,7 +45,7 @@ public class EntityTest extends AbstractTest {
 
   private void readAndWrite(final ODataPubFormat format) {
     final InputStream input = getClass().getResourceAsStream("Customer_-10." + getSuffix(format));
-    final ODataEntity entity = getClient().getBinder().getODataEntity(
+    final CommonODataEntity entity = getClient().getBinder().getODataEntity(
             getClient().getDeserializer().toEntry(input, format).getObject());
     assertNotNull(entity);
 
@@ -64,7 +64,7 @@ public class EntityTest extends AbstractTest {
 
     assertTrue(check);
 
-    final ODataEntity written = getClient().getBinder().getODataEntity(getClient().getBinder().
+    final CommonODataEntity written = getClient().getBinder().getODataEntity(getClient().getBinder().
             getEntry(entity, ResourceFactory.entryClassForFormat(format == ODataPubFormat.ATOM)));
     assertEquals(entity, written);
   }
@@ -81,12 +81,12 @@ public class EntityTest extends AbstractTest {
 
   private void readGeospatial(final ODataPubFormat format) {
     final InputStream input = getClass().getResourceAsStream("AllGeoTypesSet_-8." + getSuffix(format));
-    final ODataEntity entity = getClient().getBinder().getODataEntity(
+    final CommonODataEntity entity = getClient().getBinder().getODataEntity(
             getClient().getDeserializer().toEntry(input, format).getObject());
     assertNotNull(entity);
 
     boolean found = false;
-    for (ODataProperty property : entity.getProperties()) {
+    for (CommonODataProperty property : entity.getProperties()) {
       if ("GeogMultiLine".equals(property.getName())) {
         found = true;
         assertTrue(property.hasPrimitiveValue());
@@ -95,7 +95,7 @@ public class EntityTest extends AbstractTest {
     }
     assertTrue(found);
 
-    final ODataEntity written = getClient().getBinder().getODataEntity(getClient().getBinder().
+    final CommonODataEntity written = getClient().getBinder().getODataEntity(getClient().getBinder().
             getEntry(entity, ResourceFactory.entryClassForFormat(format == ODataPubFormat.ATOM)));
     assertEquals(entity, written);
   }
@@ -113,14 +113,14 @@ public class EntityTest extends AbstractTest {
 
   private void withActions(final ODataPubFormat format) {
     final InputStream input = getClass().getResourceAsStream("ComputerDetail_-10." + getSuffix(format));
-    final ODataEntity entity = getClient().getBinder().getODataEntity(
+    final CommonODataEntity entity = getClient().getBinder().getODataEntity(
             getClient().getDeserializer().toEntry(input, format).getObject());
     assertNotNull(entity);
 
     assertEquals(1, entity.getOperations().size());
     assertEquals("ResetComputerDetailsSpecifications", entity.getOperations().get(0).getTitle());
 
-    final ODataEntity written = getClient().getBinder().getODataEntity(getClient().getBinder().
+    final CommonODataEntity written = getClient().getBinder().getODataEntity(getClient().getBinder().
             getEntry(entity, ResourceFactory.entryClassForFormat(format == ODataPubFormat.ATOM)));
     entity.getOperations().clear();
     assertEquals(entity, written);
@@ -139,14 +139,14 @@ public class EntityTest extends AbstractTest {
 
   private void mediaEntity(final ODataPubFormat format) {
     final InputStream input = getClass().getResourceAsStream("Car_16." + getSuffix(format));
-    final ODataEntity entity = getClient().getBinder().getODataEntity(
+    final CommonODataEntity entity = getClient().getBinder().getODataEntity(
             getClient().getDeserializer().toEntry(input, format).getObject());
     assertNotNull(entity);
     assertTrue(entity.isMediaEntity());
     assertNotNull(entity.getMediaContentSource());
     assertNotNull(entity.getMediaContentType());
 
-    final ODataEntity written = getClient().getBinder().getODataEntity(getClient().getBinder().
+    final CommonODataEntity written = getClient().getBinder().getODataEntity(getClient().getBinder().
             getEntry(entity, ResourceFactory.entryClassForFormat(format == ODataPubFormat.ATOM)));
     assertEquals(entity, written);
   }
@@ -163,11 +163,11 @@ public class EntityTest extends AbstractTest {
 
   private void issue128(final ODataPubFormat format) throws EdmPrimitiveTypeException {
     final InputStream input = getClass().getResourceAsStream("AllGeoTypesSet_-5." + getSuffix(format));
-    final ODataEntity entity = getClient().getBinder().getODataEntity(
+    final CommonODataEntity entity = getClient().getBinder().getODataEntity(
             getClient().getDeserializer().toEntry(input, format).getObject());
     assertNotNull(entity);
 
-    final ODataProperty geogCollection = entity.getProperty("GeogCollection");
+    final CommonODataProperty geogCollection = entity.getProperty("GeogCollection");
     assertEquals(EdmPrimitiveTypeKind.GeographyCollection, geogCollection.getPrimitiveValue().getTypeKind());
 
     int count = 0;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/PropertyTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/PropertyTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/PropertyTest.java
index 6d46398..4b3167e 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/PropertyTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v3/PropertyTest.java
@@ -31,7 +31,7 @@ import org.apache.olingo.client.core.AbstractTest;
 import org.apache.olingo.commons.api.domain.ODataCollectionValue;
 import org.apache.olingo.commons.api.domain.ODataComplexValue;
 import org.apache.olingo.commons.api.domain.ODataPrimitiveValue;
-import org.apache.olingo.commons.api.domain.ODataProperty;
+import org.apache.olingo.commons.api.domain.CommonODataProperty;
 import org.apache.olingo.commons.api.domain.ODataValue;
 import org.apache.olingo.commons.api.format.ODataFormat;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
@@ -57,15 +57,15 @@ public class PropertyTest extends AbstractTest {
     assertEquals("-10", value.toString());
   }
 
-  private ODataProperty primitive(final ODataFormat format) throws IOException, EdmPrimitiveTypeException {
+  private CommonODataProperty primitive(final ODataFormat format) throws IOException, EdmPrimitiveTypeException {
     final InputStream input = getClass().getResourceAsStream("Customer_-10_CustomerId." + getSuffix(format));
-    final ODataProperty property = getClient().getReader().readProperty(input, format);
+    final CommonODataProperty property = getClient().getReader().readProperty(input, format);
     assertNotNull(property);
     assertTrue(property.hasPrimitiveValue());
     assertTrue(-10 == property.getPrimitiveValue().toCastValue(Integer.class));
 
-    ODataProperty comparable;
-    final ODataProperty written = getClient().getReader().readProperty(
+    CommonODataProperty comparable;
+    final CommonODataProperty written = getClient().getReader().readProperty(
             getClient().getWriter().writeProperty(property, format), format);
     if (format == ODataFormat.XML) {
       comparable = written;
@@ -93,15 +93,15 @@ public class PropertyTest extends AbstractTest {
     primitive(ODataFormat.JSON);
   }
 
-  private ODataProperty complex(final ODataFormat format) throws IOException {
+  private CommonODataProperty complex(final ODataFormat format) throws IOException {
     final InputStream input = getClass().getResourceAsStream("Customer_-10_PrimaryContactInfo." + getSuffix(format));
-    final ODataProperty property = getClient().getReader().readProperty(input, format);
+    final CommonODataProperty property = getClient().getReader().readProperty(input, format);
     assertNotNull(property);
     assertTrue(property.hasComplexValue());
     assertEquals(6, property.getComplexValue().size());
 
-    ODataProperty comparable;
-    final ODataProperty written = getClient().getReader().readProperty(
+    CommonODataProperty comparable;
+    final CommonODataProperty written = getClient().getReader().readProperty(
             getClient().getWriter().writeProperty(property, format), format);
     if (format == ODataFormat.XML) {
       comparable = written;
@@ -109,8 +109,8 @@ public class PropertyTest extends AbstractTest {
       // This is needed because type information gets lost with JSON serialization
       final ODataComplexValue typedValue = getClient().getObjectFactory().
               newComplexValue(property.getComplexValue().getTypeName());
-      for (final Iterator<ODataProperty> itor = written.getComplexValue().iterator(); itor.hasNext();) {
-        final ODataProperty prop = itor.next();
+      for (final Iterator<CommonODataProperty> itor = written.getComplexValue().iterator(); itor.hasNext();) {
+        final CommonODataProperty prop = itor.next();
         typedValue.add(prop);
       }
       comparable = getClient().getObjectFactory().newComplexProperty(written.getName(), typedValue);
@@ -131,15 +131,15 @@ public class PropertyTest extends AbstractTest {
     complex(ODataFormat.JSON);
   }
 
-  private ODataProperty collection(final ODataFormat format) throws IOException {
+  private CommonODataProperty collection(final ODataFormat format) throws IOException {
     final InputStream input = getClass().getResourceAsStream("Customer_-10_BackupContactInfo." + getSuffix(format));
-    final ODataProperty property = getClient().getReader().readProperty(input, format);
+    final CommonODataProperty property = getClient().getReader().readProperty(input, format);
     assertNotNull(property);
     assertTrue(property.hasCollectionValue());
     assertEquals(9, property.getCollectionValue().size());
 
-    ODataProperty comparable;
-    final ODataProperty written = getClient().getReader().readProperty(
+    CommonODataProperty comparable;
+    final CommonODataProperty written = getClient().getReader().readProperty(
             getClient().getWriter().writeProperty(property, format), format);
     if (format == ODataFormat.XML) {
       comparable = written;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataEntity.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataEntity.java
new file mode 100644
index 0000000..f4b0d2f
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataEntity.java
@@ -0,0 +1,177 @@
+/*
+ * 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.api.domain;
+
+import java.net.URI;
+import java.util.List;
+
+/**
+ * OData entity.
+ */
+public interface CommonODataEntity extends ODataInvokeResult {
+
+  String getName();
+
+  URI getLink();
+
+  /**
+   * Gets ETag.
+   *
+   * @return ETag.
+   */
+  String getETag();
+
+  /**
+   * Sets ETag.
+   *
+   * @param eTag ETag.
+   */
+  void setETag(String eTag);
+
+  /**
+   * Searches for operation with given title.
+   *
+   * @param title operation to look for
+   * @return operation if found with given title, <tt>null</tt> otherwise
+   */
+  ODataOperation getOperation(String title);
+
+  /**
+   * Gets operations.
+   *
+   * @return operations.
+   */
+  List<ODataOperation> getOperations();
+
+  /**
+   * Searches for property with given name.
+   *
+   * @param name property to look for
+   * @return property if found with given name, <tt>null</tt> otherwise
+   */
+  CommonODataProperty getProperty(String name);
+
+  /**
+   * Returns OData entity properties.
+   *
+   * @return OData entity properties.
+   */
+  List<? extends CommonODataProperty> getProperties();
+
+  /**
+   * Puts the given link into one of available lists, based on its type.
+   *
+   * @param link to be added
+   * @return <tt>true</tt> if the given link was added in one of available lists
+   */
+  boolean addLink(ODataLink link);
+
+  /**
+   * Removes the given link from any list (association, navigation, edit-media).
+   *
+   * @param link to be removed
+   * @return <tt>true</tt> if the given link was contained in one of available lists
+   */
+  boolean removeLink(ODataLink link);
+
+  /**
+   * Returns all entity association links.
+   *
+   * @return OData entity links.
+   */
+  List<ODataLink> getAssociationLinks();
+
+  /**
+   * Returns all entity navigation links (including inline entities / feeds).
+   *
+   * @return OData entity links.
+   */
+  List<ODataLink> getNavigationLinks();
+
+  /**
+   * Returns all entity media edit links.
+   *
+   * @return OData entity links.
+   */
+  List<ODataLink> getEditMediaLinks();
+
+  /**
+   * Returns OData entity edit link.
+   *
+   * @return entity edit link.
+   */
+  URI getEditLink();
+
+  /**
+   * Sets OData entity edit link.
+   *
+   * @param editLink edit link.
+   */
+  void setEditLink(URI editLink);
+
+  /**
+   * TRUE if read-only entity.
+   *
+   * @return TRUE if read-only; FALSE otherwise.
+   */
+  boolean isReadOnly();
+
+  /**
+   * Checks if the current entity is a media entity.
+   *
+   * @return 'TRUE' if media entity; 'FALSE' otherwise.
+   */
+  boolean isMediaEntity();
+
+  /**
+   * Sets media entity flag.
+   *
+   * @param isMediaEntity media entity flag value.
+   */
+  void setMediaEntity(boolean isMediaEntity);
+
+  /**
+   * Gets media content type.
+   *
+   * @return media content type.
+   */
+  String getMediaContentType();
+
+  /**
+   * Sets media content type.
+   *
+   * @param mediaContentType media content type.
+   */
+  void setMediaContentType(String mediaContentType);
+
+  /**
+   * Gets media content source.
+   *
+   * @return media content source.
+   */
+  String getMediaContentSource();
+
+  /**
+   * Sets media content source.
+   *
+   * @param mediaContentSource media content source.
+   */
+  void setMediaContentSource(String mediaContentSource);
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataEntitySet.java
new file mode 100644
index 0000000..3967748
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataEntitySet.java
@@ -0,0 +1,57 @@
+/*
+ * 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.api.domain;
+
+import java.net.URI;
+import java.util.List;
+
+/**
+ * OData entity collection. If pagination was used to get this instance, forward page navigation URI will be available.
+ */
+public interface CommonODataEntitySet extends ODataInvokeResult {
+
+  /**
+   * Gets next page link.
+   *
+   * @return next page link; null value if single page or last page reached.
+   */
+  URI getNext();
+
+  /**
+   * Gets contained entities.
+   *
+   * @return feed entries.
+   */
+  List<? extends CommonODataEntity> getEntities();
+
+  /**
+   * Gets in-line count.
+   *
+   * @return in-line count value.
+   */
+  int getCount();
+
+  /**
+   * Sets in-line count.
+   *
+   * @param count in-line count value.
+   */
+  void setCount(final int count);
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataObjectFactory.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataObjectFactory.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataObjectFactory.java
new file mode 100644
index 0000000..525dc9d
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataObjectFactory.java
@@ -0,0 +1,210 @@
+/*
+ * 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.api.domain;
+
+import java.net.URI;
+
+/**
+ * Entry point for generating OData domain objects.
+ */
+public interface CommonODataObjectFactory {
+
+  /**
+   * Instantiates a new entity set.
+   *
+   * @return entity set.
+   */
+  CommonODataEntitySet newEntitySet();
+
+  /**
+   * Instantiates a new entity set.
+   *
+   * @param next next link.
+   * @return entity set.
+   */
+  CommonODataEntitySet newEntitySet(URI next);
+
+  /**
+   * Instantiates a new entity.
+   *
+   * @param name OData entity name.
+   * @return entity.
+   */
+  CommonODataEntity newEntity(String name);
+
+  /**
+   * Instantiates a new entity.
+   *
+   * @param name OData entity name.
+   * @param link self link.
+   * @return entity.
+   */
+  CommonODataEntity newEntity(String name, URI link);
+
+  /**
+   * Instantiates a new in-line entity set.
+   *
+   * @param name name.
+   * @param link edit link.
+   * @param entitySet entity set.
+   * @return in-line entity set.
+   */
+  ODataInlineEntitySet newInlineEntitySet(String name, URI link, CommonODataEntitySet entitySet);
+
+  /**
+   * Instantiates a new in-line entity set.
+   *
+   * @param name name.
+   * @param baseURI base URI.
+   * @param href href.
+   * @param entitySet entity set.
+   * @return in-line entity set.
+   */
+  ODataInlineEntitySet newInlineEntitySet(String name, URI baseURI, String href, CommonODataEntitySet entitySet);
+
+  /**
+   * Instantiates a new in-line entity.
+   *
+   * @param name name.
+   * @param link edit link.
+   * @param entity entity.
+   * @return in-line entity.
+   */
+  ODataInlineEntity newInlineEntity(String name, URI link, CommonODataEntity entity);
+
+  /**
+   * Instantiates a new in-line entity.
+   *
+   * @param name name.
+   * @param baseURI base URI.
+   * @param href href.
+   * @param entity entity.
+   * @return in-line entity.
+   */
+  ODataInlineEntity newInlineEntity(String name, URI baseURI, String href, CommonODataEntity entity);
+
+  /**
+   * Instantiates a new entity navigation link.
+   *
+   * @param name name.
+   * @param link link.
+   * @return entity navigation link.
+   */
+  ODataLink newEntityNavigationLink(String name, URI link);
+
+  /**
+   * Instantiates a new entity navigation link.
+   *
+   * @param name name.
+   * @param baseURI base URI.
+   * @param href href.
+   * @return entity navigation link.
+   */
+  ODataLink newEntityNavigationLink(String name, URI baseURI, String href);
+
+  /**
+   * Instantiates a new entity set navigation link.
+   *
+   * @param name name.
+   * @param link link.
+   * @return entity set navigation link.
+   */
+  ODataLink newFeedNavigationLink(String name, URI link);
+
+  /**
+   * Instantiates a new entity set navigation link.
+   *
+   * @param name name.
+   * @param baseURI base URI.
+   * @param href href.
+   * @return entity set navigation link.
+   */
+  ODataLink newFeedNavigationLink(String name, URI baseURI, String href);
+
+  /**
+   * Instantiates a new association link.
+   *
+   * @param name name.
+   * @param link link.
+   * @return association link.
+   */
+  ODataLink newAssociationLink(String name, URI link);
+
+  /**
+   * Instantiates a new association link.
+   *
+   * @param name name.
+   * @param baseURI base URI.
+   * @param href href.
+   * @return association link.
+   */
+  ODataLink newAssociationLink(String name, URI baseURI, String href);
+
+  /**
+   * Instantiates a new media-edit link.
+   *
+   * @param name name.
+   * @param link link.
+   * @return media-edit link.
+   */
+  ODataLink newMediaEditLink(String name, URI link);
+
+  /**
+   * Instantiates a new media-edit link.
+   *
+   * @param name name.
+   * @param baseURI base URI.
+   * @param href href.
+   * @return media-edit link.
+   */
+  ODataLink newMediaEditLink(String name, URI baseURI, String href);
+
+  ODataPrimitiveValue.Builder newPrimitiveValueBuilder();
+
+  ODataComplexValue newComplexValue(String typeName);
+
+  ODataCollectionValue newCollectionValue(String typeName);
+
+  /**
+   * Instantiates a new primitive property.
+   *
+   * @param name name.
+   * @param value primitive value.
+   * @return primitive property.
+   */
+  CommonODataProperty newPrimitiveProperty(String name, ODataPrimitiveValue value);
+
+  /**
+   * Instantiates a new complex property.
+   *
+   * @param name name.
+   * @param value value.
+   * @return complex property.
+   */
+  CommonODataProperty newComplexProperty(String name, ODataComplexValue value);
+
+  /**
+   * Instantiates a new collection property.
+   *
+   * @param name name.
+   * @param value value.
+   * @return collection property.
+   */
+  CommonODataProperty newCollectionProperty(String name, ODataCollectionValue value);
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataProperty.java
new file mode 100644
index 0000000..99a5131
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/CommonODataProperty.java
@@ -0,0 +1,91 @@
+/*
+ * 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.api.domain;
+
+import java.io.Serializable;
+
+/**
+ * OData entity property.
+ */
+public interface CommonODataProperty extends ODataInvokeResult, Serializable {
+
+  /**
+   * Returns property name.
+   *
+   * @return property name.
+   */
+  String getName();
+
+  /**
+   * Checks if has null value.
+   *
+   * @return 'TRUE' if has null value; 'FALSE' otherwise.
+   */
+  boolean hasNullValue();
+
+  /**
+   * Checks if has primitive value.
+   *
+   * @return 'TRUE' if has primitive value; 'FALSE' otherwise.
+   */
+  boolean hasPrimitiveValue();
+
+  /**
+   * Gets primitive value.
+   *
+   * @return primitive value if exists; null otherwise.
+   */
+  ODataPrimitiveValue getPrimitiveValue();
+
+  /**
+   * Returns property value.
+   *
+   * @return property value.
+   */
+  ODataValue getValue();
+
+  /**
+   * Checks if has collection value.
+   *
+   * @return 'TRUE' if has collection value; 'FALSE' otherwise.
+   */
+  boolean hasCollectionValue();
+
+  /**
+   * Gets collection value.
+   *
+   * @return collection value if exists; null otherwise.
+   */
+  ODataCollectionValue getCollectionValue();
+
+  /**
+   * Checks if has complex value.
+   *
+   * @return 'TRUE' if has complex value; 'FALSE' otherwise.
+   */
+  boolean hasComplexValue();
+
+  /**
+   * Gets complex value.
+   *
+   * @return complex value if exists; null otherwise.
+   */
+  ODataComplexValue getComplexValue();
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataComplexValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataComplexValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataComplexValue.java
index ea4d832..b34006c 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataComplexValue.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataComplexValue.java
@@ -21,14 +21,14 @@ package org.apache.olingo.commons.api.domain;
 /**
  * OData complex property value.
  */
-public interface ODataComplexValue extends ODataValue, Iterable<ODataProperty> {
+public interface ODataComplexValue extends ODataValue, Iterable<CommonODataProperty> {
 
   /**
    * Adds field to the complex type.
    *
    * @param field field to be added.
    */
-  void add(ODataProperty field);
+  void add(CommonODataProperty field);
 
   /**
    * Gets field.
@@ -36,7 +36,7 @@ public interface ODataComplexValue extends ODataValue, Iterable<ODataProperty> {
    * @param name name of the field to be retrieved.
    * @return requested field.
    */
-  ODataProperty get(String name);
+  CommonODataProperty get(String name);
 
   /**
    * Gets number of fields.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntity.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntity.java
deleted file mode 100644
index 44214ac..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntity.java
+++ /dev/null
@@ -1,197 +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.api.domain;
-
-import java.net.URI;
-import java.util.List;
-
-/**
- * OData entity.
- */
-public interface ODataEntity extends ODataInvokeResult {
-
-  String getName();
-
-  URI getLink();
-
-  /**
-   * Gets ETag.
-   *
-   * @return ETag.
-   */
-  String getETag();
-
-  /**
-   * Sets ETag.
-   *
-   * @param eTag ETag.
-   */
-  void setETag(String eTag);
-
-  /**
-   * Searches for operation with given title.
-   *
-   * @param title operation to look for
-   * @return operation if found with given title, <tt>null</tt> otherwise
-   */
-  ODataOperation getOperation(String title);
-
-  /**
-   * Gets operations.
-   *
-   * @return operations.
-   */
-  List<ODataOperation> getOperations();
-
-  /**
-   * Searches for property with given name.
-   *
-   * @param name property to look for
-   * @return property if found with given name, <tt>null</tt> otherwise
-   */
-  ODataProperty getProperty(String name);
-
-  /**
-   * Returns OData entity properties.
-   *
-   * @return OData entity properties.
-   */
-  List<ODataProperty> getProperties();
-
-  /**
-   * Puts the given link into one of available lists, based on its type.
-   *
-   * @param link to be added
-   * @return <tt>true</tt> if the given link was added in one of available lists
-   */
-  boolean addLink(ODataLink link);
-
-  /**
-   * Removes the given link from any list (association, navigation, edit-media).
-   *
-   * @param link to be removed
-   * @return <tt>true</tt> if the given link was contained in one of available lists
-   */
-  boolean removeLink(ODataLink link);
-
-  /**
-   * Returns all entity association links.
-   *
-   * @return OData entity links.
-   */
-  List<ODataLink> getAssociationLinks();
-
-  /**
-   * Returns all entity navigation links (including inline entities / feeds).
-   *
-   * @return OData entity links.
-   */
-  List<ODataLink> getNavigationLinks();
-
-  /**
-   * Returns all entity media edit links.
-   *
-   * @return OData entity links.
-   */
-  List<ODataLink> getEditMediaLinks();
-
-  /**
-   * Returns OData entity edit link.
-   *
-   * @return entity edit link.
-   */
-  URI getEditLink();
-
-  /**
-   * Sets OData entity edit link.
-   *
-   * @param editLink edit link.
-   */
-  void setEditLink(URI editLink);
-
-  /**
-   * TRUE if read-only entity.
-   *
-   * @return TRUE if read-only; FALSE otherwise.
-   */
-  boolean isReadOnly();
-
-  /**
-   * Checks if the current entity is a media entity.
-   *
-   * @return 'TRUE' if media entity; 'FALSE' otherwise.
-   */
-  boolean isMediaEntity();
-
-  /**
-   * Sets media entity flag.
-   *
-   * @param isMediaEntity media entity flag value.
-   */
-  void setMediaEntity(boolean isMediaEntity);
-
-  /**
-   * Gets media content type.
-   *
-   * @return media content type.
-   */
-  String getMediaContentType();
-
-  /**
-   * Sets media content type.
-   *
-   * @param mediaContentType media content type.
-   */
-  void setMediaContentType(String mediaContentType);
-
-  /**
-   * Gets media content source.
-   *
-   * @return media content source.
-   */
-  String getMediaContentSource();
-
-  /**
-   * Sets media content source.
-   *
-   * @param mediaContentSource media content source.
-   */
-  void setMediaContentSource(String mediaContentSource);
-
-  /**
-   * To request entity references in place of the actual entities, the client issues a GET request with /$ref appended
-   * to the resource path.
-   * <br />
-   * If the resource path does not identify an entity or a collection of entities, the service returns 404 Not Found.
-   * <br />
-   * If the resource path terminates on a collection, the response MUST be the format-specific representation of a
-   * collection of entity references pointing to the related entities. If no entities are related, the response is the
-   * format-specific representation of an empty collection.
-   * <br />
-   * If the resource path terminates on a single entity, the response MUST be the format-specific representation of an
-   * entity reference pointing to the related single entity. If the resource path terminates on a single entity and no
-   * such entity exists, the service returns 404 Not Found.
-   *
-   * @return entity reference.
-   */
-  String getReference();
-
-  void setReference(String reference);
-
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntitySet.java
deleted file mode 100644
index 99b6962..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntitySet.java
+++ /dev/null
@@ -1,57 +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.api.domain;
-
-import java.net.URI;
-import java.util.List;
-
-/**
- * OData entity collection. If pagination was used to get this instance, forward page navigation URI will be available.
- */
-public interface ODataEntitySet extends ODataInvokeResult {
-
-  /**
-   * Gets next page link.
-   *
-   * @return next page link; null value if single page or last page reached.
-   */
-  URI getNext();
-
-  /**
-   * Gets contained entities.
-   *
-   * @return feed entries.
-   */
-  List<ODataEntity> getEntities();
-
-  /**
-   * Gets in-line count.
-   *
-   * @return in-line count value.
-   */
-  int getCount();
-
-  /**
-   * Sets in-line count.
-   *
-   * @param count in-line count value.
-   */
-  void setCount(final int count);
-
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataInlineEntity.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataInlineEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataInlineEntity.java
index 46e29dd..67e5bb4 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataInlineEntity.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataInlineEntity.java
@@ -28,7 +28,7 @@ public class ODataInlineEntity extends ODataLink {
 
   private static final long serialVersionUID = -4763341581843700743L;
 
-  private final ODataEntity entity;
+  private final CommonODataEntity entity;
 
   /**
    * Constructor.
@@ -40,7 +40,7 @@ public class ODataInlineEntity extends ODataLink {
    * @param entity entity.
    */
   public ODataInlineEntity(final ODataServiceVersion version,
-          final URI uri, final ODataLinkType type, final String title, final ODataEntity entity) {
+          final URI uri, final ODataLinkType type, final String title, final CommonODataEntity entity) {
 
     super(version, uri, type, title);
     this.entity = entity;
@@ -57,7 +57,7 @@ public class ODataInlineEntity extends ODataLink {
    * @param entity entity.
    */
   public ODataInlineEntity(final ODataServiceVersion version, final URI baseURI, final String href,
-          final ODataLinkType type, final String title, final ODataEntity entity) {
+          final ODataLinkType type, final String title, final CommonODataEntity entity) {
 
     super(version, baseURI, href, type, title);
     this.entity = entity;
@@ -68,7 +68,7 @@ public class ODataInlineEntity extends ODataLink {
    *
    * @return wrapped entity.
    */
-  public ODataEntity getEntity() {
+  public CommonODataEntity getEntity() {
     return entity;
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataInlineEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataInlineEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataInlineEntitySet.java
index 1ace20b..24ca836 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataInlineEntitySet.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataInlineEntitySet.java
@@ -28,7 +28,7 @@ public class ODataInlineEntitySet extends ODataLink {
 
   private static final long serialVersionUID = -77628001615355449L;
 
-  private ODataEntitySet entitySet;
+  private CommonODataEntitySet entitySet;
 
   /**
    * Constructor.
@@ -40,7 +40,7 @@ public class ODataInlineEntitySet extends ODataLink {
    * @param entitySet entity set.
    */
   public ODataInlineEntitySet(final ODataServiceVersion version, final URI uri, final ODataLinkType type,
-          final String title, final ODataEntitySet entitySet) {
+          final String title, final CommonODataEntitySet entitySet) {
 
     super(version, uri, type, title);
     this.entitySet = entitySet;
@@ -57,7 +57,7 @@ public class ODataInlineEntitySet extends ODataLink {
    * @param entitySet entity set.
    */
   public ODataInlineEntitySet(final ODataServiceVersion version, final URI baseURI, final String href,
-          final ODataLinkType type, final String title, final ODataEntitySet entitySet) {
+          final ODataLinkType type, final String title, final CommonODataEntitySet entitySet) {
 
     super(version, baseURI, href, type, title);
     this.entitySet = entitySet;
@@ -68,7 +68,7 @@ public class ODataInlineEntitySet extends ODataLink {
    *
    * @return wrapped entity set.
    */
-  public ODataEntitySet getEntitySet() {
+  public CommonODataEntitySet getEntitySet() {
     return entitySet;
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataObjectFactory.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataObjectFactory.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataObjectFactory.java
deleted file mode 100644
index 7114c5b..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataObjectFactory.java
+++ /dev/null
@@ -1,210 +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.api.domain;
-
-import java.net.URI;
-
-/**
- * Entry point for generating OData domain objects.
- */
-public interface ODataObjectFactory {
-
-  /**
-   * Instantiates a new entity set.
-   *
-   * @return entity set.
-   */
-  ODataEntitySet newEntitySet();
-
-  /**
-   * Instantiates a new entity set.
-   *
-   * @param next next link.
-   * @return entity set.
-   */
-  ODataEntitySet newEntitySet(URI next);
-
-  /**
-   * Instantiates a new entity.
-   *
-   * @param name OData entity name.
-   * @return entity.
-   */
-  ODataEntity newEntity(String name);
-
-  /**
-   * Instantiates a new entity.
-   *
-   * @param name OData entity name.
-   * @param link self link.
-   * @return entity.
-   */
-  ODataEntity newEntity(String name, URI link);
-
-  /**
-   * Instantiates a new in-line entity set.
-   *
-   * @param name name.
-   * @param link edit link.
-   * @param entitySet entity set.
-   * @return in-line entity set.
-   */
-  ODataInlineEntitySet newInlineEntitySet(String name, URI link, ODataEntitySet entitySet);
-
-  /**
-   * Instantiates a new in-line entity set.
-   *
-   * @param name name.
-   * @param baseURI base URI.
-   * @param href href.
-   * @param entitySet entity set.
-   * @return in-line entity set.
-   */
-  ODataInlineEntitySet newInlineEntitySet(String name, URI baseURI, String href, ODataEntitySet entitySet);
-
-  /**
-   * Instantiates a new in-line entity.
-   *
-   * @param name name.
-   * @param link edit link.
-   * @param entity entity.
-   * @return in-line entity.
-   */
-  ODataInlineEntity newInlineEntity(String name, URI link, ODataEntity entity);
-
-  /**
-   * Instantiates a new in-line entity.
-   *
-   * @param name name.
-   * @param baseURI base URI.
-   * @param href href.
-   * @param entity entity.
-   * @return in-line entity.
-   */
-  ODataInlineEntity newInlineEntity(String name, URI baseURI, String href, ODataEntity entity);
-
-  /**
-   * Instantiates a new entity navigation link.
-   *
-   * @param name name.
-   * @param link link.
-   * @return entity navigation link.
-   */
-  ODataLink newEntityNavigationLink(String name, URI link);
-
-  /**
-   * Instantiates a new entity navigation link.
-   *
-   * @param name name.
-   * @param baseURI base URI.
-   * @param href href.
-   * @return entity navigation link.
-   */
-  ODataLink newEntityNavigationLink(String name, URI baseURI, String href);
-
-  /**
-   * Instantiates a new entity set navigation link.
-   *
-   * @param name name.
-   * @param link link.
-   * @return entity set navigation link.
-   */
-  ODataLink newFeedNavigationLink(String name, URI link);
-
-  /**
-   * Instantiates a new entity set navigation link.
-   *
-   * @param name name.
-   * @param baseURI base URI.
-   * @param href href.
-   * @return entity set navigation link.
-   */
-  ODataLink newFeedNavigationLink(String name, URI baseURI, String href);
-
-  /**
-   * Instantiates a new association link.
-   *
-   * @param name name.
-   * @param link link.
-   * @return association link.
-   */
-  ODataLink newAssociationLink(String name, URI link);
-
-  /**
-   * Instantiates a new association link.
-   *
-   * @param name name.
-   * @param baseURI base URI.
-   * @param href href.
-   * @return association link.
-   */
-  ODataLink newAssociationLink(String name, URI baseURI, String href);
-
-  /**
-   * Instantiates a new media-edit link.
-   *
-   * @param name name.
-   * @param link link.
-   * @return media-edit link.
-   */
-  ODataLink newMediaEditLink(String name, URI link);
-
-  /**
-   * Instantiates a new media-edit link.
-   *
-   * @param name name.
-   * @param baseURI base URI.
-   * @param href href.
-   * @return media-edit link.
-   */
-  ODataLink newMediaEditLink(String name, URI baseURI, String href);
-
-  ODataPrimitiveValue.Builder newPrimitiveValueBuilder();
-
-  ODataComplexValue newComplexValue(String typeName);
-
-  ODataCollectionValue newCollectionValue(String typeName);
-
-  /**
-   * Instantiates a new primitive property.
-   *
-   * @param name name.
-   * @param value primitive value.
-   * @return primitive property.
-   */
-  ODataProperty newPrimitiveProperty(String name, ODataPrimitiveValue value);
-
-  /**
-   * Instantiates a new complex property.
-   *
-   * @param name name.
-   * @param value value.
-   * @return complex property.
-   */
-  ODataProperty newComplexProperty(String name, ODataComplexValue value);
-
-  /**
-   * Instantiates a new collection property.
-   *
-   * @param name name.
-   * @param value value.
-   * @return collection property.
-   */
-  ODataProperty newCollectionProperty(String name, ODataCollectionValue value);
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataProperty.java
deleted file mode 100644
index 4cfa303..0000000
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataProperty.java
+++ /dev/null
@@ -1,91 +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.api.domain;
-
-import java.io.Serializable;
-
-/**
- * OData entity property.
- */
-public interface ODataProperty extends ODataInvokeResult, Serializable {
-
-  /**
-   * Returns property name.
-   *
-   * @return property name.
-   */
-  String getName();
-
-  /**
-   * Checks if has null value.
-   *
-   * @return 'TRUE' if has null value; 'FALSE' otherwise.
-   */
-  boolean hasNullValue();
-
-  /**
-   * Checks if has primitive value.
-   *
-   * @return 'TRUE' if has primitive value; 'FALSE' otherwise.
-   */
-  boolean hasPrimitiveValue();
-
-  /**
-   * Gets primitive value.
-   *
-   * @return primitive value if exists; null otherwise.
-   */
-  ODataPrimitiveValue getPrimitiveValue();
-
-  /**
-   * Returns property value.
-   *
-   * @return property value.
-   */
-  ODataValue getValue();
-
-  /**
-   * Checks if has collection value.
-   *
-   * @return 'TRUE' if has collection value; 'FALSE' otherwise.
-   */
-  boolean hasCollectionValue();
-
-  /**
-   * Gets collection value.
-   *
-   * @return collection value if exists; null otherwise.
-   */
-  ODataCollectionValue getCollectionValue();
-
-  /**
-   * Checks if has complex value.
-   *
-   * @return 'TRUE' if has complex value; 'FALSE' otherwise.
-   */
-  boolean hasComplexValue();
-
-  /**
-   * Gets complex value.
-   *
-   * @return complex value if exists; null otherwise.
-   */
-  ODataComplexValue getComplexValue();
-
-}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataEntity.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataEntity.java
new file mode 100644
index 0000000..18ba67b
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataEntity.java
@@ -0,0 +1,32 @@
+/*
+ * 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.api.domain.v3;
+
+import java.util.List;
+import org.apache.olingo.commons.api.domain.CommonODataEntity;
+
+public interface ODataEntity extends CommonODataEntity {
+
+  @Override
+  ODataProperty getProperty(String name);
+
+  @Override
+  List<ODataProperty> getProperties();
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataEntitySet.java
new file mode 100644
index 0000000..dae0919
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataEntitySet.java
@@ -0,0 +1,29 @@
+/*
+ * 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.api.domain.v3;
+
+import java.util.List;
+import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
+
+public interface ODataEntitySet extends CommonODataEntitySet {
+
+  @Override
+  List<ODataEntity> getEntities();
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataObjectFactory.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataObjectFactory.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataObjectFactory.java
new file mode 100644
index 0000000..363f1de
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataObjectFactory.java
@@ -0,0 +1,50 @@
+/*
+ * 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.api.domain.v3;
+
+import java.net.URI;
+import org.apache.olingo.commons.api.domain.CommonODataObjectFactory;
+import org.apache.olingo.commons.api.domain.ODataCollectionValue;
+import org.apache.olingo.commons.api.domain.ODataComplexValue;
+import org.apache.olingo.commons.api.domain.ODataPrimitiveValue;
+
+public interface ODataObjectFactory extends CommonODataObjectFactory {
+
+  @Override
+  ODataEntitySet newEntitySet();
+
+  @Override
+  ODataEntitySet newEntitySet(URI next);
+
+  @Override
+  ODataEntity newEntity(String name);
+
+  @Override
+  ODataEntity newEntity(String name, URI link);
+
+  @Override
+  ODataProperty newPrimitiveProperty(String name, ODataPrimitiveValue value);
+
+  @Override
+  ODataProperty newComplexProperty(String name, ODataComplexValue value);
+
+  @Override
+  ODataProperty newCollectionProperty(String name, ODataCollectionValue value);
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataProperty.java
new file mode 100644
index 0000000..266d53c
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v3/ODataProperty.java
@@ -0,0 +1,25 @@
+/*
+ * 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.api.domain.v3;
+
+import org.apache.olingo.commons.api.domain.CommonODataProperty;
+
+public interface ODataProperty extends CommonODataProperty {
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntity.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntity.java
new file mode 100644
index 0000000..df9e801
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntity.java
@@ -0,0 +1,52 @@
+/*
+ * 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.api.domain.v4;
+
+import java.util.List;
+import org.apache.olingo.commons.api.domain.CommonODataEntity;
+
+public interface ODataEntity extends CommonODataEntity {
+
+  @Override
+  ODataProperty getProperty(String name);
+
+  @Override
+  List<ODataProperty> getProperties();
+
+  /**
+   * To request entity references in place of the actual entities, the client issues a GET request with /$ref appended
+   * to the resource path.
+   * <br />
+   * If the resource path does not identify an entity or a collection of entities, the service returns 404 Not Found.
+   * <br />
+   * If the resource path terminates on a collection, the response MUST be the format-specific representation of a
+   * collection of entity references pointing to the related entities. If no entities are related, the response is the
+   * format-specific representation of an empty collection.
+   * <br />
+   * If the resource path terminates on a single entity, the response MUST be the format-specific representation of an
+   * entity reference pointing to the related single entity. If the resource path terminates on a single entity and no
+   * such entity exists, the service returns 404 Not Found.
+   *
+   * @return entity reference.
+   */
+  String getReference();
+
+  void setReference(String reference);
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntitySet.java
new file mode 100644
index 0000000..97ac192
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntitySet.java
@@ -0,0 +1,29 @@
+/*
+ * 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.api.domain.v4;
+
+import java.util.List;
+import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
+
+public interface ODataEntitySet extends CommonODataEntitySet {
+
+  @Override
+  List<ODataEntity> getEntities();
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEnumValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEnumValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEnumValue.java
new file mode 100644
index 0000000..2e3699d
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEnumValue.java
@@ -0,0 +1,24 @@
+/*
+ * 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.api.domain.v4;
+
+public interface ODataEnumValue extends ODataValue {
+
+  String getValue();
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataObjectFactory.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataObjectFactory.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataObjectFactory.java
new file mode 100644
index 0000000..8b43bc1
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataObjectFactory.java
@@ -0,0 +1,52 @@
+/*
+ * 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.api.domain.v4;
+
+import java.net.URI;
+import org.apache.olingo.commons.api.domain.CommonODataObjectFactory;
+import org.apache.olingo.commons.api.domain.ODataCollectionValue;
+import org.apache.olingo.commons.api.domain.ODataComplexValue;
+import org.apache.olingo.commons.api.domain.ODataPrimitiveValue;
+
+public interface ODataObjectFactory extends CommonODataObjectFactory {
+
+  @Override
+  ODataEntitySet newEntitySet();
+
+  @Override
+  ODataEntitySet newEntitySet(URI next);
+
+  @Override
+  ODataEntity newEntity(String name);
+
+  @Override
+  ODataEntity newEntity(String name, URI link);
+
+  @Override
+  ODataProperty newPrimitiveProperty(String name, ODataPrimitiveValue value);
+
+  ODataProperty newEnumProperty(String name, ODataEnumValue value);
+
+  @Override
+  ODataProperty newComplexProperty(String name, ODataComplexValue value);
+
+  @Override
+  ODataProperty newCollectionProperty(String name, ODataCollectionValue value);
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataProperty.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataProperty.java
new file mode 100644
index 0000000..61a8193
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataProperty.java
@@ -0,0 +1,38 @@
+/*
+ * 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.api.domain.v4;
+
+import org.apache.olingo.commons.api.domain.CommonODataProperty;
+
+public interface ODataProperty extends CommonODataProperty {
+
+  /**
+   * Checks if has enum value.
+   *
+   * @return 'TRUE' if has enum value; 'FALSE' otherwise.
+   */
+  boolean hasEnumValue();
+
+  /**
+   * Gets enum value.
+   *
+   * @return enum value if exists; null otherwise.
+   */
+  ODataEnumValue getEnumValue();
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/80e5ed56/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataValue.java
new file mode 100644
index 0000000..1535e10
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataValue.java
@@ -0,0 +1,36 @@
+/*
+ * 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.api.domain.v4;
+
+public interface ODataValue extends org.apache.olingo.commons.api.domain.ODataValue {
+
+  /**
+   * Check is is an enum value.
+   *
+   * @return 'TRUE' if enum; 'FALSE' otherwise.
+   */
+  boolean isEnum();
+
+  /**
+   * Casts to enum value.
+   *
+   * @return enum value.
+   */
+  ODataEnumValue asEnum();
+}