olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject [4/7] olingo-odata2 git commit: [OLINGO-231] Merge with 2.0.0 version
Date Wed, 20 Jul 2016 19:27:55 GMT
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationTest.java
index 186a864..eea4433 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationTest.java
@@ -28,7 +28,9 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.AnnotatedElement;
 import java.lang.reflect.Field;
 import java.lang.reflect.Member;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import javax.persistence.JoinColumn;
@@ -59,6 +61,7 @@ public class JPAEdmAssociationTest extends JPAEdmTestModelView {
   private JPAEdmAssociationTest localView = null;
   private static final String PUNIT_NAME = "salesorderprocessing";
   private int variant;
+  private List<String[]> joinColumnNames = null;
 
   @Before
   public void setup() {
@@ -183,6 +186,18 @@ public class JPAEdmAssociationTest extends JPAEdmTestModelView {
   @Test
   public void testSearchAssociation1() {
     class TestAssociationEndView extends JPAEdmTestModelView {
+
+      @Override
+      public List<String[]> getJPAJoinColumns() {
+        if (joinColumnNames == null) {
+
+          joinColumnNames = new ArrayList<String[]>();
+          String[] names = { "SOID", "DEMO_ID" };
+          joinColumnNames.add(names);
+        }
+        return joinColumnNames;
+      }
+
       @Override
       public String getEdmRelationShipName() {
         return "SalesOrderHeader_String1";
@@ -199,13 +214,13 @@ public class JPAEdmAssociationTest extends JPAEdmTestModelView {
       }
 
       @Override
-      public String getJoinColumnName() {
-        return "SO_ID";
+      public String[] getJoinColumnNames() {
+        return new String[] { "SO_ID" };
       }
 
       @Override
-      public String getJoinColumnReferenceColumnName() {
-        return "DEMO_ID";
+      public String[] getJoinColumnReferenceColumnNames() {
+        return new String[] { "DEMO_ID" };
       }
 
       @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityContainerTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityContainerTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityContainerTest.java
index f94fa6f..340cdde 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityContainerTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityContainerTest.java
@@ -179,6 +179,11 @@ public class JPAEdmEntityContainerTest extends JPAEdmTestModelView {
       public String getName() {
         return "SalesOrderHeader";
       }
+
+      @Override
+      public Class<String> getJavaType() {
+        return (Class<String>) java.lang.String.class;
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntitySetTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntitySetTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntitySetTest.java
index 6994dd9..6374206 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntitySetTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntitySetTest.java
@@ -219,6 +219,11 @@ public class JPAEdmEntitySetTest extends JPAEdmTestModelView {
       public String getName() {
         return "SalesOrderHeader";
       }
+
+      @Override
+      public Class<String> getJavaType() {
+        return (Class<String>) java.lang.String.class;
+      }
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityTypeTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityTypeTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityTypeTest.java
index 8c79ece..15b8076 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityTypeTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityTypeTest.java
@@ -144,6 +144,11 @@ public class JPAEdmEntityTypeTest extends JPAEdmTestModelView {
       public String getName() {
         return "SalesOrderHeader";
       }
+
+      @Override
+      public Class<String> getJavaType() {
+        return (Class<String>) java.lang.String.class;
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintRoleTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintRoleTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintRoleTest.java
index 5737c41..656af8d 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintRoleTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintRoleTest.java
@@ -55,6 +55,7 @@ public class JPAEdmReferentialConstraintRoleTest extends JPAEdmTestModelView {
 
   private static JPAEdmReferentialConstraintRole objJPAEdmReferentialConstraintRole = null;
   private static JPAEdmReferentialConstraintRoleTest objJPAEdmReferentialConstraintRoleTest = null;
+  private List<String[]> joinColumnNames = null;
 
   @Before
   public void setUp() {
@@ -147,6 +148,17 @@ public class JPAEdmReferentialConstraintRoleTest extends JPAEdmTestModelView {
   }
 
   @Override
+  public List<String[]> getJPAJoinColumns() {
+    if (joinColumnNames == null) {
+
+      joinColumnNames = new ArrayList<String[]>();
+      String[] names = { "SOID", "SOID" };
+      joinColumnNames.add(names);
+    }
+    return joinColumnNames;
+  }
+
+  @Override
   public Association getEdmAssociation() {
     Association association = new Association();
     association.setName("Assoc_SalesOrderHeader_SalesOrderItem");
@@ -227,6 +239,7 @@ public class JPAEdmReferentialConstraintRoleTest extends JPAEdmTestModelView {
       EasyMock.expect(joinColumn.name()).andReturn("SOID");
 
       EasyMock.replay(joinColumn);
+
       return (T) joinColumn;
     }
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintTest.java
index 6e7f6b3..1e26654 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintTest.java
@@ -25,6 +25,8 @@ import static org.junit.Assert.fail;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Member;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.persistence.JoinColumn;
 import javax.persistence.metamodel.Attribute;
@@ -48,6 +50,7 @@ public class JPAEdmReferentialConstraintTest extends JPAEdmTestModelView {
 
   private static JPAEdmReferentialConstraint objJPAEdmReferentialConstraint = null;
   private static JPAEdmReferentialConstraintTest objJPAEdmReferentialConstraintTest = null;
+  private List<String[]> joinColumnNames = null;
 
   @Before
   public void setUp() {
@@ -125,6 +128,17 @@ public class JPAEdmReferentialConstraintTest extends JPAEdmTestModelView {
     return getJPAAttributeLocal();
   }
 
+  @Override
+  public List<String[]> getJPAJoinColumns() {
+    if (joinColumnNames == null) {
+
+      joinColumnNames = new ArrayList<String[]>();
+      String[] names = { "SOID", "SOID" };
+      joinColumnNames.add(names);
+    }
+    return joinColumnNames;
+  }
+
   @SuppressWarnings("hiding")
   private class AttributeMock<Object, String> extends JPAAttributeMock<Object, String> {
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmTestModelView.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmTestModelView.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmTestModelView.java
index 7a6f90f..df20a50 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmTestModelView.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmTestModelView.java
@@ -356,13 +356,13 @@ public class JPAEdmTestModelView implements JPAEdmAssociationEndView, JPAEdmAsso
   }
 
   @Override
-  public String getJoinColumnName() {
+  public String[] getJoinColumnNames() {
     // TODO Auto-generated method stub
     return null;
   }
 
   @Override
-  public String getJoinColumnReferenceColumnName() {
+  public String[] getJoinColumnReferenceColumnNames() {
     // TODO Auto-generated method stub
     return null;
   }
@@ -403,4 +403,10 @@ public class JPAEdmTestModelView implements JPAEdmAssociationEndView, JPAEdmAsso
     return null;
   }
 
+  @Override
+  public List<String[]> getJPAJoinColumns() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/pom.xml b/odata2-jpa-processor/jpa-ref/pom.xml
index 26d3b41..f67db2a 100644
--- a/odata2-jpa-processor/jpa-ref/pom.xml
+++ b/odata2-jpa-processor/jpa-ref/pom.xml
@@ -17,7 +17,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor</artifactId>
-		<version>1.3.0-SNAPSHOT</version>
+		<version>2.0.0</version>
 		<relativePath>..</relativePath>
 	</parent>
 
@@ -90,6 +90,13 @@
 			<version>${project.version}</version>
 		</dependency>
 
+		<!-- OData API Support -->
+		<dependency>
+			<groupId>org.apache.olingo</groupId>
+			<artifactId>olingo-odata2-jpa-processor-api</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+
 		<!-- JUnits -->
 		<dependency>
 			<groupId>junit</groupId>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/converter/BlobToByteConverter.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/converter/BlobToByteConverter.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/converter/BlobToByteConverter.java
index b6b01cf..e950d69 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/converter/BlobToByteConverter.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/converter/BlobToByteConverter.java
@@ -34,6 +34,9 @@ public class BlobToByteConverter implements AttributeConverter<Blob, byte[]> {
 
   @Override
   public byte[] convertToDatabaseColumn(final Blob arg0) {
+    if (arg0 == null) {
+      return null;
+    }
     ByteArrayOutputStream buffer = new ByteArrayOutputStream();
     InputStream is;
     try {
@@ -55,6 +58,9 @@ public class BlobToByteConverter implements AttributeConverter<Blob, byte[]> {
   @Override
   public Blob convertToEntityAttribute(final byte[] arg0) {
     try {
+      if (arg0 == null) {
+        return null;
+      }
       return new JDBCBlob(arg0);
     } catch (SQLException e) {
       e.printStackTrace();

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/listeners/SalesOrderItemTombstoneListener.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/listeners/SalesOrderItemTombstoneListener.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/listeners/SalesOrderItemTombstoneListener.java
new file mode 100644
index 0000000..26c5b81
--- /dev/null
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/listeners/SalesOrderItemTombstoneListener.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.ref.listeners;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+
+import org.apache.olingo.odata2.api.edm.EdmException;
+import org.apache.olingo.odata2.api.uri.info.GetEntitySetUriInfo;
+import org.apache.olingo.odata2.jpa.processor.api.ODataJPATombstoneContext;
+import org.apache.olingo.odata2.jpa.processor.api.ODataJPATombstoneEntityListener;
+import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException;
+import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
+import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContext;
+import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContextType;
+import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLStatement;
+
+public class SalesOrderItemTombstoneListener extends ODataJPATombstoneEntityListener {
+
+  @Override
+  public Query getQuery(final GetEntitySetUriInfo resultsView, final EntityManager em) {
+    JPQLContextType contextType = null;
+
+    try {
+      if (!resultsView.getStartEntitySet().getName().equals(resultsView.getTargetEntitySet().getName())) {
+        contextType = JPQLContextType.JOIN;
+      } else {
+        contextType = JPQLContextType.SELECT;
+      }
+
+      JPQLContext jpqlContext = JPQLContext.createBuilder(contextType, resultsView).build();
+      JPQLStatement jpqlStatement = JPQLStatement.createBuilder(jpqlContext).build();
+      String deltaToken = ODataJPATombstoneContext.getDeltaToken();
+
+      Query query = null;
+      if (deltaToken != null) {
+        String statement = jpqlStatement.toString();
+        String[] statementParts = statement.split(JPQLStatement.KEYWORD.WHERE);
+        String deltaCondition = jpqlContext.getJPAEntityAlias() + ".creationDate >= {ts '" + deltaToken + "'}";
+        if (statementParts.length > 1) {
+          statement =
+              statementParts[0] + JPQLStatement.DELIMITER.SPACE + JPQLStatement.KEYWORD.WHERE
+                  + JPQLStatement.DELIMITER.SPACE + deltaCondition + JPQLStatement.DELIMITER.SPACE
+                  + JPQLStatement.Operator.AND + statementParts[1];
+        } else {
+          statement =
+              statementParts[0] + JPQLStatement.DELIMITER.SPACE + JPQLStatement.KEYWORD.WHERE
+                  + JPQLStatement.DELIMITER.SPACE + deltaCondition;
+        }
+
+        query = em.createQuery(statement);
+      } else {
+        query = em.createQuery(jpqlStatement.toString());
+      }
+
+      return query;
+    } catch (EdmException e) {
+      return null;
+    } catch (ODataJPAModelException e) {
+      return null;
+    } catch (ODataJPARuntimeException e) {
+      return null;
+    }
+  }
+
+  @Override
+  public String generateDeltaToken(final List<Object> deltas, final Query query) {
+    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.000");
+
+    Date date = new Date(System.currentTimeMillis());
+    return dateFormat.format(date);
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/listeners/SalesOrderTombstoneListener.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/listeners/SalesOrderTombstoneListener.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/listeners/SalesOrderTombstoneListener.java
new file mode 100644
index 0000000..55f2013
--- /dev/null
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/listeners/SalesOrderTombstoneListener.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.odata2.jpa.processor.ref.listeners;
+
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PostLoad;
+import javax.persistence.Query;
+
+import org.apache.olingo.odata2.api.uri.info.GetEntitySetUriInfo;
+import org.apache.olingo.odata2.jpa.processor.api.ODataJPATombstoneContext;
+import org.apache.olingo.odata2.jpa.processor.api.ODataJPATombstoneEntityListener;
+import org.apache.olingo.odata2.jpa.processor.ref.model.SalesOrderHeader;
+
+public class SalesOrderTombstoneListener extends ODataJPATombstoneEntityListener {
+
+  public static String ENTITY_NAME = "SalesOrderHeader";
+
+  @PostLoad
+  public void handleDelta(final Object entity) {
+    SalesOrderHeader so = (SalesOrderHeader) entity;
+
+    if (so.getCreationDate().getTime().getTime() < ODataJPATombstoneContext.getDeltaTokenUTCTimeStamp()) {
+      return;
+    } else {
+      addToDelta(entity, ENTITY_NAME);
+    }
+  }
+
+  @Override
+  public String generateDeltaToken(final List<Object> deltas, final Query query) {
+    return String.valueOf(System.currentTimeMillis());
+  }
+
+  @Override
+  public Query getQuery(final GetEntitySetUriInfo resultsView, final EntityManager em) {
+    return null;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Category.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Category.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Category.java
index 22e2966..7c8965e 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Category.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Category.java
@@ -35,6 +35,10 @@ public class Category {
   @Column(name = "CODE")
   private char code[] = new char[2];
 
+  @Id
+  @Column(name = "ID")
+  private long id;
+
   @Column(name = "DESC")
   private String description;
 
@@ -49,6 +53,14 @@ public class Category {
     this.materials = materials;
   }
 
+  public long getId() {
+    return id;
+  }
+
+  public void setId(final long id) {
+    this.id = id;
+  }
+
   public char[] getCode() {
     return code;
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Customer.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Customer.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Customer.java
index 0e51e48..48243d0 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Customer.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Customer.java
@@ -18,6 +18,7 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.jpa.processor.ref.model;
 
+import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -43,6 +44,9 @@ public class Customer {
   @Embedded
   private Address address;
 
+  @Column(name = "CREATED_AT")
+  private Timestamp createdAt;
+
   @OneToMany(mappedBy = "customer", cascade = CascadeType.ALL)
   private List<SalesOrderHeader> orders = new ArrayList<SalesOrderHeader>();
 
@@ -78,4 +82,12 @@ public class Customer {
     this.address = address;
   }
 
+  public Timestamp getCreatedAt() {
+    return createdAt;
+  }
+
+  public void setCreatedAt(final Timestamp createdAt) {
+    this.createdAt = createdAt;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
index 356909f..8a2ef0c 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
@@ -28,18 +28,14 @@ import javax.persistence.Convert;
 import javax.persistence.Entity;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
+import javax.persistence.JoinColumns;
 import javax.persistence.Lob;
 import javax.persistence.ManyToMany;
 import javax.persistence.ManyToOne;
 import javax.persistence.Table;
 
-import org.eclipse.persistence.annotations.Converter;
-
 @Entity
 @Table(name = "T_MATERIAL")
-@Converter(
-    name = "BlobToByteConverter",
-    converterClass = org.apache.olingo.odata2.jpa.processor.ref.converter.BlobToByteConverter.class)
 public class Material {
 
   public Material() {}
@@ -82,7 +78,8 @@ public class Material {
   private List<Store> stores = new ArrayList<Store>();
 
   @ManyToOne
-  @JoinColumn(name = "TYPE_CODE", referencedColumnName = "CODE")
+  @JoinColumns({ @JoinColumn(name = "TYPE_CODE", referencedColumnName = "CODE"),
+      @JoinColumn(name = "CAT_ID", referencedColumnName = "ID") })
   private Category category;
 
   public long getMaterialId() {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderHeader.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderHeader.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderHeader.java
index 74a39c8..0525017 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderHeader.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderHeader.java
@@ -20,15 +20,14 @@ package org.apache.olingo.odata2.jpa.processor.ref.model;
 
 import java.util.ArrayList;
 import java.util.Calendar;
-import java.util.Date;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.TimeZone;
 
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.EntityListeners;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
@@ -40,6 +39,7 @@ import javax.persistence.TemporalType;
 
 @Entity
 @Table(name = "T_SALESORDERHEADER")
+@EntityListeners(org.apache.olingo.odata2.jpa.processor.ref.listeners.SalesOrderTombstoneListener.class)
 public class SalesOrderHeader {
 
   public SalesOrderHeader() {}
@@ -89,7 +89,7 @@ public class SalesOrderHeader {
   private List<Note> notes = new ArrayList<Note>();
 
   @ManyToOne
-  @JoinColumn(name = "CUST_ID", referencedColumnName = "ID")
+  @JoinColumn
   private Customer customer;
 
   public Customer getCustomer() {
@@ -116,26 +116,17 @@ public class SalesOrderHeader {
     this.soId = soId;
   }
 
-  public Date getCreationDate() {
+  public Calendar getCreationDate() {
     if (creationDate == null) {
       return null;
     }
-    long dbTime = creationDate.getTime().getTime();
-    Date originalDate = new Date(dbTime + TimeZone.getDefault().getOffset(dbTime));
-    return originalDate;
+
+    return creationDate;
   }
 
   public void setCreationDate(final Calendar creationDate) {
-    long originalTime;
-    if (creationDate != null) {
-      originalTime = creationDate.getTime().getTime();
-    } else {
-      originalTime = Calendar.getInstance(TimeZone.getDefault()).getTime().getTime();
-    }
-    Date newDate = new Date(originalTime - TimeZone.getDefault().getOffset(originalTime));
-    Calendar newCalendar = Calendar.getInstance();
-    newCalendar.setTime(newDate);
-    this.creationDate = newCalendar;
+
+    this.creationDate = creationDate;
   }
 
   public String getCurrencyCode() {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderItem.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderItem.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderItem.java
index 412287b..a819ff0 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderItem.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderItem.java
@@ -21,6 +21,7 @@ package org.apache.olingo.odata2.jpa.processor.ref.model;
 import javax.persistence.Column;
 import javax.persistence.EmbeddedId;
 import javax.persistence.Entity;
+import javax.persistence.EntityListeners;
 import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
 import javax.persistence.Table;
@@ -28,6 +29,7 @@ import javax.persistence.Transient;
 
 @Entity
 @Table(name = "T_SALESORDERITEM")
+@EntityListeners(org.apache.olingo.odata2.jpa.processor.ref.listeners.SalesOrderItemTombstoneListener.class)
 public class SalesOrderItem {
 
   public SalesOrderItem() {}
@@ -67,7 +69,7 @@ public class SalesOrderItem {
     delivered = deliveryStatus;
   }
 
-  @JoinColumn(name = "Material_Id", referencedColumnName = "MATERIAL_ID")
+  @JoinColumn(name = "Material_Id")
   @ManyToOne
   private Material material;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/pom.xml b/odata2-jpa-processor/jpa-web/pom.xml
index b84f06f..5c326e7 100644
--- a/odata2-jpa-processor/jpa-web/pom.xml
+++ b/odata2-jpa-processor/jpa-web/pom.xml
@@ -21,7 +21,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor</artifactId>
-		<version>1.3.0-SNAPSHOT</version>
+		<version>2.0.0</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/SalesOrderProcessingExtension.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/SalesOrderProcessingExtension.java b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/SalesOrderProcessingExtension.java
index 3133944..c3065ec 100644
--- a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/SalesOrderProcessingExtension.java
+++ b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/SalesOrderProcessingExtension.java
@@ -18,6 +18,7 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.jpa.processor.ref.extension;
 
+import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -65,4 +66,9 @@ public class SalesOrderProcessingExtension implements JPAEdmExtension {
 
   }
 
+  @Override
+  public InputStream getJPAEdmMappingModelStream() {
+    return null;
+  }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/web/JPAReferenceServiceFactory.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/web/JPAReferenceServiceFactory.java b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/web/JPAReferenceServiceFactory.java
index 938e00d..256ffdd 100644
--- a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/web/JPAReferenceServiceFactory.java
+++ b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/web/JPAReferenceServiceFactory.java
@@ -47,6 +47,7 @@ public class JPAReferenceServiceFactory extends ODataJPAServiceFactory {
     oDataJPAContext
         .setJPAEdmExtension((JPAEdmExtension) new SalesOrderProcessingExtension());
     oDataJPAContext.setPageSize(PAGE_SIZE);
+    oDataJPAContext.setDefaultNaming(false);
     setErrorLevel();
     setOnWriteJPAContent(onDBWriteContent);
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Category.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Category.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Category.properties
index 86d4a13..d9b44e6 100644
--- a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Category.properties
+++ b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Category.properties
@@ -16,7 +16,7 @@
 #        specific language governing permissions and limitations
 #        under the License.
 #-------------------------------------------------------------------------------
-query_1 = INSERT INTO T_CATEGORY (CODE,DESC) VALUES('P1','Pen');
-query_2 = INSERT INTO T_CATEGORY (CODE,DESC) VALUES('P2','Pencil');
-query_3 = INSERT INTO T_CATEGORY (CODE,DESC) VALUES('S1','Sharpner');
-query_4 = INSERT INTO T_CATEGORY (CODE,DESC) VALUES('E1','Eraser');
\ No newline at end of file
+query_1 = INSERT INTO T_CATEGORY (CODE,ID,DESC) VALUES('P1',1,'Pen');
+query_2 = INSERT INTO T_CATEGORY (CODE,ID,DESC) VALUES('P2',1,'Pencil');
+query_3 = INSERT INTO T_CATEGORY (CODE,ID,DESC) VALUES('S1',2,'Sharpner');
+query_4 = INSERT INTO T_CATEGORY (CODE,ID,DESC) VALUES('E1',3,'Eraser');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Customer.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Customer.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Customer.properties
index e718a01..fe52d68 100644
--- a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Customer.properties
+++ b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Customer.properties
@@ -16,8 +16,8 @@
 #        specific language governing permissions and limitations
 #        under the License.
 #-------------------------------------------------------------------------------
-query_1 = INSERT INTO T_CUSTOMER (ID , NAME, HOUSE_NUMBER , STREET_NAME, CITY, COUNTRY, PINCODE) VALUES(100,'Bob Bryan',7,'5 cross Street', 'London', 'UK',  'E7');
-query_2 = INSERT INTO T_CUSTOMER (ID , NAME, HOUSE_NUMBER , STREET_NAME, CITY, COUNTRY, PINCODE) VALUES(200,'Mike Bryan',7,'8 cross Street', 'New York', 'USA',  '10011');
-query_3 = INSERT INTO T_CUSTOMER (ID , NAME, HOUSE_NUMBER , STREET_NAME, CITY, COUNTRY, PINCODE) VALUES(201,'Steve Roger',7,'9 cross Street', 'Mumbai', 'India', '200101');
-query_4 = INSERT INTO T_CUSTOMER (ID , NAME, HOUSE_NUMBER , STREET_NAME, CITY, COUNTRY, PINCODE) VALUES(101,'Pac Man',7,'25 cross Street', 'Frankfurt', 'Germany',  '60001');
-query_5 = INSERT INTO T_CUSTOMER (ID , NAME, HOUSE_NUMBER , STREET_NAME, CITY, COUNTRY, PINCODE) VALUES(202,'Bolt Man',7,'25 cross Street', 'Toronto', 'Canada',  'NE');
\ No newline at end of file
+query_1 = INSERT INTO T_CUSTOMER (ID , NAME, HOUSE_NUMBER , STREET_NAME, CITY, COUNTRY, PINCODE,CREATED_AT) VALUES(100,'Bob Bryan',7,'5 cross Street', 'London', 'UK',  'E7','2012-11-01 00:01:00');
+query_2 = INSERT INTO T_CUSTOMER (ID , NAME, HOUSE_NUMBER , STREET_NAME, CITY, COUNTRY, PINCODE,CREATED_AT) VALUES(200,'Mike Bryan',7,'8 cross Street', 'New York', 'USA',  '10011','2012-11-01 00:01:00');
+query_3 = INSERT INTO T_CUSTOMER (ID , NAME, HOUSE_NUMBER , STREET_NAME, CITY, COUNTRY, PINCODE,CREATED_AT) VALUES(201,'Steve Roger',7,'9 cross Street', 'Mumbai', 'India', '200101','2012-11-01 00:01:00');
+query_4 = INSERT INTO T_CUSTOMER (ID , NAME, HOUSE_NUMBER , STREET_NAME, CITY, COUNTRY, PINCODE,CREATED_AT) VALUES(101,'Pac Man',7,'25 cross Street', 'Frankfurt', 'Germany',  '60001','2012-11-01 00:01:00');
+query_5 = INSERT INTO T_CUSTOMER (ID , NAME, HOUSE_NUMBER , STREET_NAME, CITY, COUNTRY, PINCODE,CREATED_AT) VALUES(202,'Bolt Man',7,'25 cross Street', 'Toronto', 'Canada',  'NE','2012-11-01 00:01:00');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Material.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Material.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Material.properties
index 7ea5ade..653fafd 100644
--- a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Material.properties
+++ b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Material.properties
@@ -17,14 +17,14 @@
 #        under the License.
 #-------------------------------------------------------------------------------
 
-material_query_1 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(111, 'My Pen', 'P1', 111.1, 'Piece');
-material_query_2 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(112, 'My Great Pen', 'P1', 112.1, 'Piece');
-material_query_3 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(113, 'Super Pen', 'P1', 113.1, 'Piece');
-material_query_4 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(114, 'Marvel Pen', 'P1', 114.1, 'Piece');
-material_query_5 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(115, 'Smooth', 'P2', 115.1, 'Piece');
-material_query_6 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(116, 'Silver Line', 'P2', 116.1, 'Piece');
-material_query_7 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(117, 'Dark Line', 'P2', 117.1, 'Piece');
-material_query_8 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(118, 'Sharp', 'S1', 118.1, 'Piece');
-material_query_9 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(119, 'Cut Sharp', 'S1', 119.1, 'Piece');
-material_query_10 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(120, 'Thin line', 'S1', 120.1, 'Piece');
-material_query_11 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(121, 'Clean', 'E1', 121.1, 'Piece');
\ No newline at end of file
+material_query_1 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, CAT_ID, PRICE, MEASUREMENT_UNIT) values(111, 'My Pen', 'P1', 1, 111.1, 'Piece');
+material_query_2 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, CAT_ID, PRICE, MEASUREMENT_UNIT) values(112, 'My Great Pen', 'P1', 1, 112.1, 'Piece');
+material_query_3 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, CAT_ID, PRICE, MEASUREMENT_UNIT) values(113, 'Super Pen', 'P1', 1, 113.1, 'Piece');
+material_query_4 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, CAT_ID, PRICE, MEASUREMENT_UNIT) values(114, 'Marvel Pen', 'P1', 1, 114.1, 'Piece');
+material_query_5 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, CAT_ID, PRICE, MEASUREMENT_UNIT) values(115, 'Smooth', 'P2', 1, 115.1, 'Piece');
+material_query_6 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, CAT_ID, PRICE, MEASUREMENT_UNIT) values(116, 'Silver Line', 'P2', 1, 116.1, 'Piece');
+material_query_7 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, CAT_ID, PRICE, MEASUREMENT_UNIT) values(117, 'Dark Line', 'P2', 1, 117.1, 'Piece');
+material_query_8 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, CAT_ID, PRICE, MEASUREMENT_UNIT) values(118, 'Sharp', 'S1', 2, 118.1, 'Piece');
+material_query_9 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, CAT_ID, PRICE, MEASUREMENT_UNIT) values(119, 'Cut Sharp', 'S1', 2, 119.1, 'Piece');
+material_query_10 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, CAT_ID, PRICE, MEASUREMENT_UNIT) values(120, 'Thin line', 'S1', 2, 120.1, 'Piece');
+material_query_11 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, CAT_ID, PRICE, MEASUREMENT_UNIT) values(121, 'Clean', 'E1', 3, 121.1, 'Piece');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_SalesOrderHeader.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_SalesOrderHeader.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_SalesOrderHeader.properties
index b5ebf24..8b519bf 100644
--- a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_SalesOrderHeader.properties
+++ b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_SalesOrderHeader.properties
@@ -17,14 +17,14 @@
 #        under the License.
 #-------------------------------------------------------------------------------
 
-query1 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(1, 100, 'INR', '01', '2012-11-01 00:01:00');
-query2 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(2, 100, 'USD', '01', '2013-01-02 00:00:00');
-query3 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(3, 100, 'USD', '02', '2013-01-01 14:00:00');
-query4 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(4, 200, 'INR', '01', '2013-01-02 00:00:00');
-query5 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(5, 201, 'INR', '02', '2013-01-01 14:14:14');
-query6 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(6, 101, 'EUR', '01', '2013-01-02 00:00:00');
-query7 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(7, 201, 'EUR', '02', '2013-01-01 14:14:00');
-query8 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(8, 201, 'GBR', '01', '2013-01-02 00:00:00');
-query9 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(9, 101, 'GBR', '02', '2013-01-01 00:00:00');
-query10 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(10, 100, 'AUD', '01', '2013-01-01 00:00:00');
-query11 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(11, 202, 'AUD', '02', '2013-01-02 00:00:00');
\ No newline at end of file
+query1 = insert into T_SALESORDERHEADER (SO_ID, customer_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(1, 100, 'INR', '01', '2012-11-01 00:01:00');
+query2 = insert into T_SALESORDERHEADER (SO_ID, customer_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(2, 100, 'USD', '01', '2013-01-02 00:00:00');
+query3 = insert into T_SALESORDERHEADER (SO_ID, customer_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(3, 100, 'USD', '02', '2013-01-01 14:00:00');
+query4 = insert into T_SALESORDERHEADER (SO_ID, customer_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(4, 200, 'INR', '01', '2013-01-02 00:00:00');
+query5 = insert into T_SALESORDERHEADER (SO_ID, customer_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(5, 201, 'INR', '02', '2013-01-01 14:14:14');
+query6 = insert into T_SALESORDERHEADER (SO_ID, customer_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(6, 101, 'EUR', '01', '2013-01-02 00:00:00');
+query7 = insert into T_SALESORDERHEADER (SO_ID, customer_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(7, 201, 'EUR', '02', '2013-01-01 14:14:00');
+query8 = insert into T_SALESORDERHEADER (SO_ID, customer_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(8, 201, 'GBR', '01', '2013-01-02 00:00:00');
+query9 = insert into T_SALESORDERHEADER (SO_ID, customer_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(9, 101, 'GBR', '02', '2013-01-01 00:00:00');
+query10 = insert into T_SALESORDERHEADER (SO_ID, customer_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(10, 100, 'AUD', '01', '2013-01-01 00:00:00');
+query11 = insert into T_SALESORDERHEADER (SO_ID, customer_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(11, 202, 'AUD', '02', '2013-01-02 00:00:00');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-jpa-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/pom.xml b/odata2-jpa-processor/pom.xml
index e422512..962b752 100644
--- a/odata2-jpa-processor/pom.xml
+++ b/odata2-jpa-processor/pom.xml
@@ -18,7 +18,7 @@
     <parent>
       <groupId>org.apache.olingo</groupId>
       <artifactId>olingo-odata2-parent</artifactId>
-      <version>1.3.0-SNAPSHOT</version>
+      <version>2.0.0</version>
       <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-annotation/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/pom.xml b/odata2-lib/odata-annotation/pom.xml
index 53795bd..ec7edd5 100644
--- a/odata2-lib/odata-annotation/pom.xml
+++ b/odata2-lib/odata-annotation/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-lib</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>2.0.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/pom.xml b/odata2-lib/odata-api/pom.xml
index 53e2d58..d315de5 100644
--- a/odata2-lib/odata-api/pom.xml
+++ b/odata2-lib/odata-api/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>2.0.0</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/edm/EdmMapping.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/edm/EdmMapping.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/edm/EdmMapping.java
index 2c1116d..5bf01d3 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/edm/EdmMapping.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/edm/EdmMapping.java
@@ -33,15 +33,6 @@ public interface EdmMapping {
   String getInternalName();
 
   /**
-   * Get the mapping name for mime type lookup
-   * 
-   * @return mapping name as String
-   * @deprecated use instead functionality of {@link #getMediaResourceMimeTypeKey()} method
-   */
-  @Deprecated
-  String getMimeType();
-
-  /**
    * Gets the key under which the resource source value can be found in the data map.
    * @return the key of the media resource source
    */

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/edm/provider/Mapping.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/edm/provider/Mapping.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/edm/provider/Mapping.java
index d9e3453..34d03a1 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/edm/provider/Mapping.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/edm/provider/Mapping.java
@@ -27,7 +27,6 @@ import org.apache.olingo.odata2.api.edm.EdmMapping;
 public class Mapping implements EdmMapping {
 
   private String value;
-  private String mimeType;
   private Object object;
   private String mediaResourceSourceKey;
   private String mediaResourceMimeTypeKey;
@@ -38,11 +37,6 @@ public class Mapping implements EdmMapping {
   }
 
   @Override
-  public String getMimeType() {
-    return mimeType;
-  }
-
-  @Override
   public Object getObject() {
     return object;
   }
@@ -68,18 +62,6 @@ public class Mapping implements EdmMapping {
   }
 
   /**
-   * Sets the mime type for this {@link Mapping}.
-   * @param mimeType
-   * @return {@link Mapping} for method chaining
-   * @deprecated use instead functionality of {@link #setMediaResourceMimeTypeKey(String)} method
-   */
-  @Deprecated
-  public Mapping setMimeType(final String mimeType) {
-    this.mimeType = mimeType;
-    return this;
-  }
-
-  /**
    * Sets an object. This method can be used by a provider to set whatever it wants to associate with this.
    * @param object
    * @return {@link Mapping} for method chaining

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderWriteProperties.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderWriteProperties.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderWriteProperties.java
index 822fc84..cd6aad6 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderWriteProperties.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderWriteProperties.java
@@ -34,8 +34,6 @@ import org.apache.olingo.odata2.api.uri.ExpandSelectTreeNode;
 public class EntityProviderWriteProperties {
 
   private URI serviceRoot;
-  @Deprecated
-  private String mediaResourceMimeType;
   private InlineCount inlineCountType;
   private Integer inlineCount;
   private String nextLink;
@@ -44,9 +42,19 @@ public class EntityProviderWriteProperties {
   private URI selfLink;
   private boolean includeSimplePropertyType;
   private Map<String, Map<String, Object>> additionalLinks;
+  private boolean omitJsonWrapper;
+  private boolean contentOnly;
 
   private EntityProviderWriteProperties() {}
 
+  public final boolean isContentOnly() {
+    return contentOnly;
+  }
+
+  public final boolean isOmitJsonWrapper() {
+    return omitJsonWrapper;
+  }
+
   /**
    * Returns if type information of simple properties should be in the payload.
    * @return true if information should be in the payload.
@@ -72,17 +80,6 @@ public class EntityProviderWriteProperties {
   }
 
   /**
-   * Gets the MIME type of the media resource.
-   * @return the MIME type of the media resource
-   * @deprecated use instead the functionality of 'EdmMapping -> mediaResourceMimeTypeKey' to reference via a key
-   * to the 'mime type' of the media resource provided in the entity data map
-   */
-  @Deprecated
-  public final String getMediaResourceMimeType() {
-    return mediaResourceMimeType;
-  }
-
-  /**
    * Gets the type of the inlinecount request from the system query option.
    * @return the type of the inlinecount request from the system query option
    */
@@ -146,17 +143,6 @@ public class EntityProviderWriteProperties {
     }
 
     /**
-     * @param mediaResourceMimeType the mediaResourceMimeType to set
-     * @deprecated use instead the functionality of 'EdmMapping -> mediaResourceMimeTypeKey' to reference via a key
-     * to the 'mime type' of the media resource provided in the entity data map
-     */
-    @Deprecated
-    public final ODataEntityProviderPropertiesBuilder mediaResourceMimeType(final String mediaResourceMimeType) {
-      properties.mediaResourceMimeType = mediaResourceMimeType;
-      return this;
-    }
-
-    /**
      * @param inlineCountType the inlineCountType to set
      */
     public final ODataEntityProviderPropertiesBuilder inlineCountType(final InlineCount inlineCountType) {
@@ -229,8 +215,17 @@ public class EntityProviderWriteProperties {
       return this;
     }
 
+    public ODataEntityProviderPropertiesBuilder omitJsonWrapper(final boolean omitJsonWrapper) {
+      properties.omitJsonWrapper = omitJsonWrapper;
+      return this;
+    }
+
+    public ODataEntityProviderPropertiesBuilder contentOnly(final boolean contentOnly) {
+      properties.contentOnly = contentOnly;
+      return this;
+    }
+
     public ODataEntityProviderPropertiesBuilder fromProperties(final EntityProviderWriteProperties properties) {
-      this.properties.mediaResourceMimeType = properties.getMediaResourceMimeType();
       this.properties.inlineCountType = properties.getInlineCountType();
       this.properties.inlineCount = properties.getInlineCount();
       this.properties.nextLink = properties.getNextLink();
@@ -239,8 +234,11 @@ public class EntityProviderWriteProperties {
       this.properties.selfLink = properties.getSelfLink();
       this.properties.includeSimplePropertyType = properties.includeSimplePropertyType;
       this.properties.additionalLinks = properties.additionalLinks;
+      this.properties.omitJsonWrapper = properties.omitJsonWrapper;
+      this.properties.contentOnly = properties.contentOnly;
       return this;
     }
+
   }
 
   public static ODataEntityProviderPropertiesBuilder fromProperties(final EntityProviderWriteProperties properties) {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/processor/ODataResponse.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/processor/ODataResponse.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/processor/ODataResponse.java
index 345368e..2035b25 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/processor/ODataResponse.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/processor/ODataResponse.java
@@ -19,9 +19,11 @@
 package org.apache.olingo.odata2.api.processor;
 
 import java.io.IOException;
+import java.io.InputStream;
 import java.util.Set;
 
 import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
+import org.apache.olingo.odata2.api.exception.ODataException;
 import org.apache.olingo.odata2.api.rt.RuntimeDelegate;
 
 /**
@@ -52,6 +54,18 @@ public abstract class ODataResponse {
   public abstract Object getEntity();
 
   /**
+   * @return a response entity as inputStream which becomes the body part of a response message
+   * @throws ODataException throws ODataException in case of entity is not a stream (internal ClassCastException)
+   */
+  public InputStream getEntityAsStream() throws ODataException {
+    try {
+      return (InputStream) getEntity();
+    } catch (ClassCastException e) {
+      throw new ODataException(e);
+    }
+  }
+
+  /**
    * Close the underlying entity input stream (if such a stream is available) and release all with this repsonse
    * associated resources.
    * 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/pom.xml b/odata2-lib/odata-core/pom.xml
index b4f612a..4a59835 100644
--- a/odata2-lib/odata-core/pom.xml
+++ b/odata2-lib/odata-core/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib</artifactId>
-		<version>1.3.0-SNAPSHOT</version>
+		<version>2.0.0</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ODataRequestImpl.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ODataRequestImpl.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ODataRequestImpl.java
index dd3173b..67e77b4 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ODataRequestImpl.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ODataRequestImpl.java
@@ -20,11 +20,11 @@ package org.apache.olingo.odata2.core;
 
 import java.io.InputStream;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Map.Entry;
 
 import org.apache.olingo.odata2.api.commons.ODataHttpMethod;
 import org.apache.olingo.odata2.api.processor.ODataRequest;
@@ -37,7 +37,7 @@ import org.apache.olingo.odata2.core.commons.ContentType;
 public class ODataRequestImpl extends ODataRequest {
 
   private ODataHttpMethod method;
-  private Map<String, List<String>> requestHeaders = new HashMap<String, List<String>>();
+  private CaseInsensitiveMap requestHeaders = new CaseInsensitiveMap();
   private InputStream body;
   private PathInfo pathInfo;
   private Map<String, String> queryParameters;
@@ -73,7 +73,7 @@ public class ODataRequestImpl extends ODataRequest {
 
   @Override
   public Map<String, List<String>> getRequestHeaders() {
-    return Collections.unmodifiableMap(requestHeaders);
+    return requestHeaders;
   }
 
   @Override
@@ -93,7 +93,7 @@ public class ODataRequestImpl extends ODataRequest {
 
   public class ODataRequestBuilderImpl extends ODataRequestBuilder {
     private ODataHttpMethod method;
-    private Map<String, List<String>> requestHeaders = new HashMap<String, List<String>>();
+    private CaseInsensitiveMap requestHeaders = new CaseInsensitiveMap();
     private InputStream body;
     private PathInfo pathInfo;
     private Map<String, String> queryParameters;
@@ -116,7 +116,11 @@ public class ODataRequestImpl extends ODataRequest {
 
     @Override
     public ODataRequestBuilder requestHeaders(final Map<String, List<String>> headers) {
-      requestHeaders = headers;
+      requestHeaders = new CaseInsensitiveMap();
+      for (Entry<String, List<String>> set : headers.entrySet()) {
+        requestHeaders.put(set.getKey(), set.getValue());
+      }
+
       return this;
     }
 
@@ -170,7 +174,11 @@ public class ODataRequestImpl extends ODataRequest {
       if (request.getContentType() != null) {
         contentType = ContentType.create(request.getContentType());
       }
-      requestHeaders = request.getRequestHeaders();
+
+      requestHeaders = new CaseInsensitiveMap();
+      for (Entry<String, List<String>> set : request.getRequestHeaders().entrySet()) {
+        requestHeaders.put(set.getKey(), set.getValue());
+      }
 
       if (request.getAcceptHeaders() != null) {
         acceptHeaders = new ArrayList<String>();
@@ -195,4 +203,25 @@ public class ODataRequestImpl extends ODataRequest {
     }
 
   }
+
+  private class CaseInsensitiveMap extends HashMap<String, List<String>> {
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public List<String> put(final String key, final List<String> value) {
+      return super.put(key.toLowerCase(), value);
+    }
+
+    // not @Override because that would require the key parameter to be of type Object
+    public List<String> get(final String key) {
+      return super.get(key.toLowerCase());
+    }
+
+    @Override
+    public List<String> get(final Object key) {
+      String skey = (String) key;
+      return super.get(skey.toLowerCase());
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/AcceptParser.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/AcceptParser.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/AcceptParser.java
index d56e13e..946fccf 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/AcceptParser.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/AcceptParser.java
@@ -51,7 +51,8 @@ public class AcceptParser {
   public static List<String> parseAcceptHeaders(final String headerValue) throws BatchException {
     TreeSet<Accept> acceptTree = getAcceptTree();
     List<String> acceptHeaders = new ArrayList<String>();
-    Scanner acceptHeaderScanner = new Scanner(headerValue).useDelimiter(",\\s?");
+    Scanner acceptHeaderScanner = new Scanner(headerValue);
+    acceptHeaderScanner.useDelimiter(",\\s?");
     while (acceptHeaderScanner.hasNext()) {
       if (acceptHeaderScanner.hasNext(REG_EX_ACCEPT_WITH_Q_FACTOR)) {
         acceptHeaderScanner.next(REG_EX_ACCEPT_WITH_Q_FACTOR);
@@ -107,7 +108,9 @@ public class AcceptParser {
   public static List<String> parseAcceptableLanguages(final String headerValue) throws BatchException {
     List<String> acceptLanguages = new LinkedList<String>();
     TreeSet<Accept> acceptTree = getAcceptTree();
-    Scanner acceptLanguageScanner = new Scanner(headerValue).useDelimiter(",\\s?");
+    Scanner acceptLanguageScanner = new Scanner(headerValue);
+    acceptLanguageScanner.useDelimiter(",\\s?");
+
     while (acceptLanguageScanner.hasNext()) {
       if (acceptLanguageScanner.hasNext(REG_EX_ACCEPT_LANGUAGES_WITH_Q_FACTOR)) {
         acceptLanguageScanner.next(REG_EX_ACCEPT_LANGUAGES_WITH_Q_FACTOR);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestParser.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestParser.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestParser.java
index 6584ee9..6ac1445 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestParser.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestParser.java
@@ -107,7 +107,8 @@ public class BatchRequestParser {
   }
 
   public List<BatchRequestPart> parse(final InputStream in) throws BatchException {
-    Scanner scanner = new Scanner(in, BatchHelper.DEFAULT_ENCODING).useDelimiter(LF);
+    Scanner scanner = new Scanner(in, BatchHelper.DEFAULT_ENCODING);
+    scanner.useDelimiter(LF);
     baseUri = getBaseUri();
     List<BatchRequestPart> requestList;
     try {
@@ -185,8 +186,8 @@ public class BatchRequestParser {
   }
 
   private BatchRequestPart parseBatchRequestPart(final Scanner scanner, final String boundary,
-                                                 final Map<String, String> mimeHeaders,
-                                                 final String contentType) throws BatchException {
+      final Map<String, String> mimeHeaders,
+      final String contentType) throws BatchException {
     if (HttpContentType.APPLICATION_HTTP.equalsIgnoreCase(contentType)) {
       validateEncoding(mimeHeaders.get(BatchHelper.HTTP_CONTENT_TRANSFER_ENCODING.toLowerCase(Locale.ENGLISH)));
       parseNewLine(scanner);// mandatory
@@ -216,8 +217,8 @@ public class BatchRequestParser {
   }
 
   private BatchRequestPart parseBatchRequestPartInChangeset(final Scanner scanner, final String boundary,
-                                                            final Map<String, String> mimeHeaders,
-                                                            final String contentType) throws BatchException {
+      final Map<String, String> mimeHeaders,
+      final String contentType) throws BatchException {
     if (HttpContentType.APPLICATION_HTTP.equalsIgnoreCase(contentType)) {
       validateEncoding(mimeHeaders.get(BatchHelper.HTTP_CONTENT_TRANSFER_ENCODING.toLowerCase(Locale.ENGLISH)));
       parseNewLine(scanner);// mandatory
@@ -230,7 +231,7 @@ public class BatchRequestParser {
   }
 
   private ODataRequest parseRequest(final Scanner scanner, final boolean isChangeSet, final String boundary)
-          throws BatchException {
+      throws BatchException {
     if (scanner.hasNext(REG_EX_REQUEST_LINE)) {
       scanner.next(REG_EX_REQUEST_LINE);
       currentLineNumber++;
@@ -291,11 +292,11 @@ public class BatchRequestParser {
   }
 
   private Map<String, List<String>> parseRequestHeaders(final Scanner scanner, final String boundary)
-          throws BatchException {
+      throws BatchException {
     Map<String, List<String>> headers = new HashMap<String, List<String>>();
     while (scanner.hasNext()
-            && !scanner.hasNext(REG_EX_BLANK_LINE)
-            && !scanner.hasNext("--" + boundary + REG_EX_ZERO_OR_MORE_WHITESPACES)) {
+        && !scanner.hasNext(REG_EX_BLANK_LINE)
+        && !scanner.hasNext("--" + boundary + REG_EX_ZERO_OR_MORE_WHITESPACES)) {
       if (scanner.hasNext(REG_EX_HEADER)) {
         scanner.next(REG_EX_HEADER);
         currentLineNumber++;
@@ -339,7 +340,8 @@ public class BatchRequestParser {
     final String odataPathSegmentsAsString;
     final String queryParametersAsString;
     try {
-      Scanner uriScanner = new Scanner(uri).useDelimiter(LF);
+      Scanner uriScanner = new Scanner(uri);
+      uriScanner.useDelimiter(LF);
       URI uriObject = new URI(uri);
       if (uriObject.isAbsolute()) {
         Pattern regexRequestUri = Pattern.compile(baseUri + "/([^/][^?]*)(\\?.*)?");
@@ -392,7 +394,8 @@ public class BatchRequestParser {
   }
 
   private Map<String, String> parseQueryParameters(final String uri) throws BatchException {
-    Scanner uriScanner = new Scanner(uri).useDelimiter("\n");
+    Scanner uriScanner = new Scanner(uri);
+    uriScanner.useDelimiter("\n");
     Map<String, String> queryParametersMap = new HashMap<String, String>();
     Pattern regex = Pattern.compile("(?:" + baseUri + "/)?" + "[^?]+" + "\\?(.*)");
     if (uriScanner.hasNext(regex)) {
@@ -400,7 +403,8 @@ public class BatchRequestParser {
       MatchResult uriResult = uriScanner.match();
       if (uriResult.groupCount() == 1) {
         String queryParams = uriResult.group(1);
-        Scanner queryParamsScanner = new Scanner(queryParams).useDelimiter("&");
+        Scanner queryParamsScanner = new Scanner(queryParams);
+        queryParamsScanner.useDelimiter("&");
         while (queryParamsScanner.hasNext(REG_EX_QUERY_PARAMETER)) {
           queryParamsScanner.next(REG_EX_QUERY_PARAMETER);
           MatchResult result = queryParamsScanner.match();
@@ -425,7 +429,8 @@ public class BatchRequestParser {
   }
 
   private List<PathSegment> parseODataPathSegments(final String odataPathSegmentsAsString) {
-    Scanner pathSegmentScanner = new Scanner(odataPathSegmentsAsString).useDelimiter("/");
+    Scanner pathSegmentScanner = new Scanner(odataPathSegmentsAsString);
+    pathSegmentScanner.useDelimiter("/");
     List<PathSegment> odataPathSegments = new ArrayList<PathSegment>();
     while (pathSegmentScanner.hasNext()) {
       odataPathSegments.add(new ODataPathSegmentImpl(pathSegmentScanner.next(), null));
@@ -468,7 +473,8 @@ public class BatchRequestParser {
   }
 
   private String getBoundary(final String contentType) throws BatchException {
-    Scanner contentTypeScanner = new Scanner(contentType).useDelimiter(";\\s?");
+    Scanner contentTypeScanner = new Scanner(contentType);
+    contentTypeScanner.useDelimiter(";\\s?");
     if (contentTypeScanner.hasNext(REG_EX_CONTENT_TYPE)) {
       contentTypeScanner.next(REG_EX_CONTENT_TYPE);
     } else {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestWriter.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestWriter.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestWriter.java
index 63453c2..a7ddfa1 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestWriter.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestWriter.java
@@ -86,7 +86,7 @@ public class BatchRequestWriter {
     writer.append(HttpHeaders.CONTENT_TYPE).append(COLON).append(SP).append(HttpContentType.APPLICATION_HTTP)
         .append(LF);
     writer.append(BatchHelper.HTTP_CONTENT_TRANSFER_ENCODING).append(COLON).append(SP)
-            .append(BatchHelper.BINARY_ENCODING).append(LF);
+        .append(BatchHelper.BINARY_ENCODING).append(LF);
     if (contentId != null) {
       writer.append(BatchHelper.HTTP_CONTENT_ID).append(COLON).append(SP).append(contentId).append(LF);
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchResponseParser.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchResponseParser.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchResponseParser.java
index 0dfe77b..b488ce2 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchResponseParser.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchResponseParser.java
@@ -70,7 +70,8 @@ public class BatchResponseParser {
   }
 
   public List<BatchSingleResponse> parse(final InputStream in) throws BatchException {
-    Scanner scanner = new Scanner(in, BatchHelper.DEFAULT_ENCODING).useDelimiter(LF);
+    Scanner scanner = new Scanner(in, BatchHelper.DEFAULT_ENCODING);
+    scanner.useDelimiter(LF);
     List<BatchSingleResponse> responseList;
     try {
       responseList = Collections.unmodifiableList(parseBatchResponse(scanner));
@@ -320,7 +321,8 @@ public class BatchResponseParser {
   }
 
   private String getBoundary(final String contentType) throws BatchException {
-    Scanner contentTypeScanner = new Scanner(contentType).useDelimiter(";\\s?");
+    Scanner contentTypeScanner = new Scanner(contentType);
+    contentTypeScanner.useDelimiter(";\\s?");
     if (contentTypeScanner.hasNext(REG_EX_CONTENT_TYPE)) {
       contentTypeScanner.next(REG_EX_CONTENT_TYPE);
     } else {
@@ -359,13 +361,13 @@ public class BatchResponseParser {
   }
 
   private void parseOptionalEmptyLine(final Scanner scanner) {
-      if (scanner.hasNext() && scanner.hasNext(REG_EX_BLANK_LINE)) {
-        scanner.next();
-        currentLineNumber++;
-      }
+    if (scanner.hasNext() && scanner.hasNext(REG_EX_BLANK_LINE)) {
+      scanner.next();
+      currentLineNumber++;
     }
+  }
 
-      private String trimQuota(String boundary) {
+  private String trimQuota(String boundary) {
     if (boundary.matches("\".*\"")) {
       boundary = boundary.replace("\"", "");
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmBinary.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmBinary.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmBinary.java
index 81f86d5..1d34b5a 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmBinary.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmBinary.java
@@ -71,22 +71,19 @@ public class EdmBinary extends AbstractSimpleType {
             :
             // In default representation, every three bytes are represented as four base-64 characters.
             // Additionally, there could be up to two padding "=" characters if the number of bytes is
-            // not a multiple of three, and there could be carriage return/line feed combinations.
-            facets.getMaxLength() >= value.length() * 3 / 4 - (value.endsWith("==") ? 2 : value.endsWith("=") ? 1 : 0)
-                - crlfLength(value);
+            // not a multiple of three, and there could be line feeds, possibly with carriage returns.
+            facets.getMaxLength() * 4L >= (value.length() - crlfLength(value)) * 3L
+                - (value.contains("==") ? 2 : value.contains("=") ? 1 : 0) * 4L;
   }
 
   private static int crlfLength(final String value) {
     int result = 0;
     int index = 0;
-    while (index >= 0) {
-      index = value.indexOf("\r\n", index);
-      if (index > 0) {
-        result++;
-        index++;
-      }
+    while ((index = value.indexOf('\n', index)) >= 0) {
+      result += index > 0 && value.charAt(index - 1) == '\r' ? 2 : 1;
+      index++;
     }
-    return result * 2;
+    return result;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationImplProv.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationImplProv.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationImplProv.java
index 01579e6..8cb8e11 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationImplProv.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/provider/EdmAssociationImplProv.java
@@ -35,6 +35,7 @@ public class EdmAssociationImplProv extends EdmNamedImplProv implements EdmAssoc
   private Association association;
   private String namespace;
   private EdmAnnotations annotations;
+  private EdmReferentialConstraintImplProv referentialConstraint;
 
   public EdmAssociationImplProv(final EdmImplProv edm, final Association association, final String namespace)
       throws EdmException {
@@ -102,8 +103,12 @@ public class EdmAssociationImplProv extends EdmNamedImplProv implements EdmAssoc
 
   @Override
   public EdmReferentialConstraint getReferentialConstraint() throws EdmException {
-    ReferentialConstraint refConstraint = association.getReferentialConstraint();
-    return new EdmReferentialConstraintImplProv(refConstraint);
+    if (referentialConstraint == null) {
+      ReferentialConstraint refConstraint = association.getReferentialConstraint();
+      if (refConstraint != null) {
+        referentialConstraint = new EdmReferentialConstraintImplProv(refConstraint);
+      }
+    }
+    return referentialConstraint;
   }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/provider/EdmFunctionImportImplProv.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/provider/EdmFunctionImportImplProv.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/provider/EdmFunctionImportImplProv.java
index 43997aa..76346dc 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/provider/EdmFunctionImportImplProv.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/provider/EdmFunctionImportImplProv.java
@@ -49,6 +49,7 @@ public class EdmFunctionImportImplProv extends EdmNamedImplProv implements EdmFu
   private Map<String, FunctionImportParameter> parameters;
   private List<String> parametersList;
   private EdmAnnotations annotations;
+  private EdmTyped edmReturnType;
 
   public EdmFunctionImportImplProv(final EdmImplProv edm, final FunctionImport functionImport,
       final EdmEntityContainer edmEntityContainer) throws EdmException {
@@ -123,8 +124,14 @@ public class EdmFunctionImportImplProv extends EdmNamedImplProv implements EdmFu
 
   @Override
   public EdmTyped getReturnType() throws EdmException {
-    final ReturnType returnType = functionImport.getReturnType();
-    return new EdmTypedImplProv(edm, functionImport.getName(), returnType.getTypeName(), returnType.getMultiplicity());
+    if (edmReturnType == null) {
+      final ReturnType returnType = functionImport.getReturnType();
+      if (returnType != null) {
+        edmReturnType =
+            new EdmTypedImplProv(edm, functionImport.getName(), returnType.getTypeName(), returnType.getMultiplicity());
+      }
+    }
+    return edmReturnType;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/BasicEntityProvider.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/BasicEntityProvider.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/BasicEntityProvider.java
index 85fe7dd..86aa817 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/BasicEntityProvider.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/BasicEntityProvider.java
@@ -43,8 +43,6 @@ import java.util.Map;
 
 /**
  * Provider for all basic (content type independent) entity provider methods.
- * 
- * 
  */
 public class BasicEntityProvider {
 
@@ -150,8 +148,8 @@ public class BasicEntityProvider {
         if (edmProperty.getMimeType() != null) {
           contentType = edmProperty.getMimeType();
         } else {
-          if (edmProperty.getMapping() != null && edmProperty.getMapping().getMimeType() != null) {
-            String mimeTypeMapping = edmProperty.getMapping().getMimeType();
+          if (edmProperty.getMapping() != null && edmProperty.getMapping().getMediaResourceMimeTypeKey() != null) {
+            String mimeTypeMapping = edmProperty.getMapping().getMediaResourceMimeTypeKey();
             if (value instanceof Map) {
               final Map<?, ?> mappedData = (Map<?, ?>) value;
               binary = mappedData.get(edmProperty.getName());

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
index 1a6bca2..45726ba 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
@@ -264,7 +264,6 @@ public class JsonEntryConsumer {
         throw new EntityProviderException(EntityProviderException.MISSING_ATTRIBUTE.addContent(FormatJson.CONTENT_TYPE)
             .addContent(FormatJson.METADATA));
       }
-      // TODO Mime Type Mapping
     } else {
       if (mediaMetadata.getContentType() != null || mediaMetadata.getEditLink() != null
           || mediaMetadata.getEtag() != null || mediaMetadata.getSourceLink() != null) {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonPropertyConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonPropertyConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonPropertyConsumer.java
index 1c3ef59..1d0cd96 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonPropertyConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonPropertyConsumer.java
@@ -138,6 +138,18 @@ public class JsonPropertyConsumer {
               .addContent(entityPropertyInfo.getName()));
         }
         break;
+      case Single:
+      case Double:
+        if (tokenType == JsonToken.STRING) {
+          value = reader.nextString();
+        } else if (tokenType == JsonToken.NUMBER) {
+          value = reader.nextDouble();
+          value = value.toString();
+        } else {
+          throw new EntityProviderException(EntityProviderException.INVALID_PROPERTY_VALUE
+              .addContent(entityPropertyInfo.getName()));
+        }
+        break;
       default:
         if (tokenType == JsonToken.STRING) {
           value = reader.nextString();

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumer.java
index 85068bf..98ee5c1 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumer.java
@@ -86,7 +86,7 @@ public class XmlEntityConsumer {
       reader = XmlStreamFactory.createStreamReader(content);
       EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet);
 
-      return new XmlEntryConsumer().readEntry(reader, eia, properties);
+      return new XmlEntryConsumer().readEntry(reader, eia, properties, false);
     } catch (EntityProviderException e) {
       cachedException = e;
       throw cachedException;

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntryConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntryConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntryConsumer.java
index 7937a17..d911326 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntryConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntryConsumer.java
@@ -74,10 +74,14 @@ public class XmlEntryConsumer {
   private String currentHandledStartTagName;
 
   public ODataEntry readEntry(final XMLStreamReader reader, final EntityInfoAggregator eia,
-      final EntityProviderReadProperties readProperties) throws EntityProviderException {
+      final EntityProviderReadProperties readProperties, final boolean isInline) throws EntityProviderException {
     try {
       initialize(readProperties);
 
+      if (isInline) {
+        setETag(reader);
+      }
+
       while (reader.hasNext() && !isEntryEndTag(reader)) {
         reader.nextTag();
         if (reader.isStartElement()) {
@@ -205,7 +209,10 @@ public class XmlEntryConsumer {
 
   private void readEntry(final XMLStreamReader reader) throws EntityProviderException, XMLStreamException {
     reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_ENTRY);
+    setETag(reader);
+  }
 
+  private void setETag(final XMLStreamReader reader) {
     final String etag = reader.getAttributeValue(Edm.NAMESPACE_M_2007_08, FormatXml.M_ETAG);
     entryMetadata.setEtag(etag);
   }
@@ -277,7 +284,7 @@ public class XmlEntryConsumer {
     final EntityProviderReadProperties inlineProperties = createInlineProperties(readProperties, navigationProperty);
 
     // validations
-    boolean isFeed = isInlineFeedValidated(reader, eia, atomLinkType, navigationPropertyName);
+    boolean isFeed = isInlineFeedValidated(reader, eia, atomLinkType, navigationProperty);
 
     List<ODataEntry> inlineEntries = new ArrayList<ODataEntry>();
 
@@ -287,7 +294,7 @@ public class XmlEntryConsumer {
       if (reader.isStartElement() && Edm.NAMESPACE_ATOM_2005.equals(reader.getNamespaceURI())
           && FormatXml.ATOM_ENTRY.equals(reader.getLocalName())) {
         XmlEntryConsumer xec = new XmlEntryConsumer();
-        ODataEntry inlineEntry = xec.readEntry(reader, inlineEia, inlineProperties);
+        ODataEntry inlineEntry = xec.readEntry(reader, inlineEia, inlineProperties, true);
         inlineEntries.add(inlineEntry);
       }
       // next tag
@@ -460,13 +467,13 @@ public class XmlEntryConsumer {
    * @param reader xml content reader which already points to <code><m:inline> tag</code>
    * @param eia all necessary information about the entity
    * @param type the atom type attribute value of the <code>link</code> tag
-   * @param navigationPropertyName the navigation property name of the entity
+   * @param navigationProperty the navigation property name of the entity
    * @return <code>true</code> for <code>Feed</code> and <code>false</code> for <code>Entry</code>
    * @throws EntityProviderException is thrown if at least one validation fails.
    * @throws EdmException if edm access fails
    */
   private boolean isInlineFeedValidated(final XMLStreamReader reader, final EntityInfoAggregator eia,
-      final String type, final String navigationPropertyName) throws EntityProviderException, EdmException {
+      final String type, final EdmNavigationProperty navigationProperty) throws EntityProviderException, EdmException {
     boolean isFeed = false;
     try {
       reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_M_2007_08, FormatXml.M_INLINE);
@@ -475,9 +482,6 @@ public class XmlEntryConsumer {
       if (cType == null) {
         throw new EntityProviderException(EntityProviderException.INVALID_INLINE_CONTENT.addContent("xml data"));
       }
-
-      EdmNavigationProperty navigationProperty =
-          (EdmNavigationProperty) eia.getEntityType().getProperty(navigationPropertyName);
       EdmMultiplicity navigationMultiplicity = navigationProperty.getMultiplicity();
 
       switch (navigationMultiplicity) {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/46d83c8e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumer.java
index 9e08dd8..f7e25a9 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumer.java
@@ -105,7 +105,7 @@ public class XmlFeedConsumer {
 
     while (reader.hasNext() && !isFeedEndTag(reader)) {
       if (FormatXml.ATOM_ENTRY.equals(reader.getLocalName())) {
-        ODataEntry entry = xec.readEntry(reader, eia, entryReadProperties);
+        ODataEntry entry = xec.readEntry(reader, eia, entryReadProperties, true);
         results.add(entry);
       } else if (FormatXml.ATOM_TOMBSTONE_DELETED_ENTRY.equals(reader.getLocalName())) {
         reader.require(XMLStreamConstants.START_ELEMENT, FormatXml.ATOM_TOMBSTONE_NAMESPACE,


Mime
View raw message