You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2017/01/16 19:03:44 UTC
olingo-odata2 git commit: [OLINGO-970] Minor code clean up
Repository: olingo-odata2
Updated Branches:
refs/heads/master 9d06c3228 -> d94c0456a
[OLINGO-970] Minor code clean up
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/d94c0456
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/d94c0456
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/d94c0456
Branch: refs/heads/master
Commit: d94c0456a77f7fe9222b6843a95e0eef4858c543
Parents: 9d06c32
Author: mibo <mi...@apache.org>
Authored: Mon Jan 16 20:03:34 2017 +0100
Committer: mibo <mi...@apache.org>
Committed: Mon Jan 16 20:03:34 2017 +0100
----------------------------------------------------------------------
.../processor/core/access/data/JPAEntity.java | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/d94c0456/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java
index 10a6f54..70e1285 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java
@@ -41,6 +41,7 @@ import org.apache.olingo.odata2.api.edm.EdmSimpleType;
import org.apache.olingo.odata2.api.edm.EdmStructuralType;
import org.apache.olingo.odata2.api.edm.EdmTypeKind;
import org.apache.olingo.odata2.api.edm.EdmTyped;
+import org.apache.olingo.odata2.api.edm.EdmType;
import org.apache.olingo.odata2.api.ep.entry.EntryMetadata;
import org.apache.olingo.odata2.api.ep.entry.ODataEntry;
import org.apache.olingo.odata2.api.ep.feed.ODataFeed;
@@ -444,20 +445,15 @@ public class JPAEntity {
for (String edmPropertyName : edmComplexType.getPropertyNames()) {
if (propertyValue != null) {
- EdmTyped edmTyped = (EdmTyped) edmComplexType.getProperty(edmPropertyName);
+ EdmTyped edmTyped = edmComplexType.getProperty(edmPropertyName);
accessModifier = accessModifiers.get(edmPropertyName);
- if (edmTyped.getType().getKind().toString().equals(EdmTypeKind.COMPLEX.toString())) {
- EdmStructuralType structualType = (EdmStructuralType) edmTyped.getType();
- if (propertyName != null) {
- setComplexProperty(accessModifier, embeddableObject, structualType,
- (HashMap<String, Object>) propertyValue.get(edmPropertyName), propertyName);
- } else {
- setComplexProperty(accessModifier, embeddableObject, structualType,
- (HashMap<String, Object>) propertyValue.get(edmPropertyName));
- }
+ EdmType type = edmTyped.getType();
+ if (type.getKind().toString().equals(EdmTypeKind.COMPLEX.toString())) {
+ setComplexProperty(accessModifier, embeddableObject, (EdmStructuralType) type,
+ (HashMap<String, Object>) propertyValue.get(edmPropertyName), propertyName);
} else {
- EdmSimpleType simpleType = (EdmSimpleType) edmTyped.getType();
- if (propertyName != null) {
+ EdmSimpleType simpleType = (EdmSimpleType) type;
+ if (propertyName != null) {
setProperty(accessModifier, embeddableObject, propertyValue.get(edmPropertyName),
simpleType, edmPropertyName);
} else {