diff --git a/core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OType.java b/core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OType.java index ebc2b920182..a2952140d8b 100755 --- a/core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OType.java +++ b/core/src/main/java/com/orientechnologies/orient/core/metadata/schema/OType.java @@ -25,13 +25,7 @@ import com.orientechnologies.common.log.OLogManager; import com.orientechnologies.common.types.OBinary; import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal; -import com.orientechnologies.orient.core.db.record.OIdentifiable; -import com.orientechnologies.orient.core.db.record.ORecordLazyList; -import com.orientechnologies.orient.core.db.record.ORecordLazyMap; -import com.orientechnologies.orient.core.db.record.ORecordLazySet; -import com.orientechnologies.orient.core.db.record.OTrackedList; -import com.orientechnologies.orient.core.db.record.OTrackedMap; -import com.orientechnologies.orient.core.db.record.OTrackedSet; +import com.orientechnologies.orient.core.db.record.*; import com.orientechnologies.orient.core.db.record.ridbag.ORidBag; import com.orientechnologies.orient.core.id.ORID; import com.orientechnologies.orient.core.id.ORecordId; @@ -44,20 +38,11 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.text.ParseException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; /** - * Generic representation of a type.
- * allowAssignmentFrom accepts any class, but Array.class means that the type accepts generic Arrays. + * Generic representation of a type.
allowAssignmentFrom accepts any class, but Array.class means that the type accepts generic + * Arrays. * * @author Luca Garulli (l.garulli--(at)--orientdb.com) */ @@ -457,6 +442,10 @@ else if (((String) iValue).equalsIgnoreCase("false")) } } } else if (iTargetClass.equals(String.class)) { + if (iValue instanceof Collection && ((Collection) iValue).size() == 1 && ((Collection) iValue).iterator() + .next() instanceof String) { + return ((Collection) iValue).iterator().next(); + } return iValue.toString(); } else if (iTargetClass.equals(OIdentifiable.class)) { if (OMultiValue.isMultiValue(iValue)) { diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OInCondition.java b/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OInCondition.java index c22a8bfcdba..deb0ffa5649 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OInCondition.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/parser/OInCondition.java @@ -103,8 +103,9 @@ protected static Object executeQuery(OSelectStatement rightStatement, OCommandCo protected static boolean evaluateExpression(final Object iLeft, final Object iRight) { if (OMultiValue.isMultiValue(iRight)) { - if (iRight instanceof Set) - return ((Set) iRight).contains(iLeft); + if (iRight instanceof Set && ((Set) iRight).contains(iLeft)) { + return true; + } for (final Object o : OMultiValue.getMultiValueIterable(iRight, false)) { if (OQueryOperatorEquals.equals(iLeft, o))