From 91407a8f6081d0f89527e1e75430b9d8c5eaddce Mon Sep 17 00:00:00 2001 From: Leon Li Date: Wed, 22 Nov 2017 10:41:42 +0800 Subject: [PATCH] Fix id type wrong due to no sorted methods from Class.getMethods --- .../src/main/java/com/yahoo/elide/core/EntityBinding.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/elide-core/src/main/java/com/yahoo/elide/core/EntityBinding.java b/elide-core/src/main/java/com/yahoo/elide/core/EntityBinding.java index a0a64100de..0ba4ae1178 100644 --- a/elide-core/src/main/java/com/yahoo/elide/core/EntityBinding.java +++ b/elide-core/src/main/java/com/yahoo/elide/core/EntityBinding.java @@ -188,6 +188,11 @@ private void bindEntityId(Class cls, String type, AccessibleObject fieldOrMet String fieldName = getFieldName(fieldOrMethod); Class fieldType = getFieldType(fieldOrMethod); + if (idType != null && fieldType.isAssignableFrom(idType)) { + // don't override idType with super class idType + return; + } + //Add id field to type map for the entity fieldsToTypes.put(fieldName, fieldType);