From 5cee5cfa7fb746e723fc9a35e068220dba0ae837 Mon Sep 17 00:00:00 2001 From: Martin Ledvinka Date: Thu, 23 Feb 2023 13:51:28 +0100 Subject: [PATCH] [Bug #135] Improve bindable type resolution - remove instanceof. --- .../cz/cvut/kbss/jopa/query/soql/SoqlQueryListener.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jopa-impl/src/main/java/cz/cvut/kbss/jopa/query/soql/SoqlQueryListener.java b/jopa-impl/src/main/java/cz/cvut/kbss/jopa/query/soql/SoqlQueryListener.java index 5fb795afa..d6e081d6c 100644 --- a/jopa-impl/src/main/java/cz/cvut/kbss/jopa/query/soql/SoqlQueryListener.java +++ b/jopa-impl/src/main/java/cz/cvut/kbss/jopa/query/soql/SoqlQueryListener.java @@ -542,10 +542,10 @@ private void setAllNodesIris(ManagedType entityType, SoqlNode node) { } private static Type resolveBindableType(Attribute att) { - if (att instanceof SingularAttribute) { - return ((SingularAttribute) att).getType(); - } else { + if (att.isCollection()) { return ((PluralAttribute) att).getElementType(); + } else { + return ((SingularAttribute) att).getType(); } }